mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
fix(user_ldap): Always update avatar from LDAP when we have the data
Should be at login, in sync job, and when running ldap:check-user --update Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
d2f118f147
commit
40920ddb77
1 changed files with 1 additions and 16 deletions
|
|
@ -305,11 +305,7 @@ class User {
|
|||
foreach ($attributes as $attribute) {
|
||||
if (isset($ldapEntry[$attribute])) {
|
||||
$this->avatarImage = $ldapEntry[$attribute][0];
|
||||
// the call to the method that saves the avatar in the file
|
||||
// system must be postponed after the login. It is to ensure
|
||||
// external mounts are mounted properly (e.g. with login
|
||||
// credentials from the session).
|
||||
Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin');
|
||||
$this->updateAvatar();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -628,17 +624,6 @@ class User {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* called by a post_login hook to save the avatar picture
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function updateAvatarPostLogin($params) {
|
||||
if (isset($params['uid']) && $params['uid'] === $this->getUsername()) {
|
||||
$this->updateAvatar();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief attempts to get an image from LDAP and sets it as Nextcloud avatar
|
||||
* @return bool true when the avatar was set successfully or is up to date
|
||||
|
|
|
|||
Loading…
Reference in a new issue