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:
authorMorris Jobke <hey@morrisjobke.de>2019-07-19 18:29:24 +0300
committerGitHub <noreply@github.com>2019-07-19 18:29:24 +0300
commitc00d6f4eac9075e651fbef791f4e7c7157cad709 (patch)
treeb771f61343e10748668ae3141dcace3b86af0f1d /apps/user_ldap/lib
parentd35f4a7645b69447103032d11a22a844be5cc3b7 (diff)
parent3ed1d158bca3b317893b4d61f75a417f049232bf (diff)
Merge pull request #14540 from army1349/master
LDAP Password Modify Extended Operation support
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Access.php4
-rw-r--r--apps/user_ldap/lib/LDAP.php11
2 files changed, 14 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 406dad05ebe..6104c908a84 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -366,7 +366,9 @@ class Access extends LDAPUtility {
return false;
}
try {
- return @$this->invokeLDAPMethod('modReplace', $cr, $userDN, $password);
+ // try PASSWD extended operation first
+ return @$this->invokeLDAPMethod('exopPasswd', $cr, $userDN, '', $password) ||
+ @$this->invokeLDAPMethod('modReplace', $cr, $userDN, $password);
} catch(ConstraintViolationException $e) {
throw new HintException('Password change rejected.', \OC::$server->getL10N('user_ldap')->t('Password change rejected. Hint: ').$e->getMessage(), $e->getCode());
}
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index e6039c77d12..083d77d645d 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -221,6 +221,17 @@ class LDAP implements ILDAPWrapper {
/**
* @param LDAP $link
+ * @param string $userDN
+ * @param string $oldPassword
+ * @param string $password
+ * @return bool
+ */
+ public function exopPasswd($link, $userDN, $oldPassword, $password) {
+ return $this->invokeLDAPMethod('exop_passwd', $link, $userDN, $oldPassword, $password);
+ }
+
+ /**
+ * @param LDAP $link
* @param string $option
* @param int $value
* @return bool|mixed