Update of /cvsroot/phpwiki/phpwiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30619 Modified Files: configurator.php Log Message: empty default_value ifeq constant: fix ADMIN_PASSWD Index: configurator.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/configurator.php,v retrieving revision 1.34 retrieving revision 1.35 diff -u -2 -b -p -d -r1.34 -r1.35 --- configurator.php 8 Apr 2005 05:05:16 -0000 1.34 +++ configurator.php 24 Jul 2005 08:50:18 -0000 1.35 @@ -46,5 +46,5 @@ * A file config/config.ini will be automatically generated, if writable. * - * NOTE: If you have a starterscript outside PHOWIKI_DIR but no + * NOTE: If you have a starterscript outside PHPWIKI_DIR but no * config/config.ini yet (very unlikely!), you must define DATA_PATH in the * starterscript, otherwise the webpath to configurator is unknown, and @@ -68,4 +68,5 @@ if (isset($HTTP_POST_VARS['create'])) h // helpers from lib/WikiUser/HttpAuth.php +if (!function_exists('_http_user')) { function _http_user() { if (!isset($_SERVER)) @@ -105,5 +106,5 @@ if (isset($HTTP_POST_VARS['create'])) h exit(); } - +} // If config.ini exists, we require ADMIN_USER access by faking HttpAuth. @@ -987,5 +988,5 @@ Try any of these in the given order: <dd>Use DBAUTH_AUTH_* (see below) with PearDB or ADODB only.</dd> <dt>LDAP</dt> - <dd>Authenticate against LDAP_AUTH_HOST with LDAP_BASE_DN</dd> + <dd>Authenticate against LDAP_AUTH_HOST with LDAP_BASE_DN.</dd> <dt>IMAP</dt> <dd>Authenticate against IMAP_AUTH_HOST (email account)</dd> @@ -1008,5 +1009,6 @@ separate the name of each one with colon <pre> USER_AUTH_ORDER = 'PersonalPage : Db' - USER_AUTH_ORDER = 'BogoLogin : PersonalPage'</pre>"); + USER_AUTH_ORDER = 'BogoLogin : PersonalPage' +</pre>"); $properties["PASSWORD_LENGTH_MINIMUM"] = @@ -1233,11 +1235,11 @@ Default: ou=Groups"); $properties["LDAP Authentication"] = new unchangeable_define('LDAP Authentication', " -If USER_AUTH_ORDER contains Ldap: - -The LDAP server to connect to. Can either be a hostname, or a complete -URL to the server (useful if you want to use ldaps or specify a different -port number). +; If USER_AUTH_ORDER contains Ldap: +; +; The LDAP server to connect to. Can either be a hostname, or a complete +; URL to the server (useful if you want to use ldaps or specify a different +; port number). ;LDAP_AUTH_HOST = \"ldap://localhost:389\" - +; ; The organizational or domain BASE DN: e.g. \"dc=mydomain,dc=com\". ; @@ -1407,8 +1409,8 @@ new _define_selection_optional('DEFAULT_ array('en' => "English", '' => "<empty> (user-specific)", - 'fr' => "Français", + 'fr' => "Fran~is", 'de' => "Deutsch", 'nl' => "Nederlands", - 'es' => "Español", + 'es' => "Espa~l", 'sv' => "Svenska", 'it' => "Italiano", @@ -1419,10 +1421,10 @@ Other languages available:<pre> English \"en\" (English - HomePage) German \"de\" (Deutsch - StartSeite) -French \"fr\" (Français - Accueil) +French \"fr\" (Fran~is - Accueil) Dutch \"nl\" (Nederlands - ThuisPagina) -Spanish \"es\" (Español - PáginaPrincipal) +Spanish \"es\" (Espa~l - P~inaPrincipal) Swedish \"sv\" (Svenska - Framsida) Italian \"it\" (Italiano - PaginaPrincipale) -Japanese \"ja\" (Japanese - \Û¡1⁄4\à\Ú¡1⁄4\ ̧) +Japanese \"ja\" (Japanese - ~~~~~~) Chinese \"zh\" (Chinese) </pre> @@ -1826,4 +1828,6 @@ class _variable { and !preg_match("/(SCRIPT_NAME|VIRTUAL_PATH)/", $config_item_name)) $this->default_value = constant($config_item_name); // ignore given default value + elseif ($config_item_name == $default_value) + $this->default_value = ''; else $this->default_value = $default_value; @@ -2125,4 +2129,5 @@ extends _define { function _define_password($config_item_name, $default_value, $description, $jscheck = '') { + if ($config_item_name == $default_value) $default_value = ''; $this->_define($config_item_name, $default_value, $description, $jscheck); if (!$jscheck) @@ -2170,4 +2175,5 @@ class _variable_password extends _variable { function _variable_password($config_item_name, $default_value, $description, $jscheck = '') { + if ($config_item_name == $default_value) $default_value = ''; $this->_define($config_item_name, $default_value, $description, $jscheck); if (!$jscheck) @@ -2182,9 +2188,14 @@ extends _variable { $s .= "Created password: <strong>$new_password</strong><br /> <br />"; } - $s .= "<input type=\"password\" name=\"" . $this->get_config_item_name() - . "\" value=\"" . $this->default_value - . "\" {$this->jscheck} />" + // dont re-encrypt already encrypted passwords + $value = $this->value(); + $encrypted = !empty($GLOBALS['properties']["Encrypted Passwords"]) and + $GLOBALS['properties']["Encrypted Passwords"]->value(); + if (empty($value)) + $encrypted = false; + $s .= "<input type=\"". ($encrypted ? "text" : "password") . "\" name=\"" . $this->get_config_item_name() + . "\" value=\"" . $value . "\" {$this->jscheck} />" . " <input type=\"submit\" name=\"create\" value=\"Create Random Password\" />"; - if (empty($this->default_value)) + if (empty($value)) $s .= "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: red\">Cannot be empty.</p>"; elseif (strlen($this->default_value) < 4)