-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User import (ldap) 1102 (with 10.0.12/13/14) instead of 5394 (with 10.0.11) #16725
Comments
Hi, |
2ee311a
to the old version, I have 5394 records updated ... Edit : |
I think I found a clue : |
Hi, This issue will be fixed by #16806. As it requires a migration, the patch cannot be applied in a production environment. You can apply the following patch instead, on GLPI 10.0.14, to fix the issue until GLPI 10.0.15 is released: diff --git a/src/User.php b/src/User.php
index 695fe4df5f..5349a49322 100644
--- a/src/User.php
+++ b/src/User.php
@@ -567,7 +567,7 @@ class User extends CommonDBTM
* and is indexed in the database, making it faster to search.
*/
return $this->getFromDBByCrit([
- 'user_dn_hash' => md5($user_dn)
+ 'user_dn_hash' => md5(Sanitizer::sanitize($user_dn))
]);
}
@@ -847,7 +847,7 @@ class User extends CommonDBTM
{
// Hash user_dn if set
if (isset($this->input['user_dn']) && is_string($this->input['user_dn']) && strlen($this->input['user_dn']) > 0) {
- $this->input['user_dn_hash'] = md5($this->input['user_dn']);
+ $this->input['user_dn_hash'] = md5(Sanitizer::sanitize($this->input['user_dn']));
}
}
@@ -3503,7 +3503,7 @@ HTML;
// Hash user_dn if is updated
if (in_array('user_dn', $this->updates)) {
$this->updates[] = 'user_dn_hash';
- $this->fields['user_dn_hash'] = is_string($this->input['user_dn']) && strlen($this->input['user_dn']) > 0 ? md5($this->input['user_dn']) : null;
+ $this->fields['user_dn_hash'] = is_string($this->input['user_dn']) && strlen($this->input['user_dn']) > 0 ? md5(Sanitizer::sanitize($this->input['user_dn'])) : null;
}
}
|
Code of Conduct
Is there an existing issue for this?
Version
10.0.13-dev
Bug description
Hello,
I have a surprising functioning for LDAP import
In 10.0.11 5394 users imported
In 10.0.12 (and .13-dev) 1102 users imported
if I put the src/User.php file from version 10.0.11, then it works as before
As a result, all of my users are not updated. I haven't managed to find any common point that could explain why only some people go back.
The problem is that I use the Last Synchronization field in users...
Thank you :)
Relevant log output
No response
Page URL
No response
Steps To reproduce
No response
Your GLPI setup information
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: