Lines Matching full:user
47 $this->getConf('user'),
64 …['select-user', 'select-user-groups', 'select-groups', 'insert-user', 'insert-group', 'join-group']
69 ['select-user', 'select-user-groups', 'select-groups', 'leave-group', 'delete-user']
74 ['select-user', 'select-user-groups', 'update-user-login']
79 ['select-user', 'select-user-groups', 'update-user-pass']
84 ['select-user', 'select-user-groups', 'update-user-info:name']
89 ['select-user', 'select-user-groups', 'update-user-info:mail']
94 …['select-user', 'select-user-groups', 'select-groups', 'leave-group', 'join-group', 'insert-group']
116 * Check user+password
118 * @param string $user the user name
122 public function checkPass($user, $pass) argument
125 $userdata = $this->selectUser($user);
152 * Return user info
154 * Returns info about the given user needs to contain
157 * name string full name of the user
158 * mail string email addres of the user
159 * grps array list of groups the user is in
161 * @param string $user the user name
163 * @return array|bool containing user data or false
165 public function getUserData($user, $requireGroups = true) argument
167 if (!is_string($user)) return false;
168 $data = $this->selectUser($user);
183 * Create a new User [implement only where required/possible]
185 * Returns false if the user already exists, null when an error
188 * The new user HAS TO be added to the default group by this
193 * @param string $user
200 public function createUser($user, $clear, $name, $mail, $grps = null) argument
204 if (($info = $this->getUserData($user, false)) !== false) {
206 return false; // user already exists
214 …$userdata = ['user' => $user, 'clear' => $clear, 'hash' => $hash, 'name' => $name, 'mail' => $mail…
219 // insert the user
220 $ok = $this->query($this->getConf('insert-user'), $userdata);
222 $userdata = $this->getUserData($user, false);
235 // add user to the groups
253 * Modify user data
255 * @param string $user nick of the user to be changed
259 public function modifyUser($user, $changes) argument
264 $olddata = $this->getUserData($user);
268 // changing the user name?
269 if (isset($changes['user'])) {
270 if ($this->getUserData($changes['user'], false)) goto FAIL;
272 $params['newlogin'] = $changes['user'];
274 $ok = $this->query($this->getConf('update-user-login'), $params);
284 $ok = $this->query($this->getConf('update-user-pass'), $params);
294 $ok = $this->query($this->getConf('update-user-info'), $params);
354 foreach ($users as $user) {
355 if ($this->deleteUser($user)) $count++;
361 * Bulk retrieval of user data [implement only where required/possible]
365 * @param int $start index of first user to be returned
376 foreach (['user', 'name', 'mail', 'group'] as $key) {
392 if (!isset($row['user'])) {
393 … $this->debugMsg("list-users statement did not return 'user' attribute", -1, __LINE__);
396 $users[] = $this->getUserData($row['user']);
405 * Return a count of the number of user which meet $filter criteria
415 foreach (['user', 'name', 'mail', 'group'] as $key) {
468 * Select data of a specified user
470 * @param string $user the user name
471 * @return bool|array user data, false on error
473 protected function selectUser($user) argument
475 $sql = $this->getConf('select-user');
477 $result = $this->query($sql, [':user' => $user]);
481 $this->debugMsg('Found more than one matching user', -1, __LINE__);
488 if (!isset($data['user'])) {
489 $this->debugMsg("Statement did not return 'user' attribute", -1, __LINE__);
510 * Delete a user after removing all their group memberships
512 * @param string $user
513 * @return bool true when the user was deleted
515 protected function deleteUser($user) argument
519 $userdata = $this->getUserData($user);
530 $ok = $this->query($this->getConf('delete-user'), $userdata);
542 * Select all groups of a user
550 $sql = $this->getConf('select-user-groups');
558 … $this->debugMsg("No 'group' field returned in select-user-groups statement", -1, __LINE__);
564 … $this->debugMsg("select-user-groups statement did not return a list of result", -1, __LINE__);
614 * Adds the user to the group
616 * @param array $userdata all the user data
630 * Removes the user from the group
632 * @param array $userdata all the user data