| | <?php |
| |
|
| | namespace Kanboard\Core\User; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | class UserManager |
| | { |
| | |
| | |
| | |
| | |
| | |
| | |
| | protected $providers = array(); |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function register(UserBackendProviderInterface $provider) |
| | { |
| | $this->providers[] = $provider; |
| | return $this; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function find($input) |
| | { |
| | $groups = array(); |
| |
|
| | foreach ($this->providers as $provider) { |
| | $groups = array_merge($groups, $provider->find($input)); |
| | } |
| |
|
| | return $this->removeDuplicates($groups); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | protected function removeDuplicates(array $users) |
| | { |
| | $result = array(); |
| |
|
| | foreach ($users as $user) { |
| | if (! isset($result[$user->getUsername()])) { |
| | $result[$user->getUsername()] = $user; |
| | } |
| | } |
| |
|
| | return array_values($result); |
| | } |
| | } |
| |
|