@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function connect($host, $port) { |
57 | 57 | if (strpos($host, '://') === false) { |
58 | - $host = 'ldap://' . $host; |
|
58 | + $host = 'ldap://'.$host; |
|
59 | 59 | } |
60 | 60 | if (strpos($host, ':', strpos($host, '://') + 1) === false) { |
61 | 61 | //ldap_connect ignores port parameter when URLs are passed |
62 | - $host .= ':' . $port; |
|
62 | + $host .= ':'.$port; |
|
63 | 63 | } |
64 | 64 | return $this->invokeLDAPMethod('connect', $host); |
65 | 65 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * @throws \Exception |
195 | 195 | */ |
196 | 196 | public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0) { |
197 | - $oldHandler = set_error_handler(function ($no, $message, $file, $line) use (&$oldHandler) { |
|
197 | + $oldHandler = set_error_handler(function($no, $message, $file, $line) use (&$oldHandler) { |
|
198 | 198 | if (strpos($message, 'Partial search results returned: Sizelimit exceeded') !== false) { |
199 | 199 | return true; |
200 | 200 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | protected function invokeLDAPMethod() { |
307 | 307 | $arguments = func_get_args(); |
308 | - $func = 'ldap_' . array_shift($arguments); |
|
308 | + $func = 'ldap_'.array_shift($arguments); |
|
309 | 309 | if (function_exists($func)) { |
310 | 310 | $this->preFunctionCall($func, $arguments); |
311 | 311 | $result = call_user_func_array($func, $arguments); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | if ($errorCode === 0) { |
340 | 340 | return; |
341 | 341 | } |
342 | - $errorMsg = ldap_error($resource); |
|
342 | + $errorMsg = ldap_error($resource); |
|
343 | 343 | |
344 | 344 | if ($this->curFunc === 'ldap_get_entries' |
345 | 345 | && $errorCode === -4) { |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | throw new \Exception('LDAP Operations error', $errorCode); |
358 | 358 | } elseif ($errorCode === 19) { |
359 | 359 | ldap_get_option($this->curArgs[0], LDAP_OPT_ERROR_STRING, $extended_error); |
360 | - throw new ConstraintViolationException(!empty($extended_error)?$extended_error:$errorMsg, $errorCode); |
|
360 | + throw new ConstraintViolationException(!empty($extended_error) ? $extended_error : $errorMsg, $errorCode); |
|
361 | 361 | } else { |
362 | 362 | \OC::$server->getLogger()->debug('LDAP error {message} ({code}) after calling {func}', [ |
363 | 363 | 'app' => 'user_ldap', |
@@ -28,9 +28,9 @@ |
||
28 | 28 | trait TLinkId { |
29 | 29 | public function getLinkId($link) { |
30 | 30 | if (is_resource($link)) { |
31 | - return (int)$link; |
|
31 | + return (int) $link; |
|
32 | 32 | } elseif (is_array($link) && isset($link[0]) && is_resource($link[0])) { |
33 | - return (int)$link[0]; |
|
33 | + return (int) $link[0]; |
|
34 | 34 | } |
35 | 35 | throw new \RuntimeException('No resource provided'); |
36 | 36 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $this->abandonPagedSearch(); |
197 | 197 | // openLDAP requires that we init a new Paged Search. Not needed by AD, |
198 | 198 | // but does not hurt either. |
199 | - $pagingSize = (int)$this->connection->ldapPagingSize; |
|
199 | + $pagingSize = (int) $this->connection->ldapPagingSize; |
|
200 | 200 | // 0 won't result in replies, small numbers may leave out groups |
201 | 201 | // (cf. #12306), 500 is default for paging and should work everywhere. |
202 | 202 | $maxResults = $pagingSize > 20 ? $pagingSize : 500; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $result = $this->extractRangeData($result, $attr); |
227 | 227 | if (!empty($result)) { |
228 | 228 | $normalizedResult = $this->extractAttributeValuesFromResult( |
229 | - [ $attr => $result['values'] ], |
|
229 | + [$attr => $result['values']], |
|
230 | 230 | $attr |
231 | 231 | ); |
232 | 232 | $values = array_merge($values, $normalizedResult); |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | // no more results left |
237 | 237 | return $values; |
238 | 238 | } else { |
239 | - $low = $result['rangeHigh'] + 1; |
|
240 | - $attrToRead = $result['attributeName'] . ';range=' . $low . '-*'; |
|
239 | + $low = $result['rangeHigh'] + 1; |
|
240 | + $attrToRead = $result['attributeName'].';range='.$low.'-*'; |
|
241 | 241 | $isRangeRequest = true; |
242 | 242 | } |
243 | 243 | } |
@@ -267,13 +267,13 @@ discard block |
||
267 | 267 | if (!$this->ldap->isResource($rr)) { |
268 | 268 | if ($attribute !== '') { |
269 | 269 | //do not throw this message on userExists check, irritates |
270 | - \OCP\Util::writeLog('user_ldap', 'readAttribute failed for DN ' . $dn, ILogger::DEBUG); |
|
270 | + \OCP\Util::writeLog('user_ldap', 'readAttribute failed for DN '.$dn, ILogger::DEBUG); |
|
271 | 271 | } |
272 | 272 | //in case an error occurs , e.g. object does not exist |
273 | 273 | return false; |
274 | 274 | } |
275 | 275 | if ($attribute === '' && ($filter === 'objectclass=*' || $this->invokeLDAPMethod('countEntries', $cr, $rr) === 1)) { |
276 | - \OCP\Util::writeLog('user_ldap', 'readAttribute: ' . $dn . ' found', ILogger::DEBUG); |
|
276 | + \OCP\Util::writeLog('user_ldap', 'readAttribute: '.$dn.' found', ILogger::DEBUG); |
|
277 | 277 | return true; |
278 | 278 | } |
279 | 279 | $er = $this->invokeLDAPMethod('firstEntry', $cr, $rr); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $values = []; |
301 | 301 | if (isset($result[$attribute]) && $result[$attribute]['count'] > 0) { |
302 | 302 | $lowercaseAttribute = strtolower($attribute); |
303 | - for ($i=0;$i<$result[$attribute]['count'];$i++) { |
|
303 | + for ($i = 0; $i < $result[$attribute]['count']; $i++) { |
|
304 | 304 | if ($this->resemblesDN($attribute)) { |
305 | 305 | $values[] = $this->helper->sanitizeDN($result[$attribute][$i]); |
306 | 306 | } elseif ($lowercaseAttribute === 'objectguid' || $lowercaseAttribute === 'guid') { |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * @throws \Exception |
354 | 354 | */ |
355 | 355 | public function setPassword($userDN, $password) { |
356 | - if ((int)$this->connection->turnOnPasswordChange !== 1) { |
|
356 | + if ((int) $this->connection->turnOnPasswordChange !== 1) { |
|
357 | 357 | throw new \Exception('LDAP password changes are disabled.'); |
358 | 358 | } |
359 | 359 | $cr = $this->connection->getConnectionResource(); |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | } |
582 | 582 | |
583 | 583 | if ($isUser) { |
584 | - $usernameAttribute = (string)$this->connection->ldapExpertUsernameAttr; |
|
584 | + $usernameAttribute = (string) $this->connection->ldapExpertUsernameAttr; |
|
585 | 585 | if ($usernameAttribute !== '') { |
586 | 586 | $username = $this->readAttribute($fdn, $usernameAttribute); |
587 | 587 | $username = $username[0]; |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | } |
786 | 786 | |
787 | 787 | public function cacheGroupDisplayName(string $ncName, string $displayName): void { |
788 | - $cacheKey = 'group_getDisplayName' . $ncName; |
|
788 | + $cacheKey = 'group_getDisplayName'.$ncName; |
|
789 | 789 | $this->connection->writeToCache($cacheKey, $displayName); |
790 | 790 | } |
791 | 791 | |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | //while loop is just a precaution. If a name is not generated within |
803 | 803 | //20 attempts, something else is very wrong. Avoids infinite loop. |
804 | 804 | while ($attempts < 20) { |
805 | - $altName = $name . '_' . rand(1000,9999); |
|
805 | + $altName = $name.'_'.rand(1000, 9999); |
|
806 | 806 | if (!$this->ncUserManager->userExists($altName)) { |
807 | 807 | return $altName; |
808 | 808 | } |
@@ -830,9 +830,9 @@ discard block |
||
830 | 830 | } else { |
831 | 831 | natsort($usedNames); |
832 | 832 | $lastName = array_pop($usedNames); |
833 | - $lastNo = (int)substr($lastName, strrpos($lastName, '_') + 1); |
|
833 | + $lastNo = (int) substr($lastName, strrpos($lastName, '_') + 1); |
|
834 | 834 | } |
835 | - $altName = $name.'_'. (string)($lastNo+1); |
|
835 | + $altName = $name.'_'.(string) ($lastNo + 1); |
|
836 | 836 | unset($usedNames); |
837 | 837 | |
838 | 838 | $attempts = 1; |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | if (!\OC::$server->getGroupManager()->groupExists($altName)) { |
844 | 844 | return $altName; |
845 | 845 | } |
846 | - $altName = $name . '_' . ($lastNo + $attempts); |
|
846 | + $altName = $name.'_'.($lastNo + $attempts); |
|
847 | 847 | $attempts++; |
848 | 848 | } |
849 | 849 | return false; |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | if (!$forceApplyAttributes) { |
911 | 911 | $isBackgroundJobModeAjax = $this->config |
912 | 912 | ->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'ajax'; |
913 | - $recordsToUpdate = array_filter($ldapRecords, function ($record) use ($isBackgroundJobModeAjax) { |
|
913 | + $recordsToUpdate = array_filter($ldapRecords, function($record) use ($isBackgroundJobModeAjax) { |
|
914 | 914 | $newlyMapped = false; |
915 | 915 | $uid = $this->dn2ocname($record['dn'][0], null, true, $newlyMapped, $record); |
916 | 916 | if (is_string($uid)) { |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | // displayName is obligatory |
939 | 939 | continue; |
940 | 940 | } |
941 | - $ocName = $this->dn2ocname($userRecord['dn'][0], null, true); |
|
941 | + $ocName = $this->dn2ocname($userRecord['dn'][0], null, true); |
|
942 | 942 | if ($ocName === false) { |
943 | 943 | continue; |
944 | 944 | } |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | */ |
965 | 965 | public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) { |
966 | 966 | $groupRecords = $this->searchGroups($filter, $attr, $limit, $offset); |
967 | - array_walk($groupRecords, function ($record) { |
|
967 | + array_walk($groupRecords, function($record) { |
|
968 | 968 | $newlyMapped = false; |
969 | 969 | $gid = $this->dn2ocname($record['dn'][0], null, false, $newlyMapped, $record); |
970 | 970 | if (!$newlyMapped && is_string($gid)) { |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | if ($manyAttributes) { |
985 | 985 | return $list; |
986 | 986 | } else { |
987 | - $list = array_reduce($list, function ($carry, $item) { |
|
987 | + $list = array_reduce($list, function($carry, $item) { |
|
988 | 988 | $attribute = array_keys($item)[0]; |
989 | 989 | $carry[] = $item[$attribute][0]; |
990 | 990 | return $carry; |
@@ -1029,7 +1029,7 @@ discard block |
||
1029 | 1029 | $result = false; |
1030 | 1030 | foreach ($this->connection->ldapBaseUsers as $base) { |
1031 | 1031 | $count = $this->count($filter, [$base], $attr, $limit, $offset); |
1032 | - $result = is_int($count) ? (int)$result + $count : $result; |
|
1032 | + $result = is_int($count) ? (int) $result + $count : $result; |
|
1033 | 1033 | } |
1034 | 1034 | return $result; |
1035 | 1035 | } |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | $result = false; |
1069 | 1069 | foreach ($this->connection->ldapBaseGroups as $base) { |
1070 | 1070 | $count = $this->count($filter, [$base], $attr, $limit, $offset); |
1071 | - $result = is_int($count) ? (int)$result + $count : $result; |
|
1071 | + $result = is_int($count) ? (int) $result + $count : $result; |
|
1072 | 1072 | } |
1073 | 1073 | return $result; |
1074 | 1074 | } |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | $result = false; |
1086 | 1086 | foreach ($this->connection->ldapBase as $base) { |
1087 | 1087 | $count = $this->count('objectclass=*', [$base], ['dn'], $limit, $offset); |
1088 | - $result = is_int($count) ? (int)$result + $count : $result; |
|
1088 | + $result = is_int($count) ? (int) $result + $count : $result; |
|
1089 | 1089 | } |
1090 | 1090 | return $result; |
1091 | 1091 | } |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | // php no longer supports call-time pass-by-reference |
1111 | 1111 | // thus cannot support controlPagedResultResponse as the third argument |
1112 | 1112 | // is a reference |
1113 | - $doMethod = function () use ($command, &$arguments) { |
|
1113 | + $doMethod = function() use ($command, &$arguments) { |
|
1114 | 1114 | if ($command == 'controlPagedResultResponse') { |
1115 | 1115 | throw new \InvalidArgumentException('Invoker does not support controlPagedResultResponse, call LDAP Wrapper directly instead.'); |
1116 | 1116 | } else { |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | //check whether paged search should be attempted |
1172 | - $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, (int)$limit, (int)$offset); |
|
1172 | + $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, (int) $limit, (int) $offset); |
|
1173 | 1173 | |
1174 | 1174 | $sr = $this->invokeLDAPMethod('search', $cr, $base, $filter, $attr); |
1175 | 1175 | // cannot use $cr anymore, might have changed in the previous call! |
@@ -1219,10 +1219,10 @@ discard block |
||
1219 | 1219 | $this->pagedSearchedSuccessful = true; |
1220 | 1220 | } |
1221 | 1221 | } else { |
1222 | - if (!is_null($limit) && (int)$this->connection->ldapPagingSize !== 0) { |
|
1222 | + if (!is_null($limit) && (int) $this->connection->ldapPagingSize !== 0) { |
|
1223 | 1223 | \OC::$server->getLogger()->debug( |
1224 | 1224 | 'Paged search was not available', |
1225 | - [ 'app' => 'user_ldap' ] |
|
1225 | + ['app' => 'user_ldap'] |
|
1226 | 1226 | ); |
1227 | 1227 | } |
1228 | 1228 | } |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | $attr = [mb_strtolower($attr, 'UTF-8')]; |
1266 | 1266 | } |
1267 | 1267 | |
1268 | - $limitPerPage = (int)$this->connection->ldapPagingSize; |
|
1268 | + $limitPerPage = (int) $this->connection->ldapPagingSize; |
|
1269 | 1269 | if (!is_null($limit) && $limit < $limitPerPage && $limit > 0) { |
1270 | 1270 | $limitPerPage = $limit; |
1271 | 1271 | } |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | * @throws ServerNotAvailableException |
1308 | 1308 | */ |
1309 | 1309 | private function countEntriesInSearchResults($sr): int { |
1310 | - return (int)$this->invokeLDAPMethod('countEntries', $this->connection->getConnectionResource(), $sr); |
|
1310 | + return (int) $this->invokeLDAPMethod('countEntries', $this->connection->getConnectionResource(), $sr); |
|
1311 | 1311 | } |
1312 | 1312 | |
1313 | 1313 | /** |
@@ -1323,7 +1323,7 @@ discard block |
||
1323 | 1323 | ?int $offset = null, |
1324 | 1324 | bool $skipHandling = false |
1325 | 1325 | ): array { |
1326 | - $limitPerPage = (int)$this->connection->ldapPagingSize; |
|
1326 | + $limitPerPage = (int) $this->connection->ldapPagingSize; |
|
1327 | 1327 | if (!is_null($limit) && $limit < $limitPerPage && $limit > 0) { |
1328 | 1328 | $limitPerPage = $limit; |
1329 | 1329 | } |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | && !is_null($limit) |
1416 | 1416 | ) |
1417 | 1417 | ) { |
1418 | - $findings = array_slice($findings, (int)$offset, $limit); |
|
1418 | + $findings = array_slice($findings, (int) $offset, $limit); |
|
1419 | 1419 | } |
1420 | 1420 | return $findings; |
1421 | 1421 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | } |
1467 | 1467 | $search = ['*', '\\', '(', ')']; |
1468 | 1468 | $replace = ['\\*', '\\\\', '\\(', '\\)']; |
1469 | - return $asterisk . str_replace($search, $replace, $input); |
|
1469 | + return $asterisk.str_replace($search, $replace, $input); |
|
1470 | 1470 | } |
1471 | 1471 | |
1472 | 1472 | /** |
@@ -1500,9 +1500,9 @@ discard block |
||
1500 | 1500 | if ($filter !== '' && $filter[0] !== '(') { |
1501 | 1501 | $filter = '('.$filter.')'; |
1502 | 1502 | } |
1503 | - $combinedFilter.=$filter; |
|
1503 | + $combinedFilter .= $filter; |
|
1504 | 1504 | } |
1505 | - $combinedFilter.=')'; |
|
1505 | + $combinedFilter .= ')'; |
|
1506 | 1506 | return $combinedFilter; |
1507 | 1507 | } |
1508 | 1508 | |
@@ -1548,7 +1548,7 @@ discard block |
||
1548 | 1548 | //every word needs to appear at least once |
1549 | 1549 | $wordMatchOneAttrFilters = []; |
1550 | 1550 | foreach ($searchAttributes as $attr) { |
1551 | - $wordMatchOneAttrFilters[] = $attr . '=' . $word; |
|
1551 | + $wordMatchOneAttrFilters[] = $attr.'='.$word; |
|
1552 | 1552 | } |
1553 | 1553 | $wordFilters[] = $this->combineFilterWithOr($wordMatchOneAttrFilters); |
1554 | 1554 | } |
@@ -1583,10 +1583,10 @@ discard block |
||
1583 | 1583 | if ($fallbackAttribute === '') { |
1584 | 1584 | return ''; |
1585 | 1585 | } |
1586 | - $filter[] = $fallbackAttribute . '=' . $search; |
|
1586 | + $filter[] = $fallbackAttribute.'='.$search; |
|
1587 | 1587 | } else { |
1588 | 1588 | foreach ($searchAttributes as $attribute) { |
1589 | - $filter[] = $attribute . '=' . $search; |
|
1589 | + $filter[] = $attribute.'='.$search; |
|
1590 | 1590 | } |
1591 | 1591 | } |
1592 | 1592 | if (count($filter) === 1) { |
@@ -1610,7 +1610,7 @@ discard block |
||
1610 | 1610 | if ($term === '') { |
1611 | 1611 | $result = '*'; |
1612 | 1612 | } elseif ($allowEnum !== 'no') { |
1613 | - $result = $term . '*'; |
|
1613 | + $result = $term.'*'; |
|
1614 | 1614 | } |
1615 | 1615 | return $result; |
1616 | 1616 | } |
@@ -1622,7 +1622,7 @@ discard block |
||
1622 | 1622 | public function getFilterForUserCount() { |
1623 | 1623 | $filter = $this->combineFilterWithAnd([ |
1624 | 1624 | $this->connection->ldapUserFilter, |
1625 | - $this->connection->ldapUserDisplayName . '=*' |
|
1625 | + $this->connection->ldapUserDisplayName.'=*' |
|
1626 | 1626 | ]); |
1627 | 1627 | |
1628 | 1628 | return $filter; |
@@ -1688,7 +1688,7 @@ discard block |
||
1688 | 1688 | $uuid = $this->formatGuid2ForFilterUser($uuid); |
1689 | 1689 | } |
1690 | 1690 | |
1691 | - $filter = $uuidAttr . '=' . $uuid; |
|
1691 | + $filter = $uuidAttr.'='.$uuid; |
|
1692 | 1692 | $result = $this->searchUsers($filter, ['dn'], 2); |
1693 | 1693 | if (is_array($result) && isset($result[0]) && isset($result[0]['dn']) && count($result) === 1) { |
1694 | 1694 | // we put the count into account to make sure that this is |
@@ -1817,8 +1817,8 @@ discard block |
||
1817 | 1817 | for ($k = 1; $k <= 2; ++$k) { |
1818 | 1818 | $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2); |
1819 | 1819 | } |
1820 | - $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4); |
|
1821 | - $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20); |
|
1820 | + $hex_guid_to_guid_str .= '-'.substr($hex_guid, 16, 4); |
|
1821 | + $hex_guid_to_guid_str .= '-'.substr($hex_guid, 20); |
|
1822 | 1822 | |
1823 | 1823 | return strtoupper($hex_guid_to_guid_str); |
1824 | 1824 | } |
@@ -1852,20 +1852,20 @@ discard block |
||
1852 | 1852 | * user. Instead we write a log message. |
1853 | 1853 | */ |
1854 | 1854 | \OC::$server->getLogger()->info( |
1855 | - 'Passed string does not resemble a valid GUID. Known UUID ' . |
|
1855 | + 'Passed string does not resemble a valid GUID. Known UUID '. |
|
1856 | 1856 | '({uuid}) probably does not match UUID configuration.', |
1857 | - [ 'app' => 'user_ldap', 'uuid' => $guid ] |
|
1857 | + ['app' => 'user_ldap', 'uuid' => $guid] |
|
1858 | 1858 | ); |
1859 | 1859 | return $guid; |
1860 | 1860 | } |
1861 | - for ($i=0; $i < 3; $i++) { |
|
1861 | + for ($i = 0; $i < 3; $i++) { |
|
1862 | 1862 | $pairs = str_split($blocks[$i], 2); |
1863 | 1863 | $pairs = array_reverse($pairs); |
1864 | 1864 | $blocks[$i] = implode('', $pairs); |
1865 | 1865 | } |
1866 | - for ($i=0; $i < 5; $i++) { |
|
1866 | + for ($i = 0; $i < 5; $i++) { |
|
1867 | 1867 | $pairs = str_split($blocks[$i], 2); |
1868 | - $blocks[$i] = '\\' . implode('\\', $pairs); |
|
1868 | + $blocks[$i] = '\\'.implode('\\', $pairs); |
|
1869 | 1869 | } |
1870 | 1870 | return implode('', $blocks); |
1871 | 1871 | } |
@@ -1946,7 +1946,7 @@ discard block |
||
1946 | 1946 | |
1947 | 1947 | foreach ($bases as $base) { |
1948 | 1948 | $belongsToBase = true; |
1949 | - if (mb_strripos($dn, $base, 0, 'UTF-8') !== (mb_strlen($dn, 'UTF-8')-mb_strlen($base, 'UTF-8'))) { |
|
1949 | + if (mb_strripos($dn, $base, 0, 'UTF-8') !== (mb_strlen($dn, 'UTF-8') - mb_strlen($base, 'UTF-8'))) { |
|
1950 | 1950 | $belongsToBase = false; |
1951 | 1951 | } |
1952 | 1952 | if ($belongsToBase) { |
@@ -2048,7 +2048,7 @@ discard block |
||
2048 | 2048 | 'controlPagedResult', $this->connection->getConnectionResource(), $limit, false |
2049 | 2049 | ); |
2050 | 2050 | if ($pagedSearchOK) { |
2051 | - \OC::$server->getLogger()->debug('Ready for a paged search',['app' => 'user_ldap']); |
|
2051 | + \OC::$server->getLogger()->debug('Ready for a paged search', ['app' => 'user_ldap']); |
|
2052 | 2052 | } |
2053 | 2053 | /* ++ Fixing RHDS searches with pages with zero results ++ |
2054 | 2054 | * We coudn't get paged searches working with our RHDS for login ($limit = 0), |
@@ -2063,7 +2063,7 @@ discard block |
||
2063 | 2063 | $this->abandonPagedSearch(); |
2064 | 2064 | // in case someone set it to 0 … use 500, otherwise no results will |
2065 | 2065 | // be returned. |
2066 | - $pageSize = (int)$this->connection->ldapPagingSize > 0 ? (int)$this->connection->ldapPagingSize : 500; |
|
2066 | + $pageSize = (int) $this->connection->ldapPagingSize > 0 ? (int) $this->connection->ldapPagingSize : 500; |
|
2067 | 2067 | $pagedSearchOK = $this->invokeLDAPMethod('controlPagedResult', |
2068 | 2068 | $this->connection->getConnectionResource(), |
2069 | 2069 | $pageSize, false); |