Skip to content

Commit d7d54b9

Browse files
authored
Merge pull request #675 from owncloud/loginname_process_chain_ldap
[full-ci] Do not check for the username if if has been processed already
2 parents 6135190 + ce9ec7b commit d7d54b9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/Helper.php

+6
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ public function loginName2UserName($param) {
192192
throw new \Exception('key uid is expected to be set in $param');
193193
}
194194

195+
if (isset($param['hasBeenHandled']) && $param['hasBeenHandled']) {
196+
// if the event has been handled already, ignore it
197+
return;
198+
}
199+
195200
$configPrefixes = $this->getServerConfigurationPrefixes(true);
196201
$ldapWrapper = new LDAP();
197202
$ocConfig = \OC::$server->getConfig();
@@ -204,6 +209,7 @@ public function loginName2UserName($param) {
204209
$uid = $userBackend->loginName2UserName($param['uid']);
205210
if ($uid !== false) {
206211
$param['uid'] = $uid;
212+
$param['hasBeenHandled'] = true; // mark the event as handled
207213
}
208214
}
209215

tests/acceptance/features/apiUserLDAP/serverConnection.feature

-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ Feature: connect to LDAP serer
4949
Given LDAP config "LDAPTestId" has key "ldapHost" set to "http://%ldap_host_without_scheme%"
5050
When user "Alice" requests "/index.php/apps/files" with "GET" using basic auth
5151
Then the HTTP status code should be "401"
52-
And the last lines of the log file should contain log-entries containing these attributes:
53-
| app | message |
54-
| PHP | ldap_connect(): Could not create session handle: Bad parameter to an ldap routine at |
55-
| PHP | ldap_set_option(): supplied argument is not a valid ldap link resource at |
5652

5753
@issue-49
5854
Scenario: authentication works when second of multiple configurations has an unreachable host configured

0 commit comments

Comments
 (0)