Lines Matching defs:user
12 * This version of the user manager has been modified to only work with
29 protected $filter = []; // user selection filter(s)
30 protected $start = 0; // index of first user to be displayed
31 protected $last = 0; // index of the last user to be displayed
33 protected $edit_user = ''; // set to user selected for editing
37 protected $lastdisabled = false; // set to true if last user is unknown and last button is hence buggy
114 * Handle user request
251 echo '<td><input type="text" name="userid" class="edit" value="' . $this->htmlFilter('user') . '" /></td>';
260 foreach ($user_list as $user => $userinfo) {
270 echo '<td class="centeralign"><input type="checkbox" name="delete[' . hsc($user) .
273 echo '<td><a href="' . wl($ID, ['fn[edit][' . $user . ']' => 1,
277 '" title="' . $this->lang['edit_prompt'] . '">' . hsc($user) . '</a></td>';
279 echo '<td>' . hsc($user) . '</td>';
370 * Display form to add or modify a user
373 * @param string $user id of user
378 protected function htmlUserForm($cmd, $user = '', $userdata = [], $indent = 0)
388 if ($user) {
408 $user,
463 if ($user) {
480 // save current $user, we need this to access details if the name is changed
481 if ($user) {
482 echo '<input type="hidden" name="userid_old" value="' . hsc($user) . "\" />";
622 echo '<td class="field userid"> ' . hsc($failure['user'][0]) . ' </td>';
623 echo '<td class="field username"> ' . hsc($failure['user'][2]) . ' </td>';
624 echo '<td class="field usermail"> ' . hsc($failure['user'][3]) . ' </td>';
625 echo '<td class="field usergroups"> ' . hsc($failure['user'][4]) . ' </td>';
636 * Add an user to auth backend
646 [$user, $pass, $name, $mail, $grps, $passconfirm] = $this->retrieveUser();
647 if (empty($user)) return false;
652 $pass = auth_pwgen($user);
693 if ($ok = $this->auth->triggerUserMod('create', [$user, $pass, $name, $mail, $grps])) {
697 $this->notifyUser($user, $pass);
708 * Delete user from auth backend
745 * Edit user (a user has been selected for editing)
747 * @param string $param id of the user
754 $user = $this->auth->cleanUser(preg_replace('/.*[:\/]/', '', $param));
755 $userdata = $this->auth->getUserData($user);
757 // no user found?
763 $this->edit_user = $user;
770 * Modify user in the auth backend (modified user data has been recieved)
781 // get currently valid user data
785 // get new user data subject to change
801 $changes['user'] = $newuser;
831 $notify = empty($changes['user']) ? $olduser : $newuser;
851 * @param string $user id of user
856 protected function notifyUser($user, $password, $status_alert = true)
859 if ($sent = auth_sendPassword($user, $password)) {
898 * Retrieve & clean user data from the form
901 * @return array (user, password, full name, email, array(groups))
909 $user = [];
910 $user[0] = ($clean) ? $auth->cleanUser($INPUT->str('userid')) : $INPUT->str('userid');
911 $user[1] = $INPUT->str('userpass');
912 $user[2] = $INPUT->str('username');
913 $user[3] = $INPUT->str('usermail');
914 $user[4] = explode(',', $INPUT->str('usergroups'));
915 $user[5] = $INPUT->str('userpass2'); // repeated password for confirmation
917 $user[4] = array_map('trim', $user[4]);
919 $user[4] = array_map([$auth, 'cleanGroup'], $user[4]);
921 $user[4] = array_filter($user[4]);
922 $user[4] = array_unique($user[4]);
923 if ($user[4] === []) {
924 $user[4] = null;
927 return $user;
941 [$user, /* pass */, $name, $mail, $grps] = $this->retrieveUser(false);
943 if (!empty($user)) $this->filter['user'] = $user;
964 if (isset($t_filter['user'])) $filter['user'] = $t_filter['user'];
1039 foreach ($user_list as $user => $info) {
1040 $line = [$user, $info['name'], $info['mail'], implode(',', $info['grps'])];
1092 $this->import_failures[$line] = ['error' => $error, 'user' => $raw, 'orig' => $csv];
1106 $this->import_failures[$line] = ['error' => $error, 'user' => $raw, 'orig' => $csv];
1134 * Returns cleaned user data
1152 [$user, /* pass */, $name, $mail, /* grps */] = $cleaned;
1153 if (empty($user)) {
1179 * Adds imported user to auth backend
1183 * @param array $user data of user
1187 protected function importUser($user, &$error)
1189 if (!$this->auth->triggerUserMod('create', $user)) {