summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Connection.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/Connection.php')
-rw-r--r--apps/user_ldap/lib/Connection.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 64c8b9675a3..6028486e8bb 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -137,7 +137,7 @@ class Connection extends LDAPUtility {
$this->configuration->$name = $value;
$after = $this->configuration->$name;
if($before !== $after) {
- if(!empty($this->configID)) {
+ if ($this->configID !== '') {
$this->configuration->saveConfiguration();
}
$this->validateConfiguration();
@@ -358,8 +358,8 @@ class Connection extends LDAPUtility {
}
}
- $backupPort = $this->configuration->ldapBackupPort;
- if(empty($backupPort)) {
+ $backupPort = intval($this->configuration->ldapBackupPort);
+ if ($backupPort <= 0) {
$this->configuration->backupPort = $this->configuration->ldapPort;
}
@@ -427,7 +427,10 @@ class Connection extends LDAPUtility {
//combinations
$agent = $this->configuration->ldapAgentName;
$pwd = $this->configuration->ldapAgentPassword;
- if((empty($agent) && !empty($pwd)) || (!empty($agent) && empty($pwd))) {
+ if (
+ ($agent === '' && $pwd !== '')
+ || ($agent !== '' && $pwd === '')
+ ) {
\OCP\Util::writeLog('user_ldap',
$errorStr.'either no password is given for the'.
'user agent or a password is given, but not an'.
@@ -568,7 +571,7 @@ class Connection extends LDAPUtility {
* @throws \OC\ServerNotAvailableException
*/
private function doConnect($host, $port) {
- if(empty($host)) {
+ if ($host === '') {
return false;
}
$this->ldapConnectionRes = $this->ldap->connect($host, $port);