mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-03 09:33:46 +02:00
Claim to always support \OC\User\Backend::GET_DISPLAYNAME
`\OC_User::loginWithApache` sets the display name otherwise to the login name which is wrong. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
d187271f81
commit
034e2d7c8a
|
@ -116,12 +116,7 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
|
|||
*/
|
||||
public function implementsActions($actions) {
|
||||
$availableActions = \OC\User\Backend::CHECK_PASSWORD;
|
||||
if($this->autoprovisionAllowed()
|
||||
&& $this->config->getAppValue('user_saml', 'saml-attribute-mapping-displayName_mapping', '') !== '') {
|
||||
|
||||
$availableActions |= \OC\User\Backend::GET_DISPLAYNAME;
|
||||
}
|
||||
|
||||
$availableActions |= \OC\User\Backend::GET_DISPLAYNAME;
|
||||
return (bool)($availableActions & $actions);
|
||||
}
|
||||
|
||||
|
@ -413,7 +408,7 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
|
|||
private function getAttributeValue($name, array $attributes) {
|
||||
$keys = explode(' ', $this->config->getAppValue('user_saml', $name, ''));
|
||||
|
||||
if(count($keys) === 1 && $keys[1] === '') {
|
||||
if(count($keys) === 1 && $keys[0] === '') {
|
||||
throw new \InvalidArgumentException('Attribute is not configured');
|
||||
}
|
||||
|
||||
|
@ -460,7 +455,7 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
|
|||
$currentDisplayname = (string)$this->getDisplayName($uid);
|
||||
if($newDisplayname !== null
|
||||
&& $currentDisplayname !== $newDisplayname) {
|
||||
$this->setDisplayName($uid, $newDisplayname);
|
||||
$user->setDisplayName($newDisplayname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue