diff options
author | root <root@localhost.localdomain> | 2016-07-22 16:46:29 +0800 |
---|---|---|
committer | root <root@localhost.localdomain> | 2016-07-22 16:46:29 +0800 |
commit | 02ec8b1726eb867e88dd2c31a74a080e451a31d1 (patch) | |
tree | 2ca1a1c490003ed8524cd71363b5e2f9c38a70f7 /apps/user_ldap/lib/User_Proxy.php | |
parent | 4b4990c48fd4c6841bde260b2b2e1bc665b46e1c (diff) | |
download | nextcloud-server-02ec8b1726eb867e88dd2c31a74a080e451a31d1.tar.gz nextcloud-server-02ec8b1726eb867e88dd2c31a74a080e451a31d1.zip |
New LDAPProvider for user_ldap
Diffstat (limited to 'apps/user_ldap/lib/User_Proxy.php')
-rw-r--r-- | apps/user_ldap/lib/User_Proxy.php | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php index c86d4f29ec4..8537d22a43b 100644 --- a/apps/user_ldap/lib/User_Proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -9,6 +9,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin McCorkell <robin@mccorkell.me.uk> * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Roger Szabo <roger.szabo@web.de> * * @license AGPL-3.0 * @@ -31,7 +32,7 @@ namespace OCA\User_LDAP; use OCA\User_LDAP\User\User; use OCP\IConfig; -class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface { +class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface, IUserLDAP { private $backends = array(); private $refBackend = null; @@ -193,6 +194,17 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface $id = 'LOGINNAME,' . $loginName; return $this->handleRequest($id, 'loginName2UserName', array($loginName)); } + + /** + * returns the username for the given LDAP DN, if available + * + * @param string $dn + * @return string|false with the name to use in ownCloud + */ + public function dn2UserName($dn) { + $id = 'DN,' . $dn; + return $this->handleRequest($id, 'dn2UserName', array($dn)); + } /** * get the user's home directory @@ -273,4 +285,22 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface return $users; } + /** + * Return access for LDAP interaction. + * @param string $uid + * @return Access instance of Access for LDAP interaction + */ + public function getLDAPAccess($uid) { + return $this->handleRequest($uid, 'getLDAPAccess', array($uid)); + } + + /** + * Return a new LDAP connection for the specified user. + * The connection needs to be closed manually. + * @param string $uid + * @return resource of the LDAP connection + */ + public function getNewLDAPConnection($uid) { + return $this->handleRequest($uid, 'getNewLDAPConnection', array($uid)); + } } |