| @@ 135-146 (lines=12) @@ | ||
| 132 | * get a list of all users in a group |
|
| 133 | * @return string[] with user ids |
|
| 134 | */ |
|
| 135 | public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { |
|
| 136 | $users = array(); |
|
| 137 | ||
| 138 | foreach($this->backends as $backend) { |
|
| 139 | $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); |
|
| 140 | if (is_array($backendUsers)) { |
|
| 141 | $users = array_merge($users, $backendUsers); |
|
| 142 | } |
|
| 143 | } |
|
| 144 | ||
| 145 | return $users; |
|
| 146 | } |
|
| 147 | ||
| 148 | /** |
|
| 149 | * @param string $gid |
|
| @@ 220-231 (lines=12) @@ | ||
| 217 | * |
|
| 218 | * Returns a list with all groups |
|
| 219 | */ |
|
| 220 | public function getGroups($search = '', $limit = -1, $offset = 0) { |
|
| 221 | $groups = array(); |
|
| 222 | ||
| 223 | foreach($this->backends as $backend) { |
|
| 224 | $backendGroups = $backend->getGroups($search, $limit, $offset); |
|
| 225 | if (is_array($backendGroups)) { |
|
| 226 | $groups = array_merge($groups, $backendGroups); |
|
| 227 | } |
|
| 228 | } |
|
| 229 | ||
| 230 | return $groups; |
|
| 231 | } |
|
| 232 | ||
| 233 | /** |
|
| 234 | * check if a group exists |
|
| @@ 155-165 (lines=11) @@ | ||
| 152 | * @param null|int $offset |
|
| 153 | * @return string[] an array of all uids |
|
| 154 | */ |
|
| 155 | public function getUsers($search = '', $limit = 10, $offset = 0) { |
|
| 156 | //we do it just as the /OC_User implementation: do not play around with limit and offset but ask all backends |
|
| 157 | $users = array(); |
|
| 158 | foreach($this->backends as $backend) { |
|
| 159 | $backendUsers = $backend->getUsers($search, $limit, $offset); |
|
| 160 | if (is_array($backendUsers)) { |
|
| 161 | $users = array_merge($users, $backendUsers); |
|
| 162 | } |
|
| 163 | } |
|
| 164 | return $users; |
|
| 165 | } |
|
| 166 | ||
| 167 | /** |
|
| 168 | * check if a user exists |
|