summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-01-05 20:45:32 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-01-05 20:45:32 +0100
commit5284857cb2f94bc347eb56c694d894283fc41703 (patch)
treea42da2b738077afbe731b36cb739a2ef4722d54f
parentbcdcd3d147fd8bcc680f24de88120c23d9533b50 (diff)
downloadrpg-5284857cb2f94bc347eb56c694d894283fc41703.tar.gz
rpg-5284857cb2f94bc347eb56c694d894283fc41703.tar.bz2
protect authplain and current auth plugin
-rw-r--r--conf/plugins.required.php1
-rw-r--r--lib/plugins/extension/helper/extension.php6
2 files changed, 6 insertions, 1 deletions
diff --git a/conf/plugins.required.php b/conf/plugins.required.php
index a2950b760..75336da2e 100644
--- a/conf/plugins.required.php
+++ b/conf/plugins.required.php
@@ -5,6 +5,7 @@
* It is not recommended to change this file, as it is overwritten on DokuWiki upgrades.
*/
$plugins['acl'] = 1;
+$plugins['authplain'] = 1;
$plugins['extension'] = 1;
$plugins['config'] = 1;
$plugins['usermanager'] = 1;
diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php
index be29f95d8..2a7119189 100644
--- a/lib/plugins/extension/helper/extension.php
+++ b/lib/plugins/extension/helper/extension.php
@@ -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
*/
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 */
global $plugin_controller;
$cascade = $plugin_controller->getCascade();