Lines Matching refs:user

35      * Get the LDAP entry for the given user
47 Filters::equal('objectClass', 'user'),
80 // this has to be executed as the user themselves, not as the admin
91 // run as admin user
156 $filter = Filters::and(Filters::equal('objectClass', 'user'));
157 if (isset($match['user'])) {
158 $filter->add(Filters::$filtermethod('sAMAccountName', $this->simpleUser($match['user'])));
208 $users[$userinfo['user']] = $userinfo;
217 public function cleanUser($user)
219 return $this->simpleUser($user);
229 protected function prepareBindUser($user)
232 return $this->qualifiedUser($user);
250 * userPrincipalName in the form <user>@<suffix>
252 * @param string $user
255 protected function qualifiedUser($user)
257 $user = $this->simpleUser($user); // strip any existing qualifiers
262 return $user . '@' . $this->config['suffix'];
266 * Removes the account suffix from the given user. Should match the SAMAccountName
268 * @param string $user
271 protected function simpleUser($user)
273 $user = PhpString::strtolower($user);
274 $user = preg_replace('/@.*$/', '', $user);
275 $user = preg_replace('/^.*\\\\/', '', $user);
276 return $user;
280 * Transform an LDAP entry to a user info array
288 $user = $this->simpleUser($this->attr2str($entry->get('userPrincipalName')));
289 if($user === '') $user = $this->simpleUser($this->attr2str($entry->get('sAMAccountName')));
291 $user = [
292 'user' => $user,
305 $user['lastpwd'] = (int)$lastChange;
306 $user['expires'] = !($this->attr2str($entry->get('useraccountcontrol')) & self::ADS_UF_DONT_EXPIRE_PASSWD);
310 $user[$attr] = $this->attr2str($entry->get($attr));
313 return $user;
317 * Get the list of groups the given user is member of