protect authplain and current auth plugin

This commit is contained in:
Andreas Gohr 2014-01-05 20:45:32 +01:00
parent bcdcd3d147
commit 5284857cb2
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@
* It is not recommended to change this file, as it is overwritten on DokuWiki upgrades. * It is not recommended to change this file, as it is overwritten on DokuWiki upgrades.
*/ */
$plugins['acl'] = 1; $plugins['acl'] = 1;
$plugins['authplain'] = 1;
$plugins['extension'] = 1; $plugins['extension'] = 1;
$plugins['config'] = 1; $plugins['config'] = 1;
$plugins['usermanager'] = 1; $plugins['usermanager'] = 1;

View File

@ -102,11 +102,15 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
} }
/** /**
* If the extension is protected * If the extension is protected against any modification (disable/uninstall)
* *
* @return bool if the extension is protected * @return bool if the extension is protected
*/ */
public function isProtected() { public function isProtected() {
// never allow deinstalling the current auth plugin:
global $conf;
if ($this->id == $conf['authtype']) return true;
/** @var Doku_Plugin_Controller $plugin_controller */ /** @var Doku_Plugin_Controller $plugin_controller */
global $plugin_controller; global $plugin_controller;
$cascade = $plugin_controller->getCascade(); $cascade = $plugin_controller->getCascade();