diff options
Diffstat (limited to 'apps/user_ldap/lib/User/User.php')
-rw-r--r-- | apps/user_ldap/lib/User/User.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index 8bde353a560..2f36e205fa6 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -194,11 +194,11 @@ class User { $displayName = $displayName2 = ''; $attr = strtolower($this->connection->ldapUserDisplayName); if(isset($ldapEntry[$attr])) { - $displayName = strval($ldapEntry[$attr][0]); + $displayName = (string)$ldapEntry[$attr][0]; } $attr = strtolower($this->connection->ldapUserDisplayName2); if(isset($ldapEntry[$attr])) { - $displayName2 = strval($ldapEntry[$attr][0]); + $displayName2 = (string)$ldapEntry[$attr][0]; } if ($displayName !== '') { $this->composeAndStoreDisplayName($displayName); @@ -281,7 +281,7 @@ class User { * @throws \Exception */ public function getHomePath($valueFromLDAP = null) { - $path = strval($valueFromLDAP); + $path = (string)$valueFromLDAP; $attr = null; if (is_null($valueFromLDAP) @@ -387,7 +387,7 @@ class User { $lastChecked = $this->config->getUserValue($this->uid, 'user_ldap', self::USER_PREFKEY_LASTREFRESH, 0); - if((time() - intval($lastChecked)) < intval($this->config->getAppValue('user_ldap', 'updateAttributesInterval', 86400)) ) { + if((time() - (int)$lastChecked) < (int)$this->config->getAppValue('user_ldap', 'updateAttributesInterval', 86400)) { return false; } return true; @@ -412,7 +412,7 @@ class User { * @returns string the effective display name */ public function composeAndStoreDisplayName($displayName, $displayName2 = '') { - $displayName2 = strval($displayName2); + $displayName2 = (string)$displayName2; if($displayName2 !== '') { $displayName .= ' (' . $displayName2 . ')'; } @@ -452,20 +452,20 @@ class User { if($this->wasRefreshed('email')) { return; } - $email = strval($valueFromLDAP); + $email = (string)$valueFromLDAP; if(is_null($valueFromLDAP)) { $emailAttribute = $this->connection->ldapEmailAttribute; if ($emailAttribute !== '') { $aEmail = $this->access->readAttribute($this->dn, $emailAttribute); if(is_array($aEmail) && (count($aEmail) > 0)) { - $email = strval($aEmail[0]); + $email = (string)$aEmail[0]; } } } if ($email !== '') { $user = $this->userManager->get($this->uid); if (!is_null($user)) { - $currentEmail = strval($user->getEMailAddress()); + $currentEmail = (string)$user->getEMailAddress(); if ($currentEmail !== $email) { $user->setEMailAddress($email); } @@ -610,7 +610,7 @@ class User { */ public function handlePasswordExpiry($params) { $ppolicyDN = $this->connection->ldapDefaultPPolicyDN; - if (empty($ppolicyDN) || (intval($this->connection->turnOnPasswordChange) !== 1)) { + if (empty($ppolicyDN) || ((int)$this->connection->turnOnPasswordChange !== 1)) { return;//password expiry handling disabled } $uid = $params['uid']; @@ -646,7 +646,7 @@ class User { if($pwdGraceUseTime && $pwdGraceUseTimeCount > 0) { //was this a grace login? if($pwdGraceAuthNLimit && (count($pwdGraceAuthNLimit) > 0) - &&($pwdGraceUseTimeCount < intval($pwdGraceAuthNLimit[0]))) { //at least one more grace login available? + &&($pwdGraceUseTimeCount < (int)$pwdGraceAuthNLimit[0])) { //at least one more grace login available? $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( 'user_ldap.renewPassword.showRenewPasswordForm', array('user' => $uid))); @@ -667,8 +667,8 @@ class User { if($pwdChangedTime && (count($pwdChangedTime) > 0)) { if($pwdMaxAge && (count($pwdMaxAge) > 0) && $pwdExpireWarning && (count($pwdExpireWarning) > 0)) { - $pwdMaxAgeInt = intval($pwdMaxAge[0]); - $pwdExpireWarningInt = intval($pwdExpireWarning[0]); + $pwdMaxAgeInt = (int)$pwdMaxAge[0]; + $pwdExpireWarningInt = (int)$pwdExpireWarning[0]; if($pwdMaxAgeInt > 0 && $pwdExpireWarningInt > 0){ $pwdChangedTimeDt = \DateTime::createFromFormat('YmdHisZ', $pwdChangedTime[0]); $pwdChangedTimeDt->add(new \DateInterval('PT'.$pwdMaxAgeInt.'S')); |