Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/Group_Proxy.php')
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php76
1 files changed, 71 insertions, 5 deletions
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index e546c84a90c..50c46dfbc0b 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -26,7 +26,7 @@
namespace OCA\User_LDAP;
-class Group_Proxy extends Proxy implements \OCP\GroupInterface {
+class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP {
private $backends = array();
private $refBackend = null;
@@ -34,11 +34,11 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface {
* Constructor
* @param string[] $serverConfigPrefixes array containing the config Prefixes
*/
- public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) {
+ public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap, GroupPluginManager $groupPluginManager) {
parent::__construct($ldap);
foreach($serverConfigPrefixes as $configPrefix) {
$this->backends[$configPrefix] =
- new \OCA\User_LDAP\Group_LDAP($this->getAccess($configPrefix));
+ new \OCA\User_LDAP\Group_LDAP($this->getAccess($configPrefix), $groupPluginManager);
if(is_null($this->refBackend)) {
$this->refBackend = &$this->backends[$configPrefix];
}
@@ -146,6 +146,51 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface {
}
/**
+ * @param string $gid
+ * @return bool
+ */
+ public function createGroup($gid) {
+ return $this->handleRequest(
+ $gid, 'createGroup', array($gid));
+ }
+
+ /**
+ * delete a group
+ * @param string $gid gid of the group to delete
+ * @return bool
+ */
+ public function deleteGroup($gid) {
+ return $this->handleRequest(
+ $gid, 'deleteGroup', array($gid));
+ }
+
+ /**
+ * Add a user to a group
+ * @param string $uid Name of the user to add to group
+ * @param string $gid Name of the group in which add the user
+ * @return bool
+ *
+ * Adds a user to a group.
+ */
+ public function addToGroup($uid, $gid) {
+ return $this->handleRequest(
+ $gid, 'addToGroup', array($uid, $gid));
+ }
+
+ /**
+ * Removes a user from a group
+ * @param string $uid Name of the user to remove from group
+ * @param string $gid Name of the group from which remove the user
+ * @return bool
+ *
+ * removes the user from a group.
+ */
+ public function removeFromGroup($uid, $gid) {
+ return $this->handleRequest(
+ $gid, 'removeFromGroup', array($uid, $gid));
+ }
+
+ /**
* returns the number of users in a group, who match the search term
* @param string $gid the internal group name
* @param string $search optional, a search string
@@ -157,6 +202,16 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface {
}
/**
+ * get an array with group details
+ * @param string $gid
+ * @return array|false
+ */
+ public function getGroupDetails($gid) {
+ return $this->handleRequest(
+ $gid, 'getGroupDetails', array($gid));
+ }
+
+ /**
* get a list of all groups
* @return string[] with group names
*
@@ -190,7 +245,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface {
* @return boolean
*
* Returns the supported actions as int to be
- * compared with \OC\User\Backend::CREATE_USER etc.
+ * compared with \OCP\GroupInterface::CREATE_GROUP etc.
*/
public function implementsActions($actions) {
//it's the same across all our user backends obviously
@@ -203,6 +258,17 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface {
* @return Access instance of Access for LDAP interaction
*/
public function getLDAPAccess($gid) {
- return $this->handleRequest($gid, 'getLDAPAccess', []);
+ return $this->handleRequest($gid, 'getLDAPAccess', [$gid]);
}
+
+ /**
+ * Return a new LDAP connection for the specified group.
+ * The connection needs to be closed manually.
+ * @param string $gid
+ * @return resource of the LDAP connection
+ */
+ public function getNewLDAPConnection($gid) {
+ return $this->handleRequest($gid, 'getNewLDAPConnection', array($gid));
+ }
+
}