Lines Matching +full:check +full:- +full:pass -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)

47         $this->setupLocale();
50 $this->disabled = $this->lang['noauth'];
51 } elseif (!$auth->canDo('getUsers')) {
52 $this->disabled = $this->lang['nosupport'];
55 $this->auth = &$auth;
60 $this->import_failures = $_SESSION['import_failures'];
73 if (!is_null($this->auth))
76 return $this->getLang('menu') . ' ' . $this->disabled;
94 return $this->start;
102 return $this->pagesize;
110 $this->lastdisabled = $lastdisabled;
121 if (is_null($this->auth)) return false;
124 // submit button name is of the form - fn[cmd][param(s)]
125 $fn = $INPUT->param('fn');
136 $this->start = $INPUT->int('start', 0);
137 $this->filter = $this->retrieveFilter();
142 $this->addUser();
145 $this->deleteUser();
148 $this->modifyUser();
151 $this->editUser($param);
154 $this->setFilter($param);
155 $this->start = 0;
158 $this->exportCSV();
161 $this->importCSV();
164 $this->downloadImportFailures();
168 $this->users_total = $this->auth->canDo('getUserCount') ? $this->auth->getUserCount($this->filter) : -1;
173 $this->start = 0;
176 $this->start -= $this->pagesize;
179 $this->start += $this->pagesize;
182 $this->start = $this->users_total;
185 $this->validatePagination();
199 if (is_null($this->auth)) {
200 echo $this->lang['badauth'];
204 $user_list = $this->auth->retrieveUsers($this->start, $this->pagesize, $this->filter);
206 $page_buttons = $this->pagination();
207 $delete_disable = $this->auth->canDo('delUser') ? '' : 'disabled="disabled"';
209 $editable = $this->auth->canDo('UserMod');
210 $export_label = empty($this->filter) ? $this->lang['export_all'] : $this->lang['export_filtered'];
212 echo $this->locale_xhtml('intro');
213 echo $this->locale_xhtml('list');
218 if ($this->users_total > 0) {
220 '<p>' . $this->lang['summary'] . '</p>',
221 $this->start + 1,
222 $this->last,
223 $this->users_total,
224 $this->auth->getUserCount()
227 if ($this->users_total < 0) {
230 $allUserTotal = $this->auth->getUserCount();
232 printf('<p>%s</p>', sprintf($this->lang['nonefound'], $allUserTotal));
241 echo '<th>' . $this->lang["user_id"] . '</th>';
242 echo '<th>' . $this->lang["user_name"] . '</th>';
243 echo '<th>' . $this->lang["user_mail"] . '</th>';
244 echo '<th>' . $this->lang["user_groups"] . '</th>';
250 $this->lang['search_prompt'] . '" alt="' . $this->lang['search'] . '" class="button" /></td>';
251 echo '<td><input type="text" name="userid" class="edit" value="' . $this->htmlFilter('user') . '" /></td>';
252 echo '<td><input type="text" name="username" class="edit" value="' . $this->htmlFilter('name') . '" /></td>';
253 echo '<td><input type="text" name="usermail" class="edit" value="' . $this->htmlFilter('mail') . '" /></td>';
254 echo '<td><input type="text" name="usergroups" class="edit" value="' . $this->htmlFilter('grps') . '" /></td>';
258 if ($this->users_total) {
264 * @var string $pass
277 '" title="' . $this->lang['edit_prompt'] . '">' . hsc($user) . '</a></td>';
291 $this->lang['delete_selected'] . '</button>';
295 $this->lang['start'] . '</button>';
297 $this->lang['prev'] . "</button>";
299 $this->lang['next'] . '</button>';
301 $this->lang['last'] . '</button>';
303 if (!empty($this->filter)) {
304 echo '<button type="submit" name="fn[search][clear]">' . $this->lang['clear'] . '</button>';
310 $this->htmlFilterSettings(2);
320 $style = $this->edit_user ? ' class="edit_user"' : '';
322 if ($this->auth->canDo('addUser')) {
324 echo $this->locale_xhtml('add');
327 $this->htmlUserForm('add', null, [], 4);
333 if ($this->edit_user && $this->auth->canDo('UserMod')) {
335 echo $this->locale_xhtml('edit');
338 $this->htmlUserForm('modify', $this->edit_user, $this->edit_userdata, 4);
344 if ($this->auth->canDo('addUser')) {
345 $this->htmlImportForm();
361 if (!$auth instanceof AuthPlugin || !$auth->canDo('getUsers')) {
374 * @param array $userdata array with name, mail, pass and grps
392 $notes[] = sprintf($this->lang['note_group'], $conf['defaultgroup']);
400 echo '<tr><th>' . $this->lang["field"] . "</th><th>" . $this->lang["value"] . "</th></tr>";
404 $this->htmlInputField(
407 $this->lang["user_id"],
409 $this->auth->canDo("modLogin"),
413 $this->htmlInputField(
416 $this->lang["user_pass"],
418 $this->auth->canDo("modPass"),
422 $this->htmlInputField(
427 $this->auth->canDo("modPass"),
431 $this->htmlInputField(
434 $this->lang["user_name"],
436 $this->auth->canDo("modName"),
440 $this->htmlInputField(
443 $this->lang["user_mail"],
445 $this->auth->canDo("modMail"),
449 $this->htmlInputField(
452 $this->lang["user_groups"],
454 $this->auth->canDo("modGroups"),
459 if ($this->auth->canDo("modPass")) {
461 $notes[] = $this->lang['note_pass'];
464 $notes[] = $this->lang['note_notify'];
468 $this->lang["user_notify"] . ': </label></td>
485 $this->htmlFilterSettings($indent + 10);
487 echo '<button type="submit" name="fn[' . $cmd . ']">' . $this->lang[$cmd] . '</button>';
558 if (empty($this->filter)) return '';
559 return (isset($this->filter[$key]) ? hsc($this->filter[$key]) : '');
570 echo '<input type="hidden" name="start" value="' . $this->start . '" />';
572 foreach ($this->filter as $key => $filter) {
589 echo $this->locale_xhtml('import');
590 echo '<form action="' . wl($ID) . '" method="post" enctype="multipart/form-data">';
592 echo '<label>' . $this->lang['import_userlistcsv'] . '<input type="file" name="import" /></label>';
593 echo '<button type="submit" name="fn[import]">' . $this->lang['import'] . '</button>';
597 $this->htmlFilterSettings($indent + 4);
602 if ($this->import_failures) {
603 $digits = strlen(count($this->import_failures));
605 echo '<h3>' . $this->lang['import_header'] . '</h3>';
609 echo '<th class="line">' . $this->lang['line'] . '</th>';
610 echo '<th class="error">' . $this->lang['error'] . '</th>';
611 echo '<th class="userid">' . $this->lang['user_id'] . '</th>';
612 echo '<th class="username">' . $this->lang['user_name'] . '</th>';
613 echo '<th class="usermail">' . $this->lang['user_mail'] . '</th>';
614 echo '<th class="usergroups">' . $this->lang['user_groups'] . '</th>';
618 foreach ($this->import_failures as $line => $failure) {
630 echo '<p><a href="' . $failure_download_link . '">' . $this->lang['import_downloadfailures'] . '</a></p>';
644 if (!$this->auth->canDo('addUser')) return false;
646 [$user, $pass, $name, $mail, $grps, $passconfirm] = $this->retrieveUser();
649 if ($this->auth->canDo('modPass')) {
650 if (empty($pass)) {
651 if ($INPUT->has('usernotify')) {
652 $pass = auth_pwgen($user);
654 msg($this->lang['add_fail'], -1);
655 msg($this->lang['addUser_error_missing_pass'], -1);
658 } elseif (!$this->verifyPassword($pass, $passconfirm)) {
659 msg($this->lang['add_fail'], -1);
660 msg($this->lang['addUser_error_pass_not_identical'], -1);
663 } elseif (!empty($pass)) {
664 msg($this->lang['add_fail'], -1);
665 msg($this->lang['addUser_error_modPass_disabled'], -1);
669 if ($this->auth->canDo('modName')) {
671 msg($this->lang['add_fail'], -1);
672 msg($this->lang['addUser_error_name_missing'], -1);
676 msg($this->lang['add_fail'], -1);
677 msg($this->lang['addUser_error_modName_disabled'], -1);
681 if ($this->auth->canDo('modMail')) {
683 msg($this->lang['add_fail'], -1);
684 msg($this->lang['addUser_error_mail_missing'], -1);
688 msg($this->lang['add_fail'], -1);
689 msg($this->lang['addUser_error_modMail_disabled'], -1);
693 if ($ok = $this->auth->triggerUserMod('create', [$user, $pass, $name, $mail, $grps])) {
694 msg($this->lang['add_ok'], 1);
696 if ($INPUT->has('usernotify') && $pass) {
697 $this->notifyUser($user, $pass);
700 msg($this->lang['add_fail'], -1);
701 msg($this->lang['addUser_error_create_event_failed'], -1);
717 if (!$this->auth->canDo('delUser')) return false;
719 $selected = $INPUT->arr('delete');
724 msg("You can't delete yourself!", -1);
728 $count = $this->auth->triggerUserMod('delete', [$selected]);
730 $text = str_replace('%d', $count, $this->lang['delete_ok']);
733 $part1 = str_replace('%d', $count, $this->lang['delete_ok']);
734 $part2 = str_replace('%d', (count($selected) - $count), $this->lang['delete_fail']);
735 msg("$part1, $part2", -1);
753 if (!$this->auth->canDo('UserMod')) return false;
754 $user = $this->auth->cleanUser(preg_replace('/.*[:\/]/', '', $param));
755 $userdata = $this->auth->getUserData($user);
759 msg($this->lang['edit_usermissing'], -1);
763 $this->edit_user = $user;
764 $this->edit_userdata = $userdata;
779 if (!$this->auth->canDo('UserMod')) return false;
782 $olduser = $this->auth->cleanUser(preg_replace('/.*[:\/]/', '', $INPUT->str('userid_old')));
783 $oldinfo = $this->auth->getUserData($olduser);
786 [$newuser, $newpass, $newname, $newmail, $newgrps, $passconfirm] = $this->retrieveUser();
791 if (!$this->auth->canDo('modLogin')) { // sanity check, shouldn't be possible
792 msg($this->lang['update_fail'], -1);
796 // check if $newuser already exists
797 if ($this->auth->getUserData($newuser)) {
798 msg(sprintf($this->lang['update_exists'], $newuser), -1);
804 if ($this->auth->canDo('modPass')) {
806 if ($this->verifyPassword($newpass, $passconfirm)) {
807 $changes['pass'] = $newpass;
811 } elseif ($INPUT->has('usernotify')) {
812 // no new password supplied, check if we need to generate one (or it stays unchanged)
813 $changes['pass'] = auth_pwgen($olduser);
817 if (!empty($newname) && $this->auth->canDo('modName') && $newname != $oldinfo['name']) {
820 if (!empty($newmail) && $this->auth->canDo('modMail') && $newmail != $oldinfo['mail']) {
823 if (!empty($newgrps) && $this->auth->canDo('modGroups') && $newgrps != $oldinfo['grps']) {
827 if ($ok = $this->auth->triggerUserMod('modify', [$olduser, $changes])) {
828 msg($this->lang['update_ok'], 1);
830 if ($INPUT->has('usernotify') && !empty($changes['pass'])) {
832 $this->notifyUser($notify, $changes['pass']);
838 msg($this->lang['update_fail'], -1);
842 $this->editUser($olduser);
861 msg($this->lang['notify_ok'], 1);
864 msg($this->lang['notify_fail'], -1);
887 msg($lang['regbadpass'], -1);
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
938 $this->filter = [];
941 [$user, /* pass */, $name, $mail, $grps] = $this->retrieveUser(false);
943 if (!empty($user)) $this->filter['user'] = $user;
944 if (!empty($name)) $this->filter['name'] = $name;
945 if (!empty($mail)) $this->filter['mail'] = $mail;
946 if (!empty($grps)) $this->filter['grps'] = implode('|', $grps);
959 $t_filter = $INPUT->arr('filter');
978 if ($this->start >= $this->users_total) {
979 $this->start = $this->users_total - $this->pagesize;
981 if ($this->start < 0) $this->start = 0;
983 $this->last = min($this->users_total, $this->start + $this->pagesize);
997 $buttons['start'] = $buttons['prev'] = ($this->start == 0) ? $disabled : '';
999 if ($this->users_total == -1) {
1004 (($this->start + $this->pagesize) >= $this->users_total) ? $disabled : '';
1007 if ($this->lastdisabled) {
1019 // list of users for export - based on current filter criteria
1020 $user_list = $this->auth->retrieveUsers(0, 0, $this->filter);
1022 $this->lang["user_id"],
1023 $this->lang["user_name"],
1024 $this->lang["user_mail"],
1025 $this->lang["user_groups"]
1031 header('Content-type: text/csv;charset=utf-8');
1032 header('Content-Disposition: attachment; filename="wikiusers.csv"');
1034 # header('Content-type: text/plain;charset=utf-8');
1060 // check we are allowed to add users
1062 if (!$this->auth->canDo('addUser')) return false;
1064 // check file uploaded ok.
1067 !empty($_FILES['import']['error']) && $this->isUploadedFile($_FILES['import']['tmp_name'])
1069 msg($this->lang['import_error_upload'], -1);
1073 $this->import_failures = [];
1087 if ($raw[0] == 'user_id' || $raw[0] == $this->lang['user_id']) continue; // skip headers
1091 $error = sprintf($this->lang['import_error_fields'], count($raw));
1092 $this->import_failures[$line] = ['error' => $error, 'user' => $raw, 'orig' => $csv];
1096 $clean = $this->cleanImportUser($raw, $error);
1097 if ($clean && $this->importUser($clean, $error)) {
1098 $sent = $this->notifyUser($clean[0], $clean[1], false);
1100 msg(sprintf($this->lang['import_notify_fail'], $clean[0], $clean[3]), -1);
1106 $this->import_failures[$line] = ['error' => $error, 'user' => $raw, 'orig' => $csv];
1111 $this->lang['import_success_count'],
1115 ($import_success_count ? 1 : -1)
1118 msg(sprintf($this->lang['import_failure_count'], $import_fail_count), -1);
1121 msg($this->lang['import_error_readfail'], -1);
1127 $_SESSION['import_failures'] = $this->import_failures;
1145 $INPUT->set('userid', $candidate[0]);
1146 $INPUT->set('userpass', $candidate[1]);
1147 $INPUT->set('username', $candidate[2]);
1148 $INPUT->set('usermail', $candidate[3]);
1149 $INPUT->set('usergroups', $candidate[4]);
1151 $cleaned = $this->retrieveUser();
1152 [$user, /* pass */, $name, $mail, /* grps */] = $cleaned;
1154 $error = $this->lang['import_error_baduserid'];
1158 // no need to check password, handled elsewhere
1160 if (!($this->auth->canDo('modName') xor empty($name))) {
1161 $error = $this->lang['import_error_badname'];
1165 if ($this->auth->canDo('modMail')) {
1167 $error = $this->lang['import_error_badmail'];
1171 $error = $this->lang['import_error_badmail'];
1181 * Required a check of canDo('addUser') before
1189 if (!$this->auth->triggerUserMod('create', $user)) {
1190 $error = $this->lang['import_error_create'];
1206 header('Content-type: text/csv;charset=utf-8');
1207 header('Content-Disposition: attachment; filename="importfails.csv"');
1209 # header('Content-type: text/plain;charset=utf-8');
1213 foreach ($this->import_failures as $fail) {