Skip to content

Commit

Permalink
User is not found when is searched by name and one of surnames nextcl…
Browse files Browse the repository at this point in the history
  • Loading branch information
Flávio Gomes da Silva Lisboa committed Mar 9, 2018
1 parent 1cc7db3 commit a4653a0
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 @@ -1488,12 +1488,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 @@ -56,6 +56,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 a4653a0

Please sign in to comment.