| @@ 154-165 (lines=12) @@ | ||
| 151 | * @param array $attributes |
|
| 152 | * @return array |
|
| 153 | */ |
|
| 154 | public function getUserByEmail($email, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = []) |
|
| 155 | { |
|
| 156 | $result = []; |
|
| 157 | foreach (self::$data['users'] as $guid => $info) { |
|
| 158 | if ($info['mail'] == $email) { |
|
| 159 | $result[] = $info; |
|
| 160 | break; |
|
| 161 | } |
|
| 162 | } |
|
| 163 | ||
| 164 | return $result; |
|
| 165 | } |
|
| 166 | ||
| 167 | /** |
|
| 168 | * Mock to search trough dummy $data. |
|
| @@ 177-188 (lines=12) @@ | ||
| 174 | * @return array |
|
| 175 | * @internal param string $email |
|
| 176 | */ |
|
| 177 | public function getUserByUsername($username, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = []) |
|
| 178 | { |
|
| 179 | $result = []; |
|
| 180 | foreach (self::$data['users'] as $guid => $info) { |
|
| 181 | if ($info['userprincipalname'] == $username) { |
|
| 182 | $result[] = $info; |
|
| 183 | break; |
|
| 184 | } |
|
| 185 | } |
|
| 186 | ||
| 187 | return $result; |
|
| 188 | } |
|
| 189 | } |
|
| 190 | ||