Skip to content

Commit

Permalink
usermanager CLI: more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Nov 25, 2020
1 parent 1a88e28 commit 3dc79ed
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/plugins/usermanager/cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ protected function setup(Options $options)
$options->registerArgument('login', 'Username', true, 'add');
$options->registerArgument('mail', 'Email address', true, 'add');
$options->registerArgument('name', 'Full name', false, 'add');
$options->registerArgument('groups', 'Groups to be added', false, 'add');
$options->registerArgument('password', 'Password of user', false, 'add');
$options->registerArgument('groups', 'Groups to be added, comma-seperated', false, 'add');
$options->registerArgument('password', 'Password to set', false, 'add');
$options->registerOption('notify', 'Notify user', 'n', false, 'add');

// delete
Expand Down Expand Up @@ -297,10 +297,13 @@ protected function cmdRemoveFromGroup(array $args)
* Plugins triggered during user modification may cause failures and output messages via
* DokuWiki's msg() function
*/
protected function printErrorMessages() {
protected function printErrorMessages()
{
global $MSG;
if(isset($MSG)) foreach($MSG as $msg) {
if($msg['lvl'] === 'error') $this->error($msg['msg']);
if (isset($MSG)) {
foreach ($MSG as $msg) {
if ($msg['lvl'] === 'error') $this->error($msg['msg']);
}
}
}
}

0 comments on commit 3dc79ed

Please sign in to comment.