Lines Matching defs:users

18     protected $users;
39 if (!@is_readable($config_cascade['plainauth.users']['default'])) {
42 if (@is_writable($config_cascade['plainauth.users']['default'])) {
73 return auth_verifyPassword($pass, $this->users[$user]['pass']);
93 if ($this->users === null) $this->loadUserData();
94 return $this->users[$user] ?? false;
158 if (!io_saveFile($config_cascade['plainauth.users']['default'], $userline, true)) {
163 $this->users[$user] = [
191 // don't modify protected users
218 if (!io_replaceInFile($config_cascade['plainauth.users']['default'], '/^' . $user . ':/', $userline, true)) {
225 if (isset($this->users[$user])) unset($this->users[$user]);
226 $this->users[$newuser] = $userinfo;
231 * Remove one or more users from the list of registered users
234 * @param array $users array of users to be deleted
235 * @return int the number of users deleted
237 public function deleteUsers($users)
241 if (!is_array($users) || $users === []) return 0;
243 if ($this->users === null) $this->loadUserData();
246 foreach ($users as $user) {
247 // don't delete protected users
248 if (!empty($this->users[$user]['protected'])) {
252 if (isset($this->users[$user])) $deleted[] = preg_quote($user, '/');
258 if (!io_deleteFromFile($config_cascade['plainauth.users']['default'], $pattern, true)) {
264 $count = count($this->users);
266 $count -= count($this->users);
281 if ($this->users === null) $this->loadUserData();
283 if ($filter === []) return count($this->users);
288 foreach ($this->users as $user => $info) {
301 * @param int $limit max number of users to be returned
308 if ($this->users === null) $this->loadUserData();
310 Sort::ksort($this->users);
317 foreach ($this->users as $user => $info) {
343 if ($this->users === null) $this->loadUserData();
344 foreach ($this->users as $info) {
392 $this->users = $this->readUserFile($config_cascade['plainauth.users']['default']);
394 // support protected users
395 if (!empty($config_cascade['plainauth.users']['protected'])) {
396 $protected = $this->readUserFile($config_cascade['plainauth.users']['protected']);
400 $this->users = array_merge($this->users, $protected);
414 $users = [];
415 if (!file_exists($file)) return $users;
430 $users[$row[0]]['pass'] = $row[1];
431 $users[$row[0]]['name'] = urldecode($row[2]);
432 $users[$row[0]]['mail'] = $row[3];
433 $users[$row[0]]['grps'] = $groups;
435 return $users;