Lines Matching defs:user

21     protected $bound = 0; // 0: anonymous, 1: user, 2: superuser
48 * Check user+password
50 * Checks if the given user exists and the given
54 * @param string $user
59 public function checkPass($user, $pass)
65 // indirect user bind
81 ['user' => $user, 'server' => $this->getConf('server')]
83 } elseif (strpos($this->getConf('usertree'), '%{user}')) {
84 // direct user bind
87 ['user' => $user, 'server' => $this->getConf('server')]
101 $this->debug('LDAP user dn bind: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
107 // See if we can find the user
108 $info = $this->fetchUserData($user, true);
118 $this->debug('LDAP user bind: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
127 * Return user info
129 * Returns info about the given user needs to contain
132 * name string full name of the user
133 * mail string email addres of the user
134 * grps array list of groups the user is in
143 * @param string $user
145 * @return array containing user data or false
154 public function getUserData($user, $requireGroups = true)
156 return $this->fetchUserData($user);
160 * @param string $user
162 * @return array containing user data or false
164 protected function fetchUserData($user, $inbind = false)
180 // be accessible anonymously, so we try to rebind the current user here
189 $info['user'] = $user;
190 $this->debug('LDAP user to find: ' . hsc($info['user']), 0, __LINE__, __FILE__);
195 //get info for given user
207 $this->debug('LDAP user search: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
241 // general user info
272 //get groups for given user if grouptree is given
319 * @param string $user nick of the user to be changed
323 public function modifyUser($user, $changes)
332 // find the information about the user, in particular the "dn"
333 $info = $this->getUserData($user, true);
335 $this->debug('LDAP cannot find your user dn', 0, __LINE__, __FILE__);
340 // find the old password of the user
342 if ($loginuser !== null) { // the user is currently logged in
349 'LDAP user bind failed: ' . hsc($dn) . ': ' . hsc(ldap_error($this->con)),
357 // we are changing the password on behalf of the user (eg: forgotten password)
396 * Bulk retrieval of user data
398 * @param int $start index of first user to be returned
411 $all_filter = str_replace('%{user}', '*', $this->getConf('userfilter'));
432 foreach ($this->users as $user => &$info) {
437 $info = $this->getUserData($user);
439 if ($this->filter($user, $info)) {
440 $result[$user] = $info;
476 * return true if $user + $info match $filter criteria, false otherwise
478 * @param string $user the user's login name
479 * @param array $info the user's userinfo array
484 protected function filter($user, $info)
487 if ($item == 'user') {
488 if (!preg_match($pattern, $user)) return false;