Skip to content

Commit

Permalink
User is not found when is searched by name and one of surnames #7510
Browse files Browse the repository at this point in the history
  • Loading branch information
Flávio Gomes da Silva Lisboa committed May 16, 2018
1 parent 0011bfb commit 80328f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -1501,12 +1501,17 @@ private function prepareSearchTerm($term) {
$config = \OC::$server->getConfig();

$allowEnum = $config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes');
$allowMedialSearch = $this->connection->ldapMedialSearch;

$result = $term;
if ($term === '') {
$result = '*';
} else if ($allowEnum !== 'no') {
$result = $term . '*';
if ($allowMedialSearch) {
$result = '*' . $term . '*';
} else {
$result = $term . '*';
}
}
return $result;
}
Expand Down
1 change: 1 addition & 0 deletions apps/user_ldap/lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class Configuration {
'turnOnPasswordChange' => false,
'ldapDynamicGroupMemberURL' => null,
'ldapDefaultPPolicyDN' => null,
'ldapMedialSearch' => false
);

/**
Expand Down
1 change: 1 addition & 0 deletions apps/user_ldap/lib/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
* @property string ldapUuidGroupAttribute
* @property string ldapExpertUUIDUserAttr
* @property string ldapExpertUUIDGroupAttr
* @property boolean ldapMedialSearch
*/
class Connection extends LDAPUtility {
private $ldapConnectionRes = null;
Expand Down

0 comments on commit 80328f3

Please sign in to comment.