Lines Matching full:user

17     /** @var array user cache */
58 * Check user+password
60 * Checks if the given user exists and the given
64 * @param string $user
68 public function checkPass($user, $pass) argument
70 $userinfo = $this->getUserData($user);
76 return auth_verifyPassword($pass, $this->users[$user]['pass']);
80 * Return user info
82 * Returns info about the given user needs to contain
85 * name string full name of the user
86 * mail string email addres of the user
87 * grps array list of groups the user is in
90 * @param string $user
94 public function getUserData($user, $requireGroups = true) argument
96 if (!is_string($user)) return false;
98 return $this->users[$user] ?? false;
106 * @param string $user
110 * @param array $grps list of groups the user is in
113 protected function createUserLine($user, $pass, $name, $mail, $grps) argument
116 $userline = [$user, $pass, $name, $mail, $groups];
125 * Create a new User
127 * Returns false if the user already exists, null when an error
130 * The new user will be added to the default group by this
136 * @param string $user
143 public function createUser($user, $pwd, $name, $mail, $grps = null) argument
148 // user mustn't already exist
149 if ($this->getUserData($user) !== false) {
159 // prepare user line
160 $userline = $this->createUserLine($user, $pass, $name, $mail, $grps);
167 $this->users[$user] = [
177 * Modify user data
180 * @param string $user nick of the user to be changed
184 public function modifyUser($user, $changes) argument
189 // sanity checks, user must already exist and there must be something to change
190 if (($userinfo = $this->getUserData($user)) === false) {
197 msg(sprintf($this->getLang('protected'), hsc($user)), -1);
204 $newuser = $user;
206 if ($field == 'user') {
222 …if (!io_replaceInFile($config_cascade['plainauth.users']['default'], '/^' . $user . ':/', $userlin…
223 msg('There was an error modifying your user data. You may need to register again.', -1);
229 if (isset($this->users[$user])) unset($this->users[$user]);
250 foreach ($users as $user) {
252 if (!empty($this->users[$user]['protected'])) {
253 msg(sprintf($this->getLang('protected'), hsc($user)), -1);
256 if (isset($this->users[$user])) $deleted[] = preg_quote($user, '/');
267 // reload the user list and count the difference
275 * Return a count of the number of user which meet $filter criteria
292 foreach ($this->users as $user => $info) {
293 $count += $this->filter($user, $info);
300 * Bulk retrieval of user data
304 * @param int $start index of first user to be returned
321 foreach ($this->users as $user => $info) {
322 if ($this->filter($user, $info)) {
324 $out[$user] = $info;
337 * Loads complete user data into memory before searching for groups.
362 * @param string $user
365 public function cleanUser($user) argument
369 return cleanID(str_replace([':', '/', ';'], $conf['sepchar'], $user));
386 * Load all user data
388 * loads the user file into a datastructure
409 * Read user data from given file
443 * Get the user line split into it's parts
453 … Logger::error('User line with less than 5 fields. Possibly corruption in your user file', $data);
459 * return true if $user + $info match $filter criteria, false otherwise
463 * @param string $user User login
464 * @param array $info User's userinfo array
467 protected function filter($user, $info) argument
470 if ($item == 'user') {
471 if (!preg_match($pattern, $user)) return false;