Lines Matching +full:list +full:- +full:users -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)

22         $options->setHelp(
23 "Manage users for this DokuWiki instance\n"
26 // list
27 $options->registerCommand('list', 'List users');
28 $options->registerOption('verbose', 'Show detailed user information', 'v', false, 'list');
31 $options->registerCommand('add', 'Add an user to auth backend');
32 $options->registerArgument('login', 'Username', true, 'add');
33 $options->registerArgument('mail', 'Email address', true, 'add');
34 $options->registerArgument('name', 'Full name', false, 'add');
35 $options->registerArgument('groups', 'Groups to be added, comma-seperated', false, 'add');
36 $options->registerArgument('password', 'Password to set', false, 'add');
37 $options->registerOption('notify', 'Notify user', 'n', false, 'add');
40 $options->registerCommand('delete', 'Deletes user(s) from auth backend');
41 $options->registerArgument('name', 'Username(s), comma-seperated', true, 'delete');
44 $options->registerCommand('addtogroup', 'Add user to group(s)');
45 $options->registerArgument('name', 'Username', true, 'addtogroup');
46 $options->registerArgument('group', 'Group(s), comma-seperated', true, 'addtogroup');
49 $options->registerCommand('removefromgroup', 'Remove user from group(s)');
50 $options->registerArgument('name', 'Username', true, 'removefromgroup');
51 $options->registerArgument('group', 'Group(s), comma-separated', true, 'removefromgroup');
63 $this->error($this->getLang('noauth'));
67 switch ($options->getCmd()) {
68 case 'list':
69 $ret = $this->cmdList($options->getOpt('verbose'));
72 $ret = $this->cmdAdd($options->getOpt('notify'), $options->getArgs());
75 $ret = $this->cmdDelete($options->getArgs());
78 $ret = $this->cmdAddToGroup($options->getArgs());
81 $ret = $this->cmdRemoveFromGroup($options->getArgs());
85 echo $options->help();
101 if (!$auth->canDo('getUsers')) {
102 $this->error($this->getLang('nosupport'));
105 $this->listUsers($showdetails);
112 * List the given users
120 $list = $auth->retrieveUsers();
122 $tr = new TableFormatter($this->colors);
124 foreach ($list as $username => $user) {
131 echo $tr->format(
150 if (!$auth->canDo('addUser')) {
151 $this->error($this->getLang('nosupport'));
158 if ($auth->canDo('modPass')) {
163 $this->error($this->getLang('add_fail'));
164 $this->error($this->getLang('addUser_error_missing_pass'));
169 $this->error($this->getLang('add_fail'));
170 $this->error($this->getLang('addUser_error_modPass_disabled'));
174 if ($auth->triggerUserMod('create', [$login, $pass, $name, $mail, $grps])) {
175 $this->success($this->getLang('add_ok'));
177 $this->printErrorMessages();
178 $this->error($this->getLang('add_fail'));
179 $this->error($this->getLang('addUser_error_create_event_failed'));
187 * Deletes users
196 if (!$auth->canDo('delUser')) {
197 $this->error($this->getLang('nosupport'));
201 $users = explode(',', $args[0]);
202 $count = $auth->triggerUserMod('delete', [$users]);
204 if ($count != count($users)) {
205 $this->printErrorMessages();
206 $part1 = str_replace('%d', $count, $this->getLang('delete_ok'));
207 $part2 = str_replace('%d', (count($users) - $count), $this->getLang('delete_fail'));
208 $this->error("$part1, $part2");
228 $oldinfo = $auth->getUserData($name);
231 if ($newgrps !== [] && $auth->canDo('modGroups')) {
241 if ($auth->triggerUserMod('modify', [$name, $changes])) {
242 $this->success($this->getLang('update_ok'));
244 $this->printErrorMessages();
245 $this->error($this->getLang('update_fail'));
266 $oldinfo = $auth->getUserData($name);
269 if ($grps !== [] && $auth->canDo('modGroups')) {
279 if ($auth->triggerUserMod('modify', [$name, $changes])) {
280 $this->success($this->getLang('update_ok'));
282 $this->printErrorMessages();
283 $this->error($this->getLang('update_fail'));
300 if ($msg['lvl'] === 'error') $this->error($msg['msg']);