summaryrefslogtreecommitdiff
path: root/lib/plugins/config/settings/extra.class.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-11-10 16:35:16 +0100
committerAndreas Gohr <andi@splitbrain.org>2012-11-10 16:35:16 +0100
commit3295f40a380553bb3f7f3018cee2e4462e0be417 (patch)
tree739448be73ee4b533f6053bf30b61449441e4909 /lib/plugins/config/settings/extra.class.php
parent7e29378446eeb33892837048b31b4180e26ccd1f (diff)
downloadrpg-3295f40a380553bb3f7f3018cee2e4462e0be417.tar.gz
rpg-3295f40a380553bb3f7f3018cee2e4462e0be417.tar.bz2
fixed saving in config plugin
Saving worked, but did you log out everytime. Now it is checked if the auth mechanism was actually changed before assuming the login is invalid.
Diffstat (limited to 'lib/plugins/config/settings/extra.class.php')
-rw-r--r--lib/plugins/config/settings/extra.class.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php
index f6adf1c18..6998e1fbf 100644
--- a/lib/plugins/config/settings/extra.class.php
+++ b/lib/plugins/config/settings/extra.class.php
@@ -64,7 +64,7 @@ if (!class_exists('setting_authtype')) {
// reject disabled plugins
if ($plugin_controller->isdisabled($input)) {
$this->_error = true;
- msg('Auth type ' . $input . ' is disabled.');
+ msg('Auth type ' . $input . ' is disabled.', -1);
return false;
}
@@ -74,21 +74,24 @@ if (!class_exists('setting_authtype')) {
// @TODO: throw an error in plugin controller instead of returning null
if (is_null($auth_plugin)) {
$this->_error = true;
- msg('Cannot load Auth Plugin "' . $input . '"');
+ msg('Cannot load Auth Plugin "' . $input . '"', -1);
return false;
}
// verify proper instanciation (is this really a plugin?) @TODO use instanceof? impement interface?
if (is_object($auth_plugin) && !method_exists($auth_plugin, 'getPluginName')) {
$this->_error = true;
- msg('Cannot create Auth Plugin "' . $input . '"');
+ msg('Cannot create Auth Plugin "' . $input . '"', -1);
return false;
}
}
- msg('Successfully changed auth system. Please re-login.');
- auth_logoff();
-
+ // did we change the auth type? logout
+ global $conf;
+ if($conf['authtype'] != $input) {
+ msg('Authentication system changed. Please re-login.');
+ auth_logoff();
+ }
return true;
}
}