abort early when no auth backend is available

This commit is contained in:
Andreas Gohr 2020-11-25 22:01:42 +01:00
parent 44c2bd9127
commit e56df87425
1 changed files with 9 additions and 4 deletions

View File

@ -59,6 +59,14 @@ class cli_plugin_usermanager extends DokuWiki_CLI_Plugin
/** @inheritdoc */
protected function main(Options $options)
{
/** @var AuthPlugin $auth */
global $auth;
if (!isset($auth)) {
$this->error($this->getLang('noauth'));
return 1;
}
switch ($options->getCmd()) {
case 'list':
$ret = $this->cmdList($options->getOpt('verbose'));
@ -93,10 +101,7 @@ class cli_plugin_usermanager extends DokuWiki_CLI_Plugin
/** @var AuthPlugin $auth */
global $auth;
if (!isset($auth)) {
$this->error($this->getLang('noauth'));
return 1;
} elseif (!$auth->canDo('getUsers')) {
if (!$auth->canDo('getUsers')) {
$this->error($this->getLang('nosupport'));
return 1;
} else {