Verified Commit 74ae1d63 authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: (Personal) - adapts to php 8.2

Personal classes adapted to php8.2
No related merge requests found
Showing with 8 additions and 8 deletions
+8 -8
......@@ -192,10 +192,10 @@ class UserPasswordAttribute extends CompositeAttribute
if ($value == '%askme%') {
return ['%askme%', '', '', $value, 'FALSE'];
}
$parts = explode('|', $value, 3);
$parts = explode('|', (string) $value, 3);
if ((count($parts) < 3) || !in_array($parts[1], ['TRUE','FALSE'])) {
/* Old format from FD<1.4 */
list($value, $password) = explode('|', $value, 2);
list($value, $password) = explode('|', (string) $value, 2);
} else {
list($pw_storage, $locked, $password) = $parts;
return [$pw_storage, $password, $password, $this->attributes[3]->getValue(), $locked];
......
......@@ -405,7 +405,7 @@ class user extends simplePlugin
// Get the hash of current data before modifications.
global $config;
$ldap = $config->get_ldap_link();
$currentSnapHash = md5($ldap->generateLdif($this->dn, '(!(objectClass=gosaDepartment))', 'sub'));
$currentSnapHash = md5((string) $ldap->generateLdif($this->dn, '(!(objectClass=gosaDepartment))', 'sub'));
// Verify if current snap hash already exist in the list of existing snapshots - not taking a snap if it exists.
$snapshotHandler = new SnapshotHandler();
......@@ -513,7 +513,7 @@ class user extends simplePlugin
if (isset($attrs['pwdHistory'][0])) {
unset($attrs['pwdHistory']['count']);
foreach ($attrs['pwdHistory'] as $pwdHistory) {
$pwdHistory = explode('#', $pwdHistory, 4);
$pwdHistory = explode('#', (string) $pwdHistory, 4);
$method = passwordMethod::get_method($pwdHistory[3], $user);
if (($method !== NULL) && $method->checkPassword($new_password, $pwdHistory[3])) {
return _('Password is in history of old passwords');
......@@ -537,9 +537,9 @@ class user extends simplePlugin
return _('The passwords you\'ve entered as "New password" and "Repeated new password" do not match.');
} elseif ($new_password == '') {
return msgPool::required(_('New password'));
} elseif ($check_differ && (mb_substr($current_password, 0, $differ) == mb_substr($new_password, 0, $differ))) {
} elseif ($check_differ && (mb_substr((string) $current_password, 0, $differ) == mb_substr((string) $new_password, 0, $differ))) {
return _('The password used as new and current are too similar.');
} elseif ($check_length && (mb_strlen($new_password) < $length)) {
} elseif ($check_length && (mb_strlen((string) $new_password) < $length)) {
return _('The password used as new is too short.');
} elseif (!passwordMethod::is_harmless($new_password)) {
return _('The password contains possibly problematic Unicode characters!');
......
......@@ -214,7 +214,7 @@ class userRoles extends simplePlugin
$warning->display();
}
}
} catch (NonExistingLdapNodeException $e) {
} catch (NonExistingLdapNodeException) {
/* Ignore deleted groups */
}
}
......@@ -241,7 +241,7 @@ class userRoles extends simplePlugin
$warning->display();
}
}
} catch (NonExistingLdapNodeException $e) {
} catch (NonExistingLdapNodeException) {
/* Ignore deleted roles */
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment