summaryrefslogtreecommitdiff
path: root/lib/plugins/config
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/config')
-rw-r--r--lib/plugins/config/lang/en/intro.txt2
-rw-r--r--lib/plugins/config/lang/it/lang.php1
-rw-r--r--lib/plugins/config/settings/config.class.php24
-rw-r--r--lib/plugins/config/settings/config.metadata.php10
-rw-r--r--lib/plugins/config/settings/extra.class.php74
5 files changed, 53 insertions, 58 deletions
diff --git a/lib/plugins/config/lang/en/intro.txt b/lib/plugins/config/lang/en/intro.txt
index c83a80205..7cf46cee3 100644
--- a/lib/plugins/config/lang/en/intro.txt
+++ b/lib/plugins/config/lang/en/intro.txt
@@ -4,6 +4,6 @@ Use this page to control the settings of your DokuWiki installation. For help o
Settings shown with a light red background are protected and can not be altered with this plugin. Settings shown with a blue background are the default values and settings shown with a white background have been set locally for this particular installation. Both blue and white settings can be altered.
-Remember to press the **SAVE** button before leaving this page otherwise your changes will be lost.
+Remember to press the **Save** button before leaving this page otherwise your changes will be lost.
diff --git a/lib/plugins/config/lang/it/lang.php b/lib/plugins/config/lang/it/lang.php
index 751e5ee95..62dd00f0c 100644
--- a/lib/plugins/config/lang/it/lang.php
+++ b/lib/plugins/config/lang/it/lang.php
@@ -39,6 +39,7 @@ $lang['_editing'] = 'Impostazioni Modifica';
$lang['_links'] = 'Impostazioni Collegamenti';
$lang['_media'] = 'Impostazioni File';
$lang['_notifications'] = 'Impostazioni di notifica';
+$lang['_syndication'] = 'Impostazioni di collaborazione';
$lang['_advanced'] = 'Impostazioni Avanzate';
$lang['_network'] = 'Impostazioni Rete';
$lang['_plugin_sufix'] = 'Impostazioni Plugin';
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index 5b81be782..8eb99284d 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -20,6 +20,7 @@ if (!class_exists('configuration')) {
var $_metadata = array(); // holds metadata describing the settings
var $setting = array(); // array of setting objects
var $locked = false; // configuration is considered locked if it can't be updated
+ var $show_disabled_plugins = false;
// configuration filenames
var $_default_files = array();
@@ -70,9 +71,14 @@ if (!class_exists('configuration')) {
foreach ($keys as $key) {
if (isset($this->_metadata[$key])) {
$class = $this->_metadata[$key][0];
- $class = ($class && class_exists('setting_'.$class)) ? 'setting_'.$class : 'setting';
- if ($class=='setting') {
- $this->setting[] = new setting_no_class($key,$param);
+
+ if($class && class_exists('setting_'.$class)){
+ $class = 'setting_'.$class;
+ } else {
+ if($class != '') {
+ $this->setting[] = new setting_no_class($key,$param);
+ }
+ $class = 'setting';
}
$param = $this->_metadata[$key];
@@ -262,7 +268,7 @@ if (!class_exists('configuration')) {
function get_plugin_list() {
if (is_null($this->_plugin_list)) {
- $list = plugin_list('',true); // all plugins, including disabled ones
+ $list = plugin_list('',$this->show_disabled_plugins);
// remove this plugin from the list
$idx = array_search('config',$list);
@@ -364,7 +370,7 @@ if (!class_exists('setting')) {
var $_cautionList = array(
'basedir' => 'danger', 'baseurl' => 'danger', 'savedir' => 'danger', 'cookiedir' => 'danger', 'useacl' => 'danger', 'authtype' => 'danger', 'superuser' => 'danger', 'userewrite' => 'danger',
'start' => 'warning', 'camelcase' => 'warning', 'deaccent' => 'warning', 'sepchar' => 'warning', 'compression' => 'warning', 'xsendfile' => 'warning', 'renderer_xhtml' => 'warning', 'fnencode' => 'warning',
- 'allowdebug' => 'security', 'htmlok' => 'security', 'phpok' => 'security', 'iexssprotect' => 'security', 'xmlrpc' => 'security', 'fullpath' => 'security'
+ 'allowdebug' => 'security', 'htmlok' => 'security', 'phpok' => 'security', 'iexssprotect' => 'security', 'remote' => 'security', 'fullpath' => 'security'
);
function setting($key, $params=null) {
@@ -387,10 +393,12 @@ if (!class_exists('setting')) {
}
/**
- * update setting with user provided value $input
- * if value fails error check, save it
+ * update changed setting with user provided value $input
+ * - if changed value fails error check, save it to $this->_input (to allow echoing later)
+ * - if changed value passes error check, set $this->_local to the new value
*
- * @return boolean true if changed, false otherwise (incl. on error)
+ * @param mixed $input the new value
+ * @return boolean true if changed, false otherwise (incl. on error)
*/
function update($input) {
if (is_null($input)) return false;
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index 663eab9dd..22e76a013 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -70,14 +70,6 @@ $config['varname'] = 'conf'; // name of the config variable, sans $
// this value can be overriden when calling save_settings() method
$config['heading'] = 'Dokuwiki\'s Main Configuration File - Local Settings';
-/* DEPRECATED
-// ---------------[ setting files ]--------------------------------------
-// these values can be string expressions, they will be eval'd before use
-$file['local'] = "DOKU_CONF.'local.php'"; // mandatory (file doesn't have to exist)
-$file['default'] = "DOKU_CONF.'dokuwiki.php'"; // optional
-$file['protected'] = "DOKU_CONF.'local.protected.php'"; // optional
- */
-
// test value (FIXME, remove before publishing)
//$meta['test'] = array('multichoice','_choices' => array(''));
@@ -127,7 +119,7 @@ $meta['_authentication'] = array('fieldset');
$meta['useacl'] = array('onoff');
$meta['autopasswd'] = array('onoff');
$meta['authtype'] = array('authtype');
-$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5','mediawiki','bcrypt','sha512'));
+$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5','mediawiki','bcrypt','djangomd5','djangosha1','sha512'));
$meta['defaultgroup']= array('string');
$meta['superuser'] = array('string');
$meta['manager'] = array('string');
diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php
index 6998e1fbf..e4b97eb01 100644
--- a/lib/plugins/config/settings/extra.class.php
+++ b/lib/plugins/config/settings/extra.class.php
@@ -43,56 +43,50 @@ if (!class_exists('setting_authtype')) {
class setting_authtype extends setting_multichoice {
function initialize($default,$local,$protected) {
- global $plugin_controller;
+ global $plugin_controller;
- // retrive auth types provided by plugins
- foreach ($plugin_controller->getList('auth') as $plugin) {
- $this->_choices[] = $plugin;
- }
+ // retrieve auth types provided by plugins
+ foreach ($plugin_controller->getList('auth') as $plugin) {
+ $this->_choices[] = $plugin;
+ }
- parent::initialize($default,$local,$protected);
+ parent::initialize($default,$local,$protected);
}
function update($input) {
- global $plugin_controller;
-
- // is an update posible?
- $mayUpdate = parent::update($input);
-
- // is it an auth plugin?
- if (in_array($input, $plugin_controller->getList('auth'))) {
- // reject disabled plugins
- if ($plugin_controller->isdisabled($input)) {
- $this->_error = true;
- msg('Auth type ' . $input . ' is disabled.', -1);
- return false;
- }
-
- // load the plugin
- $auth_plugin = $plugin_controller->load('auth', $input);
-
- // @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 . '"', -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 . '"', -1);
- return false;
- }
- }
+ global $plugin_controller;
+
+ // is an update possible/requested?
+ $local = $this->_local; // save this, parent::update() may change it
+ if (!parent::update($input)) return false; // nothing changed or an error caught by parent
+ $this->_local = $local; // restore original, more error checking to come
+
+ // attempt to load the plugin
+ $auth_plugin = $plugin_controller->load('auth', $input);
+
+ // @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 . '"', -1);
+ return false;
+ }
+
+ // verify proper instantiation (is this really a plugin?) @TODO use instanceof? implement interface?
+ if (is_object($auth_plugin) && !method_exists($auth_plugin, 'getPluginName')) {
+ $this->_error = true;
+ msg('Cannot create Auth Plugin "' . $input . '"', -1);
+ return false;
+ }
// did we change the auth type? logout
global $conf;
if($conf['authtype'] != $input) {
- msg('Authentication system changed. Please re-login.');
- auth_logoff();
+ msg('Authentication system changed. Please re-login.');
+ auth_logoff();
}
- return true;
+
+ $this->_local = $input;
+ return true;
}
}
}