| @@ 115-134 (lines=20) @@ | ||
| 112 | * @param \Closure $callback |
|
| 113 | * @param string $search |
|
| 114 | */ |
|
| 115 | protected function callForAllUsers(\Closure $callback, $search = '') { |
|
| 116 | foreach ($this->userManager->getBackends() as $backend) { |
|
| 117 | $limit = 500; |
|
| 118 | $offset = 0; |
|
| 119 | do { |
|
| 120 | $users = $backend->getUsers($search, $limit, $offset); |
|
| 121 | foreach ($users as $user) { |
|
| 122 | $user = $this->userManager->get($user); |
|
| 123 | if (is_null($user)) { |
|
| 124 | continue; |
|
| 125 | } |
|
| 126 | $return = $callback($user); |
|
| 127 | if ($return === false) { |
|
| 128 | break; |
|
| 129 | } |
|
| 130 | } |
|
| 131 | $offset += $limit; |
|
| 132 | } while (count($users) >= $limit); |
|
| 133 | } |
|
| 134 | } |
|
| 135 | } |
|
| 136 | ||
| @@ 102-121 (lines=20) @@ | ||
| 99 | * @param \Closure $callback |
|
| 100 | * @param string $search |
|
| 101 | */ |
|
| 102 | protected function callForAllUsers(\Closure $callback, $search = '') { |
|
| 103 | foreach ($this->userManager->getBackends() as $backend) { |
|
| 104 | $limit = 500; |
|
| 105 | $offset = 0; |
|
| 106 | do { |
|
| 107 | $users = $backend->getUsers($search, $limit, $offset); |
|
| 108 | foreach ($users as $user) { |
|
| 109 | $user = $this->userManager->get($user); |
|
| 110 | if (is_null($user)) { |
|
| 111 | continue; |
|
| 112 | } |
|
| 113 | $return = $callback($user); |
|
| 114 | if ($return === false) { |
|
| 115 | break; |
|
| 116 | } |
|
| 117 | } |
|
| 118 | $offset += $limit; |
|
| 119 | } while (count($users) >= $limit); |
|
| 120 | } |
|
| 121 | } |
|
| 122 | } |
|
| 123 | ||
| @@ 128-147 (lines=20) @@ | ||
| 125 | return true; |
|
| 126 | } |
|
| 127 | ||
| 128 | private function callForAllUsers(\Closure $callback, $search = '') { |
|
| 129 | foreach($this->userManager->getBackends() as $backend) { |
|
| 130 | $limit = 500; |
|
| 131 | $offset = 0; |
|
| 132 | do { |
|
| 133 | $users = $backend->getUsers($search, $limit, $offset); |
|
| 134 | foreach ($users as $uid) { |
|
| 135 | if (!$backend->userExists($uid)) { |
|
| 136 | continue; |
|
| 137 | } |
|
| 138 | $user = $this->userManager->get($uid); |
|
| 139 | $return = $callback($user); |
|
| 140 | if ($return === false) { |
|
| 141 | break; |
|
| 142 | } |
|
| 143 | } |
|
| 144 | $offset += $limit; |
|
| 145 | } while (count($users) >= $limit); |
|
| 146 | } |
|
| 147 | } |
|
| 148 | ||
| 149 | } |
|
| 150 | ||
| @@ 126-145 (lines=20) @@ | ||
| 123 | return true; |
|
| 124 | } |
|
| 125 | ||
| 126 | private function callForAllUsers(\Closure $callback, $search = '') { |
|
| 127 | foreach($this->userManager->getBackends() as $backend) { |
|
| 128 | $limit = 500; |
|
| 129 | $offset = 0; |
|
| 130 | do { |
|
| 131 | $users = $backend->getUsers($search, $limit, $offset); |
|
| 132 | foreach ($users as $uid) { |
|
| 133 | if (!$backend->userExists($uid)) { |
|
| 134 | continue; |
|
| 135 | } |
|
| 136 | $user = $this->userManager->get($uid); |
|
| 137 | $return = $callback($user); |
|
| 138 | if ($return === false) { |
|
| 139 | break; |
|
| 140 | } |
|
| 141 | } |
|
| 142 | $offset += $limit; |
|
| 143 | } while (count($users) >= $limit); |
|
| 144 | } |
|
| 145 | } |
|
| 146 | } |
|
| 147 | ||