abort early when no auth backend is available
This commit is contained in:
parent
44c2bd9127
commit
e56df87425
|
@ -59,6 +59,14 @@ class cli_plugin_usermanager extends DokuWiki_CLI_Plugin
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
protected function main(Options $options)
|
protected function main(Options $options)
|
||||||
{
|
{
|
||||||
|
/** @var AuthPlugin $auth */
|
||||||
|
global $auth;
|
||||||
|
|
||||||
|
if (!isset($auth)) {
|
||||||
|
$this->error($this->getLang('noauth'));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($options->getCmd()) {
|
switch ($options->getCmd()) {
|
||||||
case 'list':
|
case 'list':
|
||||||
$ret = $this->cmdList($options->getOpt('verbose'));
|
$ret = $this->cmdList($options->getOpt('verbose'));
|
||||||
|
@ -93,10 +101,7 @@ class cli_plugin_usermanager extends DokuWiki_CLI_Plugin
|
||||||
/** @var AuthPlugin $auth */
|
/** @var AuthPlugin $auth */
|
||||||
global $auth;
|
global $auth;
|
||||||
|
|
||||||
if (!isset($auth)) {
|
if (!$auth->canDo('getUsers')) {
|
||||||
$this->error($this->getLang('noauth'));
|
|
||||||
return 1;
|
|
||||||
} elseif (!$auth->canDo('getUsers')) {
|
|
||||||
$this->error($this->getLang('nosupport'));
|
$this->error($this->getLang('nosupport'));
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue