diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-07-31 16:44:34 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-07-31 17:28:26 +0300 |
commit | 034e2d7c8a856ad6cadb0ad2e68289cfeacdf0d2 (patch) | |
tree | 37527f240afe576da04ea4dbfe8751500797dba7 /lib | |
parent | d187271f8154b3f313847c625ba9bfecae9581c7 (diff) |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/userbackend.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/userbackend.php b/lib/userbackend.php index c7a0b15a..d10e2a2f 100644 --- a/lib/userbackend.php +++ b/lib/userbackend.php @@ -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); } } } |