summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Configuration.php2
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php2
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php2
-rw-r--r--apps/user_ldap/lib/ILDAPWrapper.php4
-rw-r--r--apps/user_ldap/lib/LDAP.php4
-rw-r--r--apps/user_ldap/lib/Notification/Notifier.php4
-rw-r--r--apps/user_ldap/lib/User_LDAP.php2
-rw-r--r--apps/user_ldap/lib/User_Proxy.php2
-rw-r--r--apps/user_ldap/lib/Wizard.php21
9 files changed, 15 insertions, 28 deletions
diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php
index 851ff03cbb4..c65e6e34e2c 100644
--- a/apps/user_ldap/lib/Configuration.php
+++ b/apps/user_ldap/lib/Configuration.php
@@ -349,7 +349,7 @@ class Configuration {
*/
protected function getSystemValue($varName) {
//FIXME: if another system value is added, softcode the default value
- return \OCP\Config::getSystemValue($varName, false);
+ return \OC::$server->getConfig()->getSystemValue($varName, false);
}
/**
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index 60ce664684a..f7617fa5a51 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -1067,7 +1067,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface {
* @return boolean
*
* Returns the supported actions as int to be
- * compared with OC_USER_BACKEND_CREATE_USER etc.
+ * compared with \OC\User\Backend::CREATE_USER etc.
*/
public function implementsActions($actions) {
return (bool)(\OC\Group\Backend::COUNT_USERS & $actions);
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index c102e7ac626..e546c84a90c 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -190,7 +190,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 \OC\User\Backend::CREATE_USER etc.
*/
public function implementsActions($actions) {
//it's the same across all our user backends obviously
diff --git a/apps/user_ldap/lib/ILDAPWrapper.php b/apps/user_ldap/lib/ILDAPWrapper.php
index 4034d0baea4..71dd60c3725 100644
--- a/apps/user_ldap/lib/ILDAPWrapper.php
+++ b/apps/user_ldap/lib/ILDAPWrapper.php
@@ -82,14 +82,14 @@ interface ILDAPWrapper {
/**
* Return the LDAP error number of the last LDAP command
* @param resource $link LDAP link resource
- * @return string error message as string
+ * @return int error code
*/
public function errno($link);
/**
* Return the LDAP error message of the last LDAP command
* @param resource $link LDAP link resource
- * @return int error code as integer
+ * @return string error message
*/
public function error($link);
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index ebee0784130..eafd8eacd06 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -100,7 +100,7 @@ class LDAP implements ILDAPWrapper {
/**
* @param LDAP $link
- * @return mixed|string
+ * @return integer
*/
public function errno($link) {
return $this->invokeLDAPMethod('errno', $link);
@@ -108,7 +108,7 @@ class LDAP implements ILDAPWrapper {
/**
* @param LDAP $link
- * @return int|mixed
+ * @return string
*/
public function error($link) {
return $this->invokeLDAPMethod('error', $link);
diff --git a/apps/user_ldap/lib/Notification/Notifier.php b/apps/user_ldap/lib/Notification/Notifier.php
index 0099d764f03..795d8d4c344 100644
--- a/apps/user_ldap/lib/Notification/Notifier.php
+++ b/apps/user_ldap/lib/Notification/Notifier.php
@@ -63,9 +63,9 @@ class Notifier implements INotifier {
$params = $notification->getSubjectParameters();
$days = (int) $params[0];
if ($days === 2) {
- $notification->setParsedSubject($l->t('Your password will expire tomorrow.', $days));
+ $notification->setParsedSubject($l->t('Your password will expire tomorrow.'));
} else if ($days === 1) {
- $notification->setParsedSubject($l->t('Your password will expire today.', $days));
+ $notification->setParsedSubject($l->t('Your password will expire today.'));
} else {
$notification->setParsedSubject($l->n(
'Your password will expire within %n day.',
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index 75cdb3951ca..3cc2fec740e 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -486,7 +486,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
* @return boolean
*
* Returns the supported actions as int to be
- * compared with OC_USER_BACKEND_CREATE_USER etc.
+ * compared with \OC\User\Backend::CREATE_USER etc.
*/
public function implementsActions($actions) {
return (bool)((Backend::CHECK_PASSWORD
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php
index 8e81b10f7b3..d1784ad7c14 100644
--- a/apps/user_ldap/lib/User_Proxy.php
+++ b/apps/user_ldap/lib/User_Proxy.php
@@ -119,7 +119,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
* @return boolean
*
* Returns the supported actions as int to be
- * compared with OC_USER_BACKEND_CREATE_USER etc.
+ * compared with \OC\User\Backend::CREATE_USER etc.
*/
public function implementsActions($actions) {
//it's the same across all our user backends obviously
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index dfbde31314e..9d4da9cbf3f 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -905,7 +905,7 @@ class Wizard extends LDAPUtility {
$er = $this->ldap->firstEntry($cr, $rr);
$attrs = $this->ldap->getAttributes($cr, $er);
$dn = $this->ldap->getDN($cr, $er);
- if ($dn == false || $dn === '') {
+ if ($dn === false || $dn === '') {
continue;
}
$filterPart = '(memberof=' . $dn . ')';
@@ -1019,21 +1019,14 @@ class Wizard extends LDAPUtility {
/**
* Connects and Binds to an LDAP Server
+ *
* @param int $port the port to connect with
* @param bool $tls whether startTLS is to be used
- * @param bool $ncc
* @return bool
* @throws \Exception
*/
- private function connectAndBind($port = 389, $tls = false, $ncc = false) {
- if($ncc) {
- //No certificate check
- //FIXME: undo afterwards
- putenv('LDAPTLS_REQCERT=never');
- }
-
+ private function connectAndBind($port, $tls) {
//connect, does not really trigger any server communication
- \OCP\Util::writeLog('user_ldap', 'Wiz: Checking Host Info ', \OCP\Util::DEBUG);
$host = $this->configuration->ldapHost;
$hostInfo = parse_url($host);
if(!$hostInfo) {
@@ -1045,7 +1038,6 @@ class Wizard extends LDAPUtility {
throw new \Exception(self::$l->t('Invalid Host'));
}
- \OCP\Util::writeLog('user_ldap', 'Wiz: Setting LDAP Options ', \OCP\Util::DEBUG);
//set LDAP options
$this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
$this->ldap->setOption($cr, LDAP_OPT_REFERRALS, 0);
@@ -1074,18 +1066,13 @@ class Wizard extends LDAPUtility {
if($login === true) {
$this->ldap->unbind($cr);
- if($ncc) {
- throw new \Exception('Certificate cannot be validated.');
- }
\OCP\Util::writeLog('user_ldap', 'Wiz: Bind successful to Port '. $port . ' TLS ' . intval($tls), \OCP\Util::DEBUG);
return true;
}
- if($errNo === -1 || ($errNo === 2 && $ncc)) {
+ if($errNo === -1) {
//host, port or TLS wrong
return false;
- } else if ($errNo === 2) {
- return $this->connectAndBind($port, $tls, true);
}
throw new \Exception($error, $errNo);
}