diff --git a/lib/userbackend.php b/lib/UserBackend.php similarity index 97% rename from lib/userbackend.php rename to lib/UserBackend.php index c7a0b15a5..5d8e14b39 100644 --- a/lib/userbackend.php +++ b/lib/UserBackend.php @@ -116,12 +116,7 @@ public function createUserIfNotExists($uid) { */ 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 @@ public function registerBackends(array $backends) { 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'); } diff --git a/tests/integration/features/Shibboleth.feature b/tests/integration/features/Shibboleth.feature index 4d2a047c9..94a7990e0 100644 --- a/tests/integration/features/Shibboleth.feature +++ b/tests/integration/features/Shibboleth.feature @@ -63,6 +63,7 @@ Feature: Shibboleth And I should be redirected to "http://localhost/index.php/apps/files/" Then The user value "id" should be "student1" Then The user value "email" should be "" + And The user value "display-name" should be "Default displayname of student1" Scenario: Authenticating using Shibboleth with SAML in provisioning mode and custom mapped attributes Given The setting "type" is set to "saml" diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index af7cc5195..fb0ff7241 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -226,7 +226,7 @@ public function thUserValueShouldBe($key, $value) { public function aLocalUserWithUidExists($uid) { shell_exec( sprintf( - 'sudo -u apache OC_PASS=password /opt/rh/rh-php56/root/usr/bin/php %s user:add %s --password-from-env', + 'sudo -u apache OC_PASS=password /opt/rh/rh-php56/root/usr/bin/php %s user:add %s --display-name "Default displayname of '.$uid.'" --password-from-env', __DIR__ . '/../../../../../../occ', $uid )