diff options
author | Robin Appelman <robin@icewind.nl> | 2021-01-14 16:51:13 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-01-19 16:33:58 +0100 |
commit | fdc8635afb189d665ad86f973003818adb4247d6 (patch) | |
tree | 2dfcced4771e7f834c045595556c30f1a59a9700 /lib | |
parent | b9287f9780c6743f0f5e2db84fe32c470cf70b22 (diff) | |
download | nextcloud-server-fdc8635afb189d665ad86f973003818adb4247d6.tar.gz nextcloud-server-fdc8635afb189d665ad86f973003818adb4247d6.zip |
extend ILDAPProvider to allow reading arbitrairy ldap attributes for users
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/LDAP/ILDAPProvider.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/public/LDAP/ILDAPProvider.php b/lib/public/LDAP/ILDAPProvider.php index d33e5858932..cbd5c353c5d 100644 --- a/lib/public/LDAP/ILDAPProvider.php +++ b/lib/public/LDAP/ILDAPProvider.php @@ -58,7 +58,7 @@ interface ILDAPProvider { * @since 11.0.0 */ public function getUserName($dn); - + /** * Convert a stored DN so it can be used as base parameter for LDAP queries. * @param string $dn the DN @@ -66,7 +66,7 @@ interface ILDAPProvider { * @since 11.0.0 */ public function DNasBaseParameter($dn); - + /** * Sanitize a DN received from the LDAP server. * @param array $dn the DN in question @@ -74,7 +74,7 @@ interface ILDAPProvider { * @since 11.0.0 */ public function sanitizeDN($dn); - + /** * Return a new LDAP connection resource for the specified user. * @param string $uid user id @@ -90,7 +90,7 @@ interface ILDAPProvider { * @since 13.0.0 */ public function getGroupLDAPConnection($gid); - + /** * Get the LDAP base for users. * @param string $uid user id @@ -99,7 +99,7 @@ interface ILDAPProvider { * @since 11.0.0 */ public function getLDAPBaseUsers($uid); - + /** * Get the LDAP base for groups. * @param string $uid user id @@ -108,7 +108,7 @@ interface ILDAPProvider { * @since 11.0.0 */ public function getLDAPBaseGroups($uid); - + /** * Check whether a LDAP DN exists * @param string $dn LDAP DN @@ -116,7 +116,7 @@ interface ILDAPProvider { * @since 11.0.0 */ public function dnExists($dn); - + /** * Clear the cache if a cache is used, otherwise do nothing. * @param string $uid user id @@ -157,4 +157,14 @@ interface ILDAPProvider { * @since 13.0.0 */ public function getLDAPGroupMemberAssoc($gid); + + /** + * Get an LDAP attribute for a nextcloud user + * @param string $uid the nextcloud user id to get the attribute for + * @param string $attribute the name of the attribute to read + * @return string|null + * @throws \Exception if user id was not found in LDAP + * @since 22.0.0 + */ + public function getUserAttribute(string $uid, string $attribute): ?string; } |