aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-01-14 16:51:13 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-01-22 13:33:32 +0000
commitb38149edaa5fea26704c15ba4f0313302e837819 (patch)
tree19f20291f9564eaab8c646baedc89694f4a2faf0 /lib
parent24a7772d6c37eaad592f7124fc6affe44284d3ca (diff)
downloadnextcloud-server-b38149edaa5fea26704c15ba4f0313302e837819.tar.gz
nextcloud-server-b38149edaa5fea26704c15ba4f0313302e837819.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.php24
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;
}