Don't advertise ability to change display name

Otherwise users can change their display name and email address which is in a SAML scenario undesired.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-07-31 16:58:51 +02:00
parent a5a406fb1f
commit 4691870887
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1

View file

@ -117,7 +117,6 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
public function implementsActions($actions) {
$availableActions = \OC\User\Backend::CHECK_PASSWORD;
$availableActions |= \OC\User\Backend::GET_DISPLAYNAME;
$availableActions |= \OC\User\Backend::SET_DISPLAYNAME;
return (bool)($availableActions & $actions);
}
@ -456,7 +455,7 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
$currentDisplayname = (string)$this->getDisplayName($uid);
if($newDisplayname !== null
&& $currentDisplayname !== $newDisplayname) {
$user->setDisplayName($newDisplayname);
$this->setDisplayName($uid, $newDisplayname);
}
}
}