From: <var...@us...> - 2021-07-29 10:23:48
|
Revision: 10388 http://sourceforge.net/p/phpwiki/code/10388 Author: vargenau Date: 2021-07-29 10:23:46 +0000 (Thu, 29 Jul 2021) Log Message: ----------- configurator.php: mysqli Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-07-29 10:22:09 UTC (rev 10387) +++ trunk/configurator.php 2021-07-29 10:23:46 UTC (rev 10388) @@ -657,9 +657,9 @@ </pre> For a MySQL database, the following should work: <pre> - mysql://user:password@host/databasename + mysqli://user:password@host/databasename </pre> -To connect over a unix socket, use something like +To connect over a Unix socket, use something like <pre> mysql://user:password@unix(/path/to/socket)/databasename </pre> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 10:26:23
|
Revision: 10389 http://sourceforge.net/p/phpwiki/code/10389 Author: vargenau Date: 2021-07-29 10:26:22 +0000 (Thu, 29 Jul 2021) Log Message: ----------- configurator.php: fix size Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-07-29 10:23:46 UTC (rev 10388) +++ trunk/configurator.php 2021-07-29 10:26:22 UTC (rev 10389) @@ -1753,7 +1753,7 @@ { $size = strlen($this->default_value) > 45 ? 90 : 50; return $this->get_config_item_header() . - "<input type=\"text\" size=\"$50\" name=\"" . $this->get_config_item_name() . "\" value=\"" . htmlspecialchars($this->default_value) . "\" " . + "<input type=\"text\" size=\"50\" name=\"" . $this->get_config_item_name() . "\" value=\"" . htmlspecialchars($this->default_value) . "\" " . $this->jscheck . " />" . "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 10:29:55
|
Revision: 10390 http://sourceforge.net/p/phpwiki/code/10390 Author: vargenau Date: 2021-07-29 10:29:52 +0000 (Thu, 29 Jul 2021) Log Message: ----------- configurator.php: remove DEBUG Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-07-29 10:26:22 UTC (rev 10389) +++ trunk/configurator.php 2021-07-29 10:29:52 UTC (rev 10390) @@ -324,8 +324,6 @@ </div> <?php -define('DEBUG', 0); -//define('DEBUG', 1); /** * The Configurator is a php script to aid in the configuration of PhpWiki. * Parts of this file were based on PHPWeather's configurator.php file. @@ -2541,8 +2539,6 @@ "; $posted = $GLOBALS['HTTP_POST_VARS']; - /*if (defined('DEBUG')) - printArray($GLOBALS['HTTP_POST_VARS']);*/ foreach ($properties as $option_name => $a) { $posted_value = stripslashes($posted[$a->config_item_name]); @@ -2605,7 +2601,6 @@ while (list($property, $obj) = each($properties)) { echo $obj->get_instructions($property); if ($h = $obj->get_html()) { - if (defined('DEBUG') and DEBUG) $h = get_class($obj) . "<br />\n" . $h; echo "<td>" . $h . "</td>\n"; } echo '</tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 12:53:51
|
Revision: 10391 http://sourceforge.net/p/phpwiki/code/10391 Author: vargenau Date: 2021-07-29 12:53:49 +0000 (Thu, 29 Jul 2021) Log Message: ----------- configurator.php: add description for DISABLED_ACTIONS Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-07-29 10:29:52 UTC (rev 10390) +++ trunk/configurator.php 2021-07-29 12:53:49 UTC (rev 10391) @@ -532,8 +532,14 @@ new numeric_define_optional('MINOR_EDIT_TIMEOUT', MINOR_EDIT_TIMEOUT); $properties["Disabled Actions"] = - new array_define('DISABLED_ACTIONS', DISABLED_ACTIONS /*array()*/); + new array_define('DISABLED_ACTIONS', array("dumpserial", "loadfile"), "Actions listed in this array will not be allowed. The complete list +of actions can be found in lib/main.php with the function +getActionDescription. +purge, remove, revert, xmlrpc, soap, upload, browse, create, diff, dumphtml, +dumpserial, edit, loadfile, lock, unlock, viewsource, zip, ziphtml, ... +"); + $properties["Moderate all Pagechanges"] = new boolean_define_commented_optional('ENABLE_MODERATEDPAGE_ALL'); @@ -2302,7 +2308,6 @@ class boolean_define extends _define { - // adds ->values property, instead of ->default_value function boolean_define($config_item_name, $values = false, $description = '', $jscheck = '') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 13:14:38
|
Revision: 10392 http://sourceforge.net/p/phpwiki/code/10392 Author: vargenau Date: 2021-07-29 13:14:35 +0000 (Thu, 29 Jul 2021) Log Message: ----------- configurator.php: replace "each" to be compatable with PHP 8 Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-07-29 12:53:49 UTC (rev 10391) +++ trunk/configurator.php 2021-07-29 13:14:35 UTC (rev 10392) @@ -1826,10 +1826,11 @@ function value() { global $HTTP_POST_VARS; - if (!empty($HTTP_POST_VARS[$this->config_item_name])) + if (!empty($HTTP_POST_VARS[$this->config_item_name])) { return $HTTP_POST_VARS[$this->config_item_name]; - else { - list($option, $label) = each($this->default_value); + } else { + $option = key($this->default_value); + next($this->default_value); return $option; } } @@ -2353,7 +2354,7 @@ $default_value = $this->default_value ? 'true' : 'false'; /* There can usually only be two options, there can be * three options in the case of a boolean_define_commented_optional */ - while (list($option, $label) = each($values)) { + foreach ($values as $option => $label) { if (!is_null($this->default_value) and $option === $default_value) $output .= " <option value=\"$option\" selected=\"selected\">$label</option>\n"; else @@ -2376,7 +2377,8 @@ { if ($this->description) $n = "\n"; - list($default_value, $label) = each($this->default_value); + $default_value = key($this->default_value); + next($this->default_value); if ($posted_value == $default_value) return "${n};" . $this->_config_format($posted_value); elseif ($posted_value == '') @@ -2603,7 +2605,7 @@ <table> '; - while (list($property, $obj) = each($properties)) { + foreach ($properties as $property => $obj) { echo $obj->get_instructions($property); if ($h = $obj->get_html()) { echo "<td>" . $h . "</td>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 15:01:27
|
Revision: 10393 http://sourceforge.net/p/phpwiki/code/10393 Author: vargenau Date: 2021-07-29 15:01:20 +0000 (Thu, 29 Jul 2021) Log Message: ----------- configurator.php: check default_value exists Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-07-29 13:14:35 UTC (rev 10392) +++ trunk/configurator.php 2021-07-29 15:01:20 UTC (rev 10393) @@ -1829,9 +1829,13 @@ if (!empty($HTTP_POST_VARS[$this->config_item_name])) { return $HTTP_POST_VARS[$this->config_item_name]; } else { - $option = key($this->default_value); - next($this->default_value); - return $option; + if (is_array($this->default_value)) { + $option = key($this->default_value); + next($this->default_value); + return $option; + } else { + return ''; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 15:46:38
|
Revision: 10394 http://sourceforge.net/p/phpwiki/code/10394 Author: vargenau Date: 2021-07-29 15:46:37 +0000 (Thu, 29 Jul 2021) Log Message: ----------- configurator.php: use __construct Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-07-29 15:01:20 UTC (rev 10393) +++ trunk/configurator.php 2021-07-29 15:46:37 UTC (rev 10394) @@ -1651,7 +1651,6 @@ */ class _variable { - var $config_item_name; var $default_value; var $description; @@ -1658,7 +1657,7 @@ var $prefix; var $jscheck; - function _variable($config_item_name, $default_value = '', $description = '', $jscheck = '') + function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') { $this->config_item_name = $config_item_name; if (!$description) @@ -1682,7 +1681,7 @@ function _define($config_item_name, $default_value = '', $description = '', $jscheck = '') { - $this->_variable($config_item_name, $default_value, $description, $jscheck); + _variable::__construct($config_item_name, $default_value, $description, $jscheck); } function value() @@ -1953,9 +1952,9 @@ extends _define { - function numeric_define($config_item_name, $default_value = '', $description = '', $jscheck = '') + function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') { - $this->_define($config_item_name, $default_value, $description, $jscheck); + parent::__construct($config_item_name, $default_value, $description, $jscheck); if (!$jscheck) $this->jscheck = "onchange=\"validate_ereg('Sorry, \'%s\' is not an integer.', '^[-+]?[0-9]+$', '" . $this->get_config_item_name() . "', this);\""; } @@ -2044,11 +2043,10 @@ class _define_password extends _define { - - function _define_password($config_item_name, $default_value = '', $description = '', $jscheck = '') + function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') { if ($config_item_name == $default_value) $default_value = ''; - $this->_define($config_item_name, $default_value, $description, $jscheck); + parent::__construct($config_item_name, $default_value, $description, $jscheck); if (!$jscheck) $this->jscheck = "onchange=\"validate_ereg('Sorry, \'%s\' cannot be empty.', '^.+$', '" . $this->get_config_item_name() . "', this);\""; @@ -2087,11 +2085,11 @@ extends _define_password { - function _define_password_optional($config_item_name, $default_value = '', $description = '', $jscheck = '') + function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') { if ($config_item_name == $default_value) $default_value = ''; if (!$jscheck) $this->jscheck = " "; - $this->_define($config_item_name, $default_value, $description, $jscheck); + parent::__construct($config_item_name, $default_value, $description, $jscheck); } function _get_config_line($posted_value) @@ -2128,10 +2126,10 @@ class _variable_password extends _variable { - function _variable_password($config_item_name, $default_value = '', $description = '', $jscheck = '') + function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') { if ($config_item_name == $default_value) $default_value = ''; - $this->_define($config_item_name, $default_value, $description, $jscheck); + parent::__construct($config_item_name, $default_value, $description, $jscheck); if (!$jscheck) $this->jscheck = "onchange=\"validate_ereg('Sorry, \'%s\' cannot be empty.', '^.+$', '" . $this->get_config_item_name() . "', this);\""; } @@ -2314,7 +2312,7 @@ extends _define { // adds ->values property, instead of ->default_value - function boolean_define($config_item_name, $values = false, $description = '', $jscheck = '') + function __construct($config_item_name, $values = false, $description = '', $jscheck = '') { $this->config_item_name = $config_item_name; if (!$description) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 09:30:44
|
Revision: 10422 http://sourceforge.net/p/phpwiki/code/10422 Author: vargenau Date: 2021-08-04 09:30:41 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: create function dba_handlers if it does not exist; mysqli in DATABASE_DSN Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 08:34:15 UTC (rev 10421) +++ trunk/configurator.php 2021-08-04 09:30:41 UTC (rev 10422) @@ -78,6 +78,13 @@ $fs_config_file = dirname(__FILE__) . (substr(PHP_OS, 0, 3) == 'WIN' ? '\\' : '/') . $config_file; if (isset($_POST['create'])) header('Location: ' . $configurator . '?show=_part1&create=1#create'); +if (!function_exists('dba_handlers')) { + function dba_handlers() + { + return array('none (function dba_handlers does not exist)'); + } +} + // helpers from lib/WikiUser/HttpAuth.php if (!function_exists('_http_user')) { function _http_user() @@ -665,11 +672,11 @@ </pre> To connect over a Unix socket, use something like <pre> - mysql://user:password@unix(/path/to/socket)/databasename + mysqli://user:password@unix(/path/to/socket)/databasename </pre> <pre> - DATABASE_DSN = mysql://guest@:/var/lib/mysql/mysql.sock/phpwiki - DATABASE_DSN = mysql://guest@localhost/phpwiki + DATABASE_DSN = mysqli://guest@:/var/lib/mysql/mysql.sock/phpwiki + DATABASE_DSN = mysqli://guest@localhost/phpwiki DATABASE_DSN = pgsql://localhost/user_phpwiki </pre>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 11:19:58
|
Revision: 10425 http://sourceforge.net/p/phpwiki/code/10425 Author: vargenau Date: 2021-08-04 11:19:57 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: make Compress Output work Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 10:45:01 UTC (rev 10424) +++ trunk/configurator.php 2021-08-04 11:19:57 UTC (rev 10425) @@ -2226,17 +2226,19 @@ function __construct($config_item_name, $values = false, $description = '', $jscheck = '') { $this->config_item_name = $config_item_name; - if (!$description) + if (!$description) { $description = text_from_dist($config_item_name); + } $this->description = $description; // TESTME: get boolean default value from config-default.ini - if (defined($config_item_name)) + if (defined($config_item_name)) { $this->default_value = constant($config_item_name); // ignore given default value - elseif (is_array($values)) - list($this->default_value, $dummy) = $values[0]; - if (!$values) - $values = array('false' => "Disabled", - 'true' => "Enabled"); + } elseif (is_array($values)) { + list($this->default_value, $dummy) = $values[""]; + } + if (!$values) { + $values = array('false' => "Disabled", 'true' => "Enabled"); + } $this->values = $values; $this->jscheck = $jscheck; $this->prefix = ""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 14:20:59
|
Revision: 10428 http://sourceforge.net/p/phpwiki/code/10428 Author: vargenau Date: 2021-08-04 14:20:52 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: always define variable $n Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 13:24:48 UTC (rev 10427) +++ trunk/configurator.php 2021-08-04 14:20:52 UTC (rev 10428) @@ -1679,9 +1679,10 @@ function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; - return "${n}" . $this->default_value; + return "$n" . $this->default_value; } function get_instructions($title) @@ -1698,11 +1699,12 @@ { function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if (!$posted_value) $posted_value = $this->default_value; - return "${n}" . $this->_config_format($posted_value); + return "$n" . $this->_config_format($posted_value); } function _config_format($value) @@ -1762,12 +1764,13 @@ function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if ($posted_value == '') - return "${n};" . $this->_config_format(""); + return "$n;" . $this->_config_format(""); else - return "${n}" . $this->_config_format($posted_value); + return "$n" . $this->_config_format($posted_value); } function get_html() @@ -1785,13 +1788,15 @@ { function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if ($posted_value == $this->default_value) - return "${n};" . $this->_config_format($posted_value); + return "$n;" . $this->_config_format($posted_value); elseif ($posted_value == '') - return "${n};" . $this->_config_format(""); else - return "${n}" . $this->_config_format($posted_value); + return "$n;" . $this->_config_format(""); + else + return "$n" . $this->_config_format($posted_value); } } @@ -1843,12 +1848,13 @@ function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if ($posted_value == '') - return "${n};" . $this->_config_format('0'); + return "$n;" . $this->_config_format('0'); else - return "${n}" . $this->_config_format($posted_value); + return "$n" . $this->_config_format($posted_value); } } @@ -1862,13 +1868,15 @@ { function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if ($posted_value == $this->default_value) - return "${n};" . $this->_config_format($posted_value); + return "$n;" . $this->_config_format($posted_value); elseif ($posted_value == '') - return "${n};" . $this->_config_format('0'); else - return "${n}" . $this->_config_format($posted_value); + return "$n;" . $this->_config_format('0'); + else + return "$n" . $this->_config_format($posted_value); } } @@ -1901,14 +1909,15 @@ { function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if ($posted_value == $this->default_value) - return "${n};" . $this->_config_format($posted_value); + return "$n;" . $this->_config_format($posted_value); elseif ($posted_value == '') - return "${n};" . $this->_config_format(""); + return "$n;" . $this->_config_format(""); else - return "${n}" . $this->_config_format($posted_value); + return "$n" . $this->_config_format($posted_value); } } @@ -1926,10 +1935,11 @@ function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if ($posted_value == '') { - $p = "${n};" . $this->_config_format(""); + $p = "$n;" . $this->_config_format(""); $p .= "\n; If you used the passencrypt.php utility to encode the password"; $p .= "\n; then uncomment this line:"; $p .= "\n;ENCRYPTED_PASSWD = true"; @@ -1942,7 +1952,7 @@ 16 * CRYPT_BLOWFISH); // generate an encrypted password $crypt_pass = crypt($posted_value, rand_ascii($salt_length)); - $p = "${n}" . $this->_config_format($crypt_pass); + $p = "$n" . $this->_config_format($crypt_pass); return $p . "\nENCRYPTED_PASSWD = true"; } } @@ -1966,12 +1976,13 @@ function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; if ($posted_value == '') { - return "${n};" . $this->_config_format(""); + return "$n;" . $this->_config_format(""); } else { - return "${n}" . $this->_config_format($posted_value); + return "$n" . $this->_config_format($posted_value); } } @@ -2153,9 +2164,10 @@ function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; - return "${n}" . $this->_config_format($posted_value); + return "$n" . $this->_config_format($posted_value); } function _config_format($value) @@ -2197,15 +2209,17 @@ { function _get_config_line($posted_value) { + $n = ""; if ($this->description) $n = "\n"; $default_value = key($this->default_value); next($this->default_value); if ($posted_value == $default_value) - return "${n};" . $this->_config_format($posted_value); + return "$n;" . $this->_config_format($posted_value); elseif ($posted_value == '') - return "${n};" . $this->_config_format('false'); else - return "${n}" . $this->_config_format($posted_value); + return "$n;" . $this->_config_format('false'); + else + return "$n" . $this->_config_format($posted_value); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 14:22:08
|
Revision: 10429 http://sourceforge.net/p/phpwiki/code/10429 Author: vargenau Date: 2021-08-04 14:22:06 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: we have at least PHP 5 Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 14:20:52 UTC (rev 10428) +++ trunk/configurator.php 2021-08-04 14:22:06 UTC (rev 10429) @@ -650,12 +650,12 @@ array('dba' => "dba", 'SQL' => "SQL PEAR", 'ADODB' => "SQL ADODB", - 'PDO' => "PDO (php5 only)", + 'PDO' => "PDO", 'file' => "flatfile")/*, " Select the database backend type: Choose dba (default) to use one of the standard UNIX dba libraries. This is the fastest. Choose ADODB or SQL to use an SQL database with ADODB or PEAR. -Choose PDO on php5 to use an SQL database. (experimental, no paging yet) +Choose PDO to use an SQL database. (experimental, no paging yet) flatfile is simple and slow. Recommended is dba or SQL: PEAR or ADODB."*/); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 14:23:29
|
Revision: 10430 http://sourceforge.net/p/phpwiki/code/10430 Author: vargenau Date: 2021-08-04 14:23:13 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: remove unused code Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 14:22:06 UTC (rev 10429) +++ trunk/configurator.php 2021-08-04 14:23:13 UTC (rev 10430) @@ -2353,14 +2353,6 @@ return ($newpass); } -// debugging -function printArray($a) -{ - echo "<hr />\n<pre>\n"; - print_r($a); - echo "\n</pre>\n<hr />\n"; -} - // end of class definitions ///////////////////////////// // begin auto generation code @@ -2411,8 +2403,6 @@ echo "<p>The configuration was written to <code><b>$config_file</b></code>.</p>\n"; if ($new_filename) { echo "<p>A backup was made to <code><b>$new_filename</b></code>.</p>\n"; - } else { - ; //echo "<p><strong>You must rename or copy this</strong> <code><b>$config_file</b></code> <strong>file to</strong> <code><b>config/config.ini</b></code>.</p>\n"; } } else { echo "<p>The configuration file could <b>not</b> be written.<br />\n", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 16:17:00
|
Revision: 10433 http://sourceforge.net/p/phpwiki/code/10433 Author: vargenau Date: 2021-08-04 16:16:58 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: check default_value is an array; use parent Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 14:31:19 UTC (rev 10432) +++ trunk/configurator.php 2021-08-04 16:16:58 UTC (rev 10433) @@ -1669,7 +1669,6 @@ return ""; } - // function get_html() { return false; } function get_html() { return $this->get_config_item_header() . @@ -1890,12 +1889,12 @@ function _get_config_line($posted_value) { - return _define::_get_config_line($posted_value); + return parent::_get_config_line($posted_value); } function get_html() { - return _variable_selection::get_html(); + return parent::get_html(); } } @@ -1959,7 +1958,7 @@ function get_html() { - return _variable_password::get_html(); + return parent::get_html(); } } @@ -2087,11 +2086,14 @@ function get_html() { - if (is_array($this->default_value)) + if (is_array($this->default_value)) { $list_values = join("\n", $this->default_value); - else + $count = count($this->default_value); + } else { $list_values = $this->default_value; - $rows = max(3, count($this->default_value) + 1); + $count = 1; + } + $rows = max(3, $count + 1); $ta = $this->get_config_item_header(); $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" {$this->jscheck}>"; $ta .= $list_values . "</textarea>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 16:36:07
|
Revision: 10434 http://sourceforge.net/p/phpwiki/code/10434 Author: vargenau Date: 2021-08-04 16:36:04 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: use CSS for green and red color Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 16:16:58 UTC (rev 10433) +++ trunk/configurator.php 2021-08-04 16:36:04 UTC (rev 10434) @@ -230,6 +230,13 @@ color: inherit; } + .green { + color: green; + } + + .red { + color: red; + } --> </style> <script type="text/javascript"> @@ -238,7 +245,7 @@ var msg = document.getElementById(output); if (accepted) { if (msg && msg.innerHTML) { - msg.innerHTML = "<span color=\"green\">Input accepted.</span>"; + msg.innerHTML = "<span class=\"green\">Input accepted.</span>"; } } else { var index; @@ -246,7 +253,7 @@ error = error.substring(0, index) + value + error.substring(index + 2); } if (msg) { - msg.innerHTML = "<span color=\"red\">" + error + "</span>"; + msg.innerHTML = "<span class=\"red\">" + error + "</span>"; } } var submit; @@ -1657,7 +1664,7 @@ $size = strlen($this->default_value) > 45 ? 90 : 50; return $this->get_config_item_header() . "<input type=\"text\" size=\"50\" name=\"" . $this->get_config_item_name() . "\" value=\"" . htmlspecialchars($this->default_value) . "\" " . - $this->jscheck . " />" . "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; + $this->jscheck . " />" . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; } } @@ -1778,7 +1785,7 @@ return $this->get_config_item_header() . "<input type=\"text\" size=\"$size\" name=\"" . htmlentities($this->get_config_item_name()) . "\" value=\"" . htmlentities($this->default_value) . "\" {$this->jscheck} />" - . "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; + . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; } } @@ -1823,9 +1830,9 @@ . "<input type=\"text\" size=\"50\" name=\"" . $this->get_config_item_name() . "\" value=\"" . $this->default_value . "\" {$this->jscheck} />"; if (empty($this->default_value)) - return $s . "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: red\">Cannot be empty.</p>"; + return $s . "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>"; else - return $s . "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; + return $s . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; } } @@ -2030,10 +2037,11 @@ . "\" value=\"" . $value . "\" {$this->jscheck} />" . " <input type=\"submit\" name=\"create\" value=\"Create Random Password\" />"; if (empty($value)) - $s .= "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: red\">Cannot be empty.</p>"; + $s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>"; elseif (strlen($this->default_value) < 4) - $s .= "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: red\">Must be longer than 4 chars.</p>"; else - $s .= "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; + $s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Must be longer than 4 chars.</p>"; + else + $s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $s; } } @@ -2058,7 +2066,7 @@ $ta = $this->get_config_item_header(); $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" {$this->jscheck}>"; $ta .= $list_values . "</textarea>"; - $ta .= "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; + $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; } } @@ -2097,7 +2105,7 @@ $ta = $this->get_config_item_header(); $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" {$this->jscheck}>"; $ta .= $list_values . "</textarea>"; - $ta .= "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; + $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; } } @@ -2134,7 +2142,7 @@ $ta = $this->get_config_item_header(); $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" {$this->jscheck}>"; $ta .= $list_values . "</textarea>"; - $ta .= "<p id=\"" . $this->get_config_item_id() . "\" style=\"color: green\">Input accepted.</p>"; + $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 16:57:11
|
Revision: 10435 http://sourceforge.net/p/phpwiki/code/10435 Author: vargenau Date: 2021-08-04 16:57:05 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: remove unnecessary braces; use size Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 16:36:04 UTC (rev 10434) +++ trunk/configurator.php 2021-08-04 16:57:05 UTC (rev 10435) @@ -1663,8 +1663,9 @@ { $size = strlen($this->default_value) > 45 ? 90 : 50; return $this->get_config_item_header() . - "<input type=\"text\" size=\"50\" name=\"" . $this->get_config_item_name() . "\" value=\"" . htmlspecialchars($this->default_value) . "\" " . - $this->jscheck . " />" . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; + "<input type=\"text\" size=\"$size\" name=\"" . $this->get_config_item_name() + . "\" value=\"" . htmlspecialchars($this->default_value) . "\" " . $this->jscheck . " />" + . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; } } @@ -1784,7 +1785,7 @@ $size = strlen($this->default_value) > 45 ? 90 : 50; return $this->get_config_item_header() . "<input type=\"text\" size=\"$size\" name=\"" . htmlentities($this->get_config_item_name()) - . "\" value=\"" . htmlentities($this->default_value) . "\" {$this->jscheck} />" + . "\" value=\"" . htmlentities($this->default_value) . "\" $this->jscheck />" . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; } } @@ -2027,7 +2028,7 @@ $this->default_value = $new_password; $s .= "Created password: <strong>$new_password</strong><br /> <br />"; } - // dont re-encrypt already encrypted passwords + // do not re-encrypt already encrypted passwords $value = $this->value(); $encrypted = !empty($GLOBALS['properties']["Encrypted Passwords"]) and $GLOBALS['properties']["Encrypted Passwords"]->value(); @@ -2034,7 +2035,7 @@ if (empty($value)) $encrypted = false; $s .= "<input type=\"" . ($encrypted ? "text" : "password") . "\" name=\"" . $this->get_config_item_name() - . "\" value=\"" . $value . "\" {$this->jscheck} />" + . "\" value=\"" . $value . "\" $this->jscheck />" . " <input type=\"submit\" name=\"create\" value=\"Create Random Password\" />"; if (empty($value)) $s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 17:07:51
|
Revision: 10436 http://sourceforge.net/p/phpwiki/code/10436 Author: vargenau Date: 2021-08-04 17:07:44 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: remove redundant methods, optimize code Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 16:57:05 UTC (rev 10435) +++ trunk/configurator.php 2021-08-04 17:07:44 UTC (rev 10436) @@ -1574,6 +1574,7 @@ var $description; var $prefix; var $jscheck; + var $values; function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') { @@ -1649,8 +1650,7 @@ function get_config($posted_value) { $d = stripHtml($this->_get_description()); - $d = str_replace("\n", "\n; ", $d) . $this->_get_config_line($posted_value) . "\n"; - return $d; + return str_replace("\n", "\n; ", $d) . $this->_get_config_line($posted_value) . "\n"; } function get_instructions($title) @@ -1895,15 +1895,6 @@ return sprintf("%s = %s", $this->get_config_item_name(), $value); } - function _get_config_line($posted_value) - { - return parent::_get_config_line($posted_value); - } - - function get_html() - { - return parent::get_html(); - } } class _define_selection_optional @@ -1964,10 +1955,6 @@ } } - function get_html() - { - return parent::get_html(); - } } class _define_password_optional @@ -2186,7 +2173,7 @@ if (strtolower(trim($value)) == 'false') $value = false; return sprintf("%s = %s", $this->get_config_item_name(), - (bool)$value ? 'true' : 'false'); + $value ? 'true' : 'false'); } //TODO: radiobuttons, no list @@ -2261,7 +2248,6 @@ function get_instructions($title) { $id = preg_replace("/\W/", "", $this->config_item_name); - $group_name = preg_replace("/\W/", "", $title); $i = '<tr class="header" id="'.$id.'">'."\n"; $i .= '<td class="part" style="width:100%;background-color:#eee;" colspan="2">'."\n"; $i .= "<h2>" . $title . "</h2>\n " . nl2p($this->_get_description()) . "\n"; @@ -2279,7 +2265,7 @@ function nl2p($text) { preg_match_all("@\s*(<pre>.*?</pre>|<dl>.*?</dl>|.*?(?=\n\n|<pre>|<dl>|$))@s", - $text, $m, PREG_PATTERN_ORDER); + $text, $m); $text = ''; foreach ($m[1] as $par) { @@ -2340,8 +2326,7 @@ // https://www.php.net/manual/en/function.htmlentities.php $trans = get_html_translation_table(HTML_ENTITIES); $trans = array_flip($trans); - $d = strtr($d, $trans); - return $d; + return strtr($d, $trans); } include_once(dirname(__FILE__) . "/lib/stdlib.php"); @@ -2389,7 +2374,7 @@ foreach ($properties as $option_name => $a) { $posted_value = stripslashes($posted[$a->config_item_name]); - $config .= $properties[$option_name]->get_config($posted_value); + $config .= $a->get_config($posted_value); } $config .= $end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 17:11:13
|
Revision: 10437 http://sourceforge.net/p/phpwiki/code/10437 Author: vargenau Date: 2021-08-04 17:11:11 +0000 (Wed, 04 Aug 2021) Log Message: ----------- Use https where possible Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 17:07:44 UTC (rev 10436) +++ trunk/configurator.php 2021-08-04 17:11:11 UTC (rev 10437) @@ -341,7 +341,7 @@ /** * The Configurator is a php script to aid in the configuration of PhpWiki. * Parts of this file were based on PHPWeather's configurator.php file. - * http://sourceforge.net/projects/phpweather/ + * https://sourceforge.net/projects/phpweather/ * * TO CHANGE THE CONFIGURATION OF YOUR PHPWIKI, DO *NOT* MODIFY THIS FILE! * more instructions go here @@ -1293,15 +1293,15 @@ these as appropriate."); $properties["COPYRIGHTPAGE URL"] = - new _define_commented_optional('COPYRIGHTPAGE_URL', "http://www.gnu.org/copyleft/gpl.html#SEC1", " + new _define_commented_optional('COPYRIGHTPAGE_URL', "https://www.gnu.org/copyleft/gpl.html#SEC1", " Other useful alternatives to consider: <pre> COPYRIGHTPAGE_TITLE = \"GNU Free Documentation License\" - COPYRIGHTPAGE_URL = \"http://www.gnu.org/copyleft/fdl.html\" + COPYRIGHTPAGE_URL = \"https://www.gnu.org/copyleft/fdl.html\" COPYRIGHTPAGE_TITLE = \"Creative Commons License 2.0\" - COPYRIGHTPAGE_URL = \"http://creativecommons.org/licenses/by/2.0/\"</pre> -See http://creativecommons.org/learn/licenses/ for variations"); + COPYRIGHTPAGE_URL = \"https://creativecommons.org/licenses/by/2.0/\"</pre> +See https://creativecommons.org/learn/licenses/ for variations"); $properties["AUTHORPAGE_TITLE"] = new _define_commented_optional('AUTHORPAGE_TITLE', "The PhpWiki Programming Team", " @@ -1368,11 +1368,8 @@ NB: If you are using Apache >= 2.0.30, then you may need to to use the directive \"AcceptPathInfo On\" in your Apache configuration file (or in an appropriate <.htaccess> file) for the short urls to work: -See http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo +See https://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo -See also http://phpwiki.sourceforge.net/phpwiki/PrettyWiki for more ideas -on prettifying your urls. - Default: PhpWiki will try to divine whether use of PATH_INFO is supported in by your webserver/PHP configuration, and will use PATH_INFO if it thinks that is possible."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-04 17:26:06
|
Revision: 10438 http://sourceforge.net/p/phpwiki/code/10438 Author: vargenau Date: 2021-08-04 17:26:05 +0000 (Wed, 04 Aug 2021) Log Message: ----------- configurator.php: remove unnecessary braces Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-04 17:11:11 UTC (rev 10437) +++ trunk/configurator.php 2021-08-04 17:26:05 UTC (rev 10438) @@ -733,7 +733,7 @@ $dsn_sqlpass = $properties["SQL Password"]->value(); $dsn_sqlhostorsock = $properties["SQL Database Host"]->value(); $dsn_sqldbname = $properties["SQL Database Name"]->value(); -$dsn_sqlstring = $dsn_sqltype . "://{$dsn_sqluser}:{$dsn_sqlpass}@{$dsn_sqlhostorsock}/{$dsn_sqldbname}"; +$dsn_sqlstring = $dsn_sqltype . "://".$dsn_sqluser.":".$dsn_sqlpass."@".$dsn_sqlhostorsock."/".$dsn_sqldbname; $properties["SQL dsn"] = new unchangeable_define("DATABASE_DSN", @@ -1826,7 +1826,7 @@ { $s = $this->get_config_item_header() . "<input type=\"text\" size=\"50\" name=\"" . $this->get_config_item_name() - . "\" value=\"" . $this->default_value . "\" {$this->jscheck} />"; + . "\" value=\"" . $this->default_value . "\" $this->jscheck />"; if (empty($this->default_value)) return $s . "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>"; else @@ -1987,7 +1987,7 @@ if (empty($value)) $encrypted = false; $s .= "<input type=\"" . ($encrypted ? "text" : "password") . "\" name=\"" . $this->get_config_item_name() - . "\" value=\"" . $value . "\" {$this->jscheck} />"; + . "\" value=\"" . $value . "\" $this->jscheck />"; return $s; } } @@ -2049,7 +2049,7 @@ if ($list_values) $list_values = join("\n", $list_values); $ta = $this->get_config_item_header(); - $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" {$this->jscheck}>"; + $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" $this->jscheck>"; $ta .= $list_values . "</textarea>"; $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; @@ -2088,7 +2088,7 @@ } $rows = max(3, $count + 1); $ta = $this->get_config_item_header(); - $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" {$this->jscheck}>"; + $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" $this->jscheck>"; $ta .= $list_values . "</textarea>"; $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; @@ -2125,7 +2125,7 @@ $list_values = join(" : \n", $this->default_value); $rows = max(3, count($this->default_value) + 1); $ta = $this->get_config_item_header(); - $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" {$this->jscheck}>"; + $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" $this->jscheck>"; $ta .= $list_values . "</textarea>"; $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; @@ -2178,7 +2178,7 @@ { $output = $this->get_config_item_header(); $name = $this->get_config_item_name(); - $output .= '<select name="' . $name . "\" {$this->jscheck}>\n"; + $output .= '<select name="' . $name . "\" $this->jscheck>\n"; $values = $this->values; $default_value = $this->default_value ? 'true' : 'false'; /* There can usually only be two options, there can be This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-09 08:25:50
|
Revision: 10458 http://sourceforge.net/p/phpwiki/code/10458 Author: vargenau Date: 2021-08-09 08:25:48 +0000 (Mon, 09 Aug 2021) Log Message: ----------- configurator.php: avoid backslashes Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-06 15:32:38 UTC (rev 10457) +++ trunk/configurator.php 2021-08-09 08:25:48 UTC (rev 10458) @@ -1658,7 +1658,7 @@ $size = strlen($this->default_value) > 45 ? 90 : 50; return $this->get_config_item_header() . "<input type=\"text\" size=\"$size\" name=\"" . $this->get_config_item_name() - . "\" value=\"" . htmlspecialchars($this->default_value) . "\" " . $this->jscheck . " />" + . '" value="' . htmlspecialchars($this->default_value) . '" ' . $this->jscheck . " />" . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; } } @@ -1779,7 +1779,7 @@ $size = strlen($this->default_value) > 45 ? 90 : 50; return $this->get_config_item_header() . "<input type=\"text\" size=\"$size\" name=\"" . htmlentities($this->get_config_item_name()) - . "\" value=\"" . htmlentities($this->default_value) . "\" $this->jscheck />" + . '" value="' . htmlentities($this->default_value) . '" ' . $this->jscheck . " />" . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; } } @@ -1823,7 +1823,7 @@ { $s = $this->get_config_item_header() . "<input type=\"text\" size=\"50\" name=\"" . $this->get_config_item_name() - . "\" value=\"" . $this->default_value . "\" $this->jscheck />"; + . '" value="' . $this->default_value . '" ' . $this->jscheck . " />"; if (empty($this->default_value)) return $s . "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>"; else @@ -1983,8 +1983,8 @@ $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 />"; + $s .= '<input type="' . ($encrypted ? "text" : "password") . '" name="' . $this->get_config_item_name() + . '" value="' . $value . '" ' . $this->jscheck . " />"; return $s; } } @@ -2015,8 +2015,8 @@ $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 />" + $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($value)) $s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>"; @@ -2046,7 +2046,8 @@ if ($list_values) $list_values = join("\n", $list_values); $ta = $this->get_config_item_header(); - $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" $this->jscheck>"; + $ta .= '<textarea cols="18" rows="' . $rows . '" name="'; + $ta .= $this->get_config_item_name() . '" ' . $this->jscheck . '>'; $ta .= $list_values . "</textarea>"; $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; @@ -2085,7 +2086,8 @@ } $rows = max(3, $count + 1); $ta = $this->get_config_item_header(); - $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" $this->jscheck>"; + $ta .= '<textarea cols="18" rows="' . $rows . '" name="'; + $ta .= $this->get_config_item_name() . '" ' . $this->jscheck . '>'; $ta .= $list_values . "</textarea>"; $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; @@ -2122,7 +2124,8 @@ $list_values = join(" : \n", $this->default_value); $rows = max(3, count($this->default_value) + 1); $ta = $this->get_config_item_header(); - $ta .= "<textarea cols=\"18\" rows=\"" . $rows . "\" name=\"" . $this->get_config_item_name() . "\" $this->jscheck>"; + $ta .= '<textarea cols="18" rows="' . $rows . '" name="'; + $ta .= $this->get_config_item_name() . '" ' . $this->jscheck . '>'; $ta .= $list_values . "</textarea>"; $ta .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; return $ta; @@ -2175,7 +2178,7 @@ { $output = $this->get_config_item_header(); $name = $this->get_config_item_name(); - $output .= '<select name="' . $name . "\" $this->jscheck>\n"; + $output .= '<select name="' . $name . '" ' . $this->jscheck . ">\n"; $values = $this->values; $default_value = $this->default_value ? 'true' : 'false'; /* There can usually only be two options, there can be This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-10 10:04:33
|
Revision: 10475 http://sourceforge.net/p/phpwiki/code/10475 Author: vargenau Date: 2021-08-10 10:04:30 +0000 (Tue, 10 Aug 2021) Log Message: ----------- configurator.php: add missing configs DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS, ENABLE_AJAX, ENABLE_MAILNOTIFY, ENABLE_RECENTCHANGESBOX, ENABLE_PAGE_PUBLIC, READONLY, LDAP_SEARCH_FILTER, ENABLE_RATEIT Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-10 09:33:35 UTC (rev 10474) +++ trunk/configurator.php 2021-08-10 10:04:30 UTC (rev 10475) @@ -468,9 +468,15 @@ $properties["NUM_SPAM_LINKS"] = new numeric_define_optional('NUM_SPAM_LINKS'); +$properties["DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS"] = + new boolean_define_commented_optional('DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS'); + $properties["GOOGLE_LINKS_NOFOLLOW"] = new boolean_define_commented_optional('GOOGLE_LINKS_NOFOLLOW'); +$properties["ENABLE_AJAX"] = + new boolean_define_commented_optional('ENABLE_AJAX'); + $properties["ENABLE_DISCUSSION_LINK"] = new boolean_define_commented_optional('ENABLE_DISCUSSION_LINK'); @@ -486,6 +492,18 @@ $properties["ENABLE_SEARCHHIGHLIGHT"] = new boolean_define_commented_optional('ENABLE_SEARCHHIGHLIGHT'); +$properties["ENABLE_MAILNOTIFY"] = + new boolean_define_commented_optional('ENABLE_MAILNOTIFY'); + +$properties["ENABLE_RECENTCHANGESBOX"] = + new boolean_define_commented_optional('ENABLE_RECENTCHANGESBOX'); + +$properties["ENABLE_PAGE_PUBLIC"] = + new boolean_define_commented_optional('ENABLE_PAGE_PUBLIC'); + +$properties["READONLY"] = + new boolean_define_commented_optional('READONLY'); + $properties["Part One"] = new part('_part1', $SEPARATOR . "\n", " Part One: Authentication and security settings. See Part Three for more."); @@ -1084,6 +1102,12 @@ e.g.: LDAP_SEARCH_FIELD = sAMAccountName"); +$properties["LDAP SEARCH FILTER"] = + new _define_optional('LDAP_SEARCH_FILTER', "(uid=\$userid)", " +If you want to check against special attributes, such as external partner, employee status. +Default: undefined. This overrides LDAP_SEARCH_FIELD. +Example (&(uid=\$userid)(employeeType=y)(myCompany=My Company*)(!(myCompany=My Company Partner*)))"); + $properties["LDAP OU USERS"] = new _define_optional('LDAP_OU_USERS', "ou=Users", " If you have an organizational unit for all users, define it here. @@ -1474,6 +1498,8 @@ new _define_commented_optional('BABYCART_PATH', "/usr/local/bin/babycart"); $properties["GOOGLE_LICENSE_KEY"] = new _define_commented_optional('GOOGLE_LICENSE_KEY'); +$properties["ENABLE_RATEIT"] = + new boolean_define_commented_optional('ENABLE_RATEIT'); $properties["RATEIT_IMGPREFIX"] = new _define_commented_optional('RATEIT_IMGPREFIX'); //BStar $properties["GRAPHVIZ_EXE"] = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2025-02-19 10:24:24
|
Revision: 11130 http://sourceforge.net/p/phpwiki/code/11130 Author: vargenau Date: 2025-02-19 10:24:23 +0000 (Wed, 19 Feb 2025) Log Message: ----------- Spelling Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2025-02-19 10:15:46 UTC (rev 11129) +++ trunk/configurator.php 2025-02-19 10:24:23 UTC (rev 11130) @@ -143,7 +143,7 @@ unset($_SERVER['PHP_AUTH_USER']); unset($_SERVER['PHP_AUTH_PW']); - trigger_error("Permission denied. Existing ADMIN_USER credentials required. Alteranely rename config.ini to generate a new one.", E_USER_ERROR); + trigger_error("Permission denied. Existing ADMIN_USER credentials required. Alternatively rename config.ini to generate a new one.", E_USER_ERROR); exit(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2025-02-22 08:17:27
|
Revision: 11159 http://sourceforge.net/p/phpwiki/code/11159 Author: carstenklapp Date: 2025-02-22 08:17:25 +0000 (Sat, 22 Feb 2025) Log Message: ----------- Fixed boolean config lines are now successfully commented when default is false and selection is also false. Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2025-02-22 04:32:48 UTC (rev 11158) +++ trunk/configurator.php 2025-02-22 08:17:25 UTC (rev 11159) @@ -467,7 +467,7 @@ new boolean_define_commented_optional('ENABLE_WYSIWYG'); $properties["WYSIWYG_BACKEND"] = - new _define_selection( + new _define_selection_optional( 'WYSIWYG_BACKEND', array('Wikiwyg' => 'Wikiwyg', 'tinymce' => 'tinymce', @@ -497,7 +497,7 @@ new boolean_define_commented_optional('ENABLE_SPAMASSASSIN'); $properties["ENABLE_SPAMBLOCKLIST"] = - new boolean_define_optional('ENABLE_SPAMBLOCKLIST'); + new boolean_define_commented_optional('ENABLE_SPAMBLOCKLIST'); $properties["NUM_SPAM_LINKS"] = new numeric_define_optional('NUM_SPAM_LINKS'); @@ -581,7 +581,7 @@ new numeric_define_optional('MAX_PAGENAME_LENGTH'); $properties["Reverse DNS"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'ENABLE_REVERSE_DNS', array('true' => "true. perform additional reverse dns lookups", 'false' => "false. just record the address as given by the httpd server") @@ -588,7 +588,7 @@ ); $properties["ZIP Dump Authentication"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'ZIPDUMP_AUTH', array('false' => "false. Everyone may download zip dumps", 'true' => "true. Only admin may download zip dumps") @@ -885,7 +885,7 @@ "); $properties["Publicly viewable"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'ALLOW_ANON_USER', array('true' => "true. Permit anonymous view. (Default)", 'false' => "false. Force login even on view (strictly private)"), @@ -894,7 +894,7 @@ ); $properties["Allow anonymous edit"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'ALLOW_ANON_EDIT', array('true' => "true. Permit anonymous users to edit. (Default)", 'false' => "false. Force login on edit (moderately locked)"), @@ -903,7 +903,7 @@ ); $properties["Allow Bogo Login"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'ALLOW_BOGO_LOGIN', array('true' => "true. Users may Sign In with any WikiWord, without password. (Default)", 'false' => "false. Require stricter authentication."), @@ -913,7 +913,7 @@ ); $properties["Allow User Passwords"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'ALLOW_USER_PASSWORDS', array('true' => "True user authentication with password checking. (Default)", 'false' => "false. Ignore authentication settings below."), @@ -960,7 +960,7 @@ </pre>"); $properties["ENABLE_AUTH_OPENID"] = - new boolean_define('ENABLE_AUTH_OPENID'); + new boolean_define_commented_optional('ENABLE_AUTH_OPENID'); $properties["PASSWORD_LENGTH_MINIMUM"] = new numeric_define_optional('PASSWORD_LENGTH_MINIMUM', PASSWORD_LENGTH_MINIMUM); @@ -1064,10 +1064,10 @@ Check to see if the supplied username/password pair is OK Plaintext passwords: (DBAUTH_AUTH_CRYPT_METHOD = plain)<br /> -; DBAUTH_AUTH_CHECK = \"SELECT IF(passwd='\$password',1,0) AS ok FROM user WHERE userid='\$userid'\" + DBAUTH_AUTH_CHECK = \"SELECT IF(passwd='\$password',1,0) AS ok FROM user WHERE userid='\$userid'\" database-hashed passwords (more secure):<br /> -; DBAUTH_AUTH_CHECK = \"SELECT IF(passwd=PASSWORD('\$password'),1,0) AS ok FROM user WHERE userid='\$userid'\""); + DBAUTH_AUTH_CHECK = \"SELECT IF(passwd=PASSWORD('\$password'),1,0) AS ok FROM user WHERE userid='\$userid'\""); $properties["Crypt Method"] = new _define_selection_optional( @@ -1079,8 +1079,8 @@ to get the password out of the database with a simple SELECT query, and specify DBAUTH_AUTH_USER_EXISTS and DBAUTH_AUTH_CRYPT_METHOD: -; DBAUTH_AUTH_CHECK = \"SELECT passwd FROM user where userid='\$userid'\" <br /> -; DBAUTH_AUTH_CRYPT_METHOD = crypt" + DBAUTH_AUTH_CHECK = \"SELECT passwd FROM user where userid='\$userid'\" <br /> + DBAUTH_AUTH_CRYPT_METHOD = crypt" ); $properties["Update the user's authentication credential"] = @@ -1376,7 +1376,7 @@ by INTERWIKI_MAP_FILE (if any) will be used."); $properties["WARN_NONPUBLIC_INTERWIKIMAP"] = - new boolean_define('WARN_NONPUBLIC_INTERWIKIMAP'); + new boolean_define_commented_optional('WARN_NONPUBLIC_INTERWIKIMAP'); $properties["Keyword Link Regexp"] = new _define_optional('KEYWORDS', '\"Category* OR Topic*\"', " @@ -1418,16 +1418,16 @@ Default Author URL"); $properties["TOC_FULL_SYNTAX"] = - new boolean_define_optional('TOC_FULL_SYNTAX'); + new boolean_define_commented_optional('TOC_FULL_SYNTAX'); $properties["ENABLE_MARKUP_COLOR"] = - new boolean_define_optional('ENABLE_MARKUP_COLOR'); + new boolean_define_commented_optional('ENABLE_MARKUP_COLOR'); $properties["DISABLE_MARKUP_WIKIWORD"] = - new boolean_define_optional('DISABLE_MARKUP_WIKIWORD'); + new boolean_define_commented_optional('DISABLE_MARKUP_WIKIWORD'); $properties["ENABLE_MARKUP_DIVSPAN"] = - new boolean_define_optional('ENABLE_MARKUP_DIVSPAN'); + new boolean_define_commented_optional('ENABLE_MARKUP_DIVSPAN'); /////////////////// @@ -1546,7 +1546,7 @@ "); $properties["Strict Mailable Pagedumps"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'STRICT_MAILABLE_PAGEDUMPS', array('false' => "binary", 'true' => "quoted-printable") @@ -1628,7 +1628,7 @@ "); $properties["pear Cache USECACHE"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'PLUGIN_CACHED_USECACHE', array('true' => 'Enabled', 'false' => 'Disabled'), @@ -1662,7 +1662,7 @@ new numeric_define_optional('PLUGIN_CACHED_MAXARGLEN', "1000", " max. generated url length."); $properties["pear Cache FORCE_SYNCMAP"] = - new boolean_define_optional( + new boolean_define_commented_optional( 'PLUGIN_CACHED_FORCE_SYNCMAP', array('true' => 'Enabled', 'false' => 'Disabled'), @@ -1953,6 +1953,21 @@ class _define_optional extends _define { + public function _get_config_line($posted_value) + { + $n = ""; + if ($this->description) { + $n = "\n"; + } + if ($posted_value == $this->default_value) { + return "$n;" . $this->_config_format($posted_value); + } + if ($posted_value == '') { + return "$n;" . $this->_config_format(""); + } else { + return "$n" . $this->_config_format($posted_value); + } + } } class _define_notempty extends _define @@ -2390,12 +2405,16 @@ } else { $default_value = $this->default_value; } + $default_value = $default_value ? true : 'false'; //FIXME: ugly hack to cast booleans around, otherwise false will never get commented even though it is default false if ($posted_value == $default_value) { return "$n;" . $this->_config_format($posted_value); + return "$n; DEBUG: equal dv=$default_value".gettype($default_value)." pv=" .gettype($posted_value). $this->_config_format($posted_value); } elseif ($posted_value == '') { return "$n;" . $this->_config_format('false'); + return "$n; DEBUG: posted is empty " . $this->_config_format('false'); } else { return "$n" . $this->_config_format($posted_value); + return "$n DEBUG else dv=$default_value".gettype($default_value)." pv=" .gettype($posted_value). $this->_config_format($posted_value); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2025-02-23 08:56:35
|
Revision: 11162 http://sourceforge.net/p/phpwiki/code/11162 Author: carstenklapp Date: 2025-02-23 08:56:33 +0000 (Sun, 23 Feb 2025) Log Message: ----------- New class _define_optional_suggestion for calculated paths that differ from the defaults. New spot for defining ADMIN_USER & pwd. Improved instructions. Better handling of default directories and calculate different paths for windows. Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2025-02-23 03:28:58 UTC (rev 11161) +++ trunk/configurator.php 2025-02-23 08:56:33 UTC (rev 11162) @@ -1,7 +1,4 @@ <?php -// defining these 2 here is a temporary fix -if (!defined('ADMIN_USER')) define('ADMIN_USER', ''); -if (!defined('ADMIN_PASSWD')) define('ADMIN_PASSWD', ''); /** * Copyright © 2002,2003,2005,2008-2010 $ThePhpWikiProgrammingTeam * Copyright © 2002 Martin Geisler <gim...@gi...> @@ -154,6 +151,8 @@ // If config.ini exists, we require ADMIN_USER access by faking HttpAuth. // So nobody can see or reset the password(s). if (file_exists($fs_config_file)) { + exit("Configuration config file \"$fs_config_file\" already exists.\n" + . "Cannot continue: You have to fix that manually."); // Require admin user if (!defined('ADMIN_USER') or !defined('ADMIN_PASSWD')) { if (!function_exists("IniConfig")) { @@ -361,14 +360,23 @@ <p>On any configuration problems, please edit the resulting config.ini manually. If one is not created, copy config-dist.ini to config.ini and edit that.</p> - <p>This file currently has problems with:</p> + <p>This file currently has the following issues:</p> <ul> - <li>Handling Windows pathnames (use forward slashes /)</li> - <li>Editing existing config.ini file is currently not possible. Rename it - to generate a new one, or edit it manually.</li> - <li>Php crypt() function fails sometimes and returns *0 or *1 as the - password. In that case run passencrypt.php to generate a new password - and manually paste it into config.ini.</li> +<?php if(isWindows()) { ?> + <li>For Windows pathnames, use forward slashes / instead. Any \ will be + converted.</li> + <li>Default paths will be suggested based on the Windows TEMP dir instead + of /tmp.</li> +<?php } ?> + <li>Using the suggested temporary dirs will get you up and running quickly + but you will lose your data sooner or later if you do not change them + to more permanent directories!</li> + <li>Editing an existing config.ini file using this configurator is + currently not possible. Rename or delete the file to generate a new + one, or edit it manually.</li> + <li>The Php crypt() function fails sometimes and returns *0 or *1 as the + password. In that case run passencrypt.php to generate a new + ADMIN_PASSWD and manually paste it into config.ini.</li> </ul> </div> @@ -429,6 +437,20 @@ // for x in `perl -ne 'print $1,"\n" if /^;(\w+) =/' config/config-dist.ini`; do \ // grep \'$x\' configurator.php >/dev/null || echo $x ; done +$defaulttempdir = "/tmp"; +$defaultenvtempdir = !empty($_ENV['TEMP']) ? $_ENV['TEMP'] : $defaulttempdir; + +if (defined('TEMP_DIR')) { + $guessedtempdir = TEMP_DIR; + $guessedtempdir = checkMassageWinPath($guessedtempdir); + if (isWindows() && (TEMP_DIR == $defaulttempdir)) { //try harder for windows + $guessedtempdir = $defaultenvtempdir; + } +} else { + $guessedtempdir = $defaulttempdir; +} +$guessedtempdir = checkMassageWinPath($guessedtempdir); + $properties["Part Zero"] = new part('_part0', $SEPARATOR . "\n", " Part Zero: Latest Development and Tricky Options"); @@ -436,18 +458,12 @@ if (defined('INCLUDE_PATH')) { $include_path = INCLUDE_PATH; } else { - if (substr(PHP_OS, 0, 3) == 'WIN') { - $include_path = dirname(__FILE__) . ';' . ini_get('include_path'); - if (strchr(ini_get('include_path'), '/')) { - $include_path = strtr($include_path, '\\', '/'); - } - } else { - $include_path = dirname(__FILE__) . ':' . ini_get('include_path'); - } + // PATH_SEPARATOR is ; on windows, : on others + $include_path = dirname(__FILE__) . PATH_SEPARATOR . ini_get('include_path'); } - +$include_path = checkMassageWinPath($include_path); $properties["PHP include_path"] = - new _define('INCLUDE_PATH', $include_path); + new _define_optional_suggestion('INCLUDE_PATH', $include_path); // TODO: Convert this to a checkbox row as in tests/unit/test.php $properties["DEBUG"] = @@ -545,6 +561,9 @@ $properties["Wiki Name"] = new _define_optional('WIKI_NAME', WIKI_NAME); +if (!defined('ADMIN_USER')) { + define('ADMIN_USER', ''); +} $properties["Admin Username"] = new _define_notempty( 'ADMIN_USER', @@ -554,6 +573,9 @@ "onchange=\"validate_ereg('Sorry, ADMIN_USER cannot be empty.', '^.+$', 'ADMIN_USER', this);\"" ); +if (!defined('ADMIN_PASSWD')) { + define('ADMIN_PASSWD', ''); +} $properties["Admin Password"] = new _define_password( 'ADMIN_PASSWD', @@ -574,7 +596,7 @@ new boolean_define( 'ENCRYPTED_PASSWD', array('true' => "true. use crypt for all passwords", - 'false' => "false. use plaintest passwords (not recommended)") + 'false' => "false. use plaintext passwords (not recommended)") ); $properties["MAX_PAGENAME_LENGTH"] = @@ -706,8 +728,21 @@ $properties["COOKIE_DOMAIN"] = new _define_commented_optional('COOKIE_DOMAIN', COOKIE_DOMAIN); +//fixme +$session_save_path = defined('SESSION_SAVE_PATH') ? SESSION_SAVE_PATH : ini_get('session.save_path'); +$session_save_path = checkMassageWinPath($session_save_path); +if (defined('SESSION_SAVE_PATH')) { + $session_save_path = SESSION_SAVE_PATH; + $session_save_path = checkMassageWinPath($session_save_path); + if (isWindows() && (SESSION_SAVE_PATH == $defaulttempdir)) { //try harder for windows + $session_save_path = $defaultenvtempdir; + } +} else { + $session_save_path = $defaulttempdir; +} +$session_save_path = checkMassageWinPath($session_save_path); $properties["Path for PHP Session Support"] = - new _define_optional('SESSION_SAVE_PATH', defined('SESSION_SAVE_PATH') ? SESSION_SAVE_PATH : ini_get('session.save_path')); + new _define_optional_suggestion('SESSION_SAVE_PATH', $session_save_path); $properties["Force PHP Database Sessions"] = new boolean_define_commented_optional( @@ -848,10 +883,17 @@ A word of warning - any prefix defined above will be prepended to whatever is given here. "); -//TODO: $TEMP -$temp = !empty($_ENV['TEMP']) ? $_ENV['TEMP'] : "/tmp"; +if (defined('DATABASE_DIRECTORY')) { + $database_dir = DATABASE_DIRECTORY; + if (isWindows() && (DATABASE_DIRECTORY == $defaulttempdir)) { //try harder for windows + $database_dir = $defaultenvtempdir; + } +} else { + $database_dir = $guessedtempdir; +} +$database_dir = checkMassageWinPath($database_dir); $properties["dba directory"] = - new _define("DATABASE_DIRECTORY", $temp); + new _define_optional_suggestion("DATABASE_DIRECTORY", $database_dir); // TODO: list the available methods $properties["dba handler"] = @@ -1053,7 +1095,7 @@ A database DSN to connect to. Defaults to the DSN specified for the Wiki as a whole."); $properties["User Exists Query"] = - new _define('DBAUTH_AUTH_USER_EXISTS', "SELECT userid FROM user WHERE userid='\$userid'", " + new _define_optional('DBAUTH_AUTH_USER_EXISTS', "SELECT userid FROM user WHERE userid='\$userid'", " USER/PASSWORD queries: For USER_AUTH_POLICY=strict and the Db method is required"); @@ -1465,8 +1507,14 @@ $properties["Data Path"] = new _define_commented_optional('DATA_PATH', dirname($scriptname)); +if (defined('PHPWIKI_DIR')) { + $phpwiki_dir = PHPWIKI_DIR; +} else { + $phpwiki_dir = dirname(__FILE__); +} +$phpwiki_dir = checkMassageWinPath($phpwiki_dir); $properties["PhpWiki Install Directory"] = - new _define_commented_optional('PHPWIKI_DIR', dirname(__FILE__)); + new _define_commented_optional('PHPWIKI_DIR', $phpwiki_dir); $properties["Use PATH_INFO"] = new _define_selection_optional_commented( @@ -1516,14 +1564,13 @@ "); $upload_file_path = defined('UPLOAD_FILE_PATH') ? UPLOAD_FILE_PATH : getUploadFilePath(); -new _define_optional('UPLOAD_FILE_PATH', $temp); +new _define_optional('UPLOAD_FILE_PATH', $upload_file_path); $upload_data_path = defined('UPLOAD_DATA_PATH') ? UPLOAD_DATA_PATH : getUploadDataPath(); -new _define_optional('UPLOAD_DATA_PATH', $temp); +new _define_optional('UPLOAD_DATA_PATH', $upload_data_path); -$temp = !empty($_ENV['TEMP']) ? $_ENV['TEMP'] : "/tmp"; $properties["TEMP_DIR"] = - new _define_optional('TEMP_DIR', $temp); + new _define_optional_suggestion('TEMP_DIR', $guessedtempdir); $properties["Allowed Load"] = new _define_commented_optional( @@ -1552,11 +1599,14 @@ 'true' => "quoted-printable") ); + +$guesseddumpdir = checkWinAlternatePath('DEFAULT_DUMP_DIR', "wikidump", $guessedtempdir, $defaulttempdir); $properties["Default local Dump Directory"] = - new _define_optional('DEFAULT_DUMP_DIR'); + new _define_optional_suggestion('DEFAULT_DUMP_DIR', $guesseddumpdir); +$guessedhtmldumpdir = checkWinAlternatePath('HTML_DUMP_DIR', "wikidumphtml", $guessedtempdir, $defaulttempdir); $properties["Default local HTML Dump Directory"] = - new _define_optional('HTML_DUMP_DIR'); + new _define_optional_suggestion('HTML_DUMP_DIR', $guessedhtmldumpdir); $properties["HTML Dump Filename Suffix"] = new _define_optional('HTML_DUMP_SUFFIX'); @@ -1606,6 +1656,7 @@ $ttfont = 'luximr'; // This is the only what sourceforge offered. //$ttfont = 'Helvetica'; } +$ttfont = checkMassageWinPath($ttfont); $properties["TTFONT"] = new _define_commented_optional('TTFONT', $ttfont); $properties["VISUALWIKIFONT"] = @@ -1644,9 +1695,11 @@ db, trifile and imgfile might be supported, but you must hack that by yourself." ); +$guessedcachedir = checkWinAlternatePath('PLUGIN_CACHED_CACHE_DIR', "cache", $guessedtempdir, $defaulttempdir); $properties["pear Cache cache directory"] = - new _define_commented_optional('PLUGIN_CACHED_CACHE_DIR', "/tmp/cache", " + new _define_optional_suggestion('PLUGIN_CACHED_CACHE_DIR', $guessedcachedir, " Should be writable to the webserver."); + $properties["pear Cache Filename Prefix"] = new _define_optional('PLUGIN_CACHED_FILENAME_PREFIX', "phpwiki", ""); $properties["pear Cache HIGHWATER"] = @@ -1672,7 +1725,7 @@ new list_define('PLUGIN_CACHED_IMGTYPES', "png|gif|gd|gd2|jpeg|wbmp|xbm|xpm", " Handle those image types via GD handles. Check your GD supported image types."); -$end = "\n" . $SEPARATOR . "\n"; +$end = "\n" . $SEPARATOR . "\n;eof\n"; // performance hack text_from_dist("_MAGIC_CLOSE_FILE"); @@ -1707,7 +1760,7 @@ $this->description = $description; if (defined($config_item_name) and !preg_match("/(selection|boolean)/", get_class($this)) - and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH|TEMP_DIR)$/", $config_item_name) + and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH|zTEMP_DIR)$/", $config_item_name) ) { $this->default_value = constant($config_item_name); } // ignore given default value @@ -1959,12 +2012,16 @@ if ($this->description) { $n = "\n"; } + $default_value = $this->default_value; if ($posted_value == $this->default_value) { + //return "$n; DEBUG: equal dv=$default_value".gettype($default_value)." pv=" .gettype($posted_value). $this->_config_format($posted_value); return "$n;" . $this->_config_format($posted_value); } if ($posted_value == '') { - return "$n;" . $this->_config_format(""); + //return "$n; DEBUG: posted is empty " . $this->_config_format('false'); + return "$n;" . $this->_config_format($default_value); } else { + //return "$n DEBUG else dv=$default_value".gettype($default_value)." pv=" .gettype($posted_value). $this->_config_format($posted_value); return "$n" . $this->_config_format($posted_value); } } @@ -1985,6 +2042,62 @@ } } + +class _define_optional_suggestion extends _define_optional +{ + // This class expects config_item_name to be defined in config-default.ini + // but a calculated or suggested value will be passed in the default_value + // used for windows variables. the suggested value will be used in the + // html form instead of default_value + public $config_item_name; + public $default_value; + public $description; + public $prefix; + public $jscheck; + public $values; + public $suggested_value; + + public function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') + { + $this->config_item_name = $config_item_name; + if (!$description) { + $description = text_from_dist($config_item_name); + } + $this->description = $description; + if (defined($config_item_name) + and !preg_match("/(selection|boolean)/", get_class($this)) + and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH|zTEMP_DIR)$/", $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; + } + $this->suggested_value = $default_value; + $this->jscheck = $jscheck; + if (preg_match("/variable/i", get_class($this))) { + $this->prefix = "\$"; + } elseif (preg_match("/ini_set/i", get_class($this))) { + $this->prefix = "ini_get: "; + } else { + $this->prefix = ""; + } + } + + public function get_html() + { + $size = strlen($this->suggested_value) > 45 ? 90 : 50; + return $this->get_config_item_header() . + "<input type=\"text\" size=\"$size\" name=\"" . $this->get_config_item_name() + . '" value="' . htmlspecialchars($this->suggested_value) . '" ' . $this->jscheck . " />" + . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>"; + } +} + + + class numeric_define extends _define { public function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '') @@ -2553,6 +2666,36 @@ return ($newpass); } +//// +// Function to replace windows slashes with forward slashes if necessary +// https://stackoverflow.com/questions/5879043/php-script-detect-whether-running-under-linux-or-windows +function checkMassageWinPath($path) { + if (DIRECTORY_SEPARATOR === '\\') { + return strtr($path, '\\', '/'); + } + return $path; +} + +// builds a directory name based off of /tmp checking if windows or other +function checkWinAlternatePath($defined_name, $subdir, $guessedtempdir, $defaulttempdir) { + + //echo ( "checkWinAlternatePath($defined_name, $subdir, $guessedtempdir, $defaulttempdir \n<br />" ); + if (defined($defined_name)) { + $dirname = constant($defined_name); + //echo ("dirname=".$dirname."\n<br />"); + if (isWindows() && ($dirname == $defaulttempdir . "/".$subdir)) { //try harder for windows + $dirname = $guessedtempdir. "/".$subdir; + //echo ("iswindows ".$dirname."\n<br />"); + } + } else { + $dirname = $guessedtempdir. "/".$subdir; + } + $dirname = checkMassageWinPath($dirname); + //echo (" exiting ".$dirname."\n<br />\n<br />"); + return $dirname; +} + + // end of class definitions ///////////////////////////// // begin auto generation code This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2025-02-27 22:17:49
|
Revision: 11164 http://sourceforge.net/p/phpwiki/code/11164 Author: carstenklapp Date: 2025-02-27 22:17:48 +0000 (Thu, 27 Feb 2025) Log Message: ----------- Fixed my lazy coding Modified Paths: -------------- trunk/configurator.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2025-02-23 22:47:52 UTC (rev 11163) +++ trunk/configurator.php 2025-02-27 22:17:48 UTC (rev 11164) @@ -1760,7 +1760,7 @@ $this->description = $description; if (defined($config_item_name) and !preg_match("/(selection|boolean)/", get_class($this)) - and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH|zTEMP_DIR)$/", $config_item_name) + and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH)$/", $config_item_name) ) { $this->default_value = constant($config_item_name); } // ignore given default value @@ -2066,7 +2066,7 @@ $this->description = $description; if (defined($config_item_name) and !preg_match("/(selection|boolean)/", get_class($this)) - and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH|zTEMP_DIR)$/", $config_item_name) + and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH)$/", $config_item_name) ) { $this->default_value = constant($config_item_name); } // ignore given default value This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |