From b3f9dfb54e46e63d14e605ea88605b6bc1ffa17d Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 27 Feb 2008 08:11:17 +0000 Subject: Allow to skip the config step if config files already exist --- installer/check.php | 5 ++--- installer/config.php | 18 +++++++++++------- installer/index.php | 5 +++-- installer/rcube_install.php | 3 +++ installer/styles.css | 17 +++++++++++------ installer/test.php | 3 --- 6 files changed, 30 insertions(+), 21 deletions(-) diff --git a/installer/check.php b/installer/check.php index 9f54d8f8f..06eae4236 100644 --- a/installer/check.php +++ b/installer/check.php @@ -1,3 +1,4 @@ +
'pcre', 'Session' => 'session', 'Sockets' => 'sockets'); @@ -28,11 +29,9 @@ $source_urls = array( 'Mail_mime' => 'http://pear.php.net/package/Mail_mime' ); +echo ''; ?> - - -

Checking PHP version

load_config(); +// also load the default config to fill in the fields $RCI->load_defaults(); if (!empty($_POST['submit'])) { @@ -235,12 +235,16 @@ echo $select_dbba->show($RCI->getprop('db_backend'));
getprop('default_host')); +$default_hosts = (array)$RCI->getprop('default_host'); $text_imaphost = new textfield(array('name' => '_default_host[]', 'size' => 30)); -for ($i=0; $i < count($default_hosts); $i++) { - echo '
' . $text_imaphost->show($default_hosts[$i]); - if ($i > 0) +$i = 0; +foreach ($default_hosts as $key => $name) { + if (empty($name)) + continue; + $host = is_numeric($key) ? $name : $key; + echo '
' . $text_imaphost->show($host); + if ($i++ > 0) echo 'remove'; echo '
'; } @@ -249,7 +253,7 @@ for ($i=0; $i < count($default_hosts); $i++) {
add
-

Leave blank to show a textbox at login

+

Leave blank to show a textbox at login. To use SSL/IMAPS connection, type ssl://hostname

default_port
@@ -431,7 +435,7 @@ echo $input_locale->show($RCI->getprop('locale_string')); failures ? 'disabled' : '') . ' />

'; +echo '

failures ? 'disabled' : '') . ' />

'; ?> diff --git a/installer/index.php b/installer/index.php index aab406e98..a5225eb54 100644 --- a/installer/index.php +++ b/installer/index.php @@ -34,7 +34,8 @@ require_once 'rcube_install.php'; $RCI = rcube_install::get_instance(); - + $RCI->load_config(); + ?>
    @@ -42,7 +43,7 @@ foreach (array('Check environment', 'Create config', 'Test config') as $i => $item) { $j = $i + 1; - $link = $RCI->step > $j ? '' . Q($item) . '' : Q($item); + $link = ($RCI->step >= $j || $RCI->configured) ? '' . Q($item) . '' : Q($item); printf('
  1. %s
  2. ', $j+1, $RCI->step > $j ? ' passed' : ($RCI->step == $j ? ' current' : ''), $link); } ?> diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 8ff220357..44d453153 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -26,6 +26,7 @@ class rcube_install var $step; var $failures = 0; var $config = array(); + var $configured = false; var $last_error = null; var $email_pattern = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9])'; @@ -64,7 +65,9 @@ class rcube_install */ function load_config() { + $this->config = array(); $this->_load_config('.php'); + $this->configured = !empty($this->config); } /** diff --git a/installer/styles.css b/installer/styles.css index 0260b6741..1e91ec2c0 100644 --- a/installer/styles.css +++ b/installer/styles.css @@ -88,19 +88,24 @@ body, td, th, div, p { padding: 1em 5em 1em 0.2em; } +#progress li a { + color: #999; + text-decoration: none; +} + +#progress li a:hover { + text-decoration: underline; +} + #progress li.current { color: #000; font-weight: bold; } #progress li.passed, -#progress li.passed a { +#progress li.passed a, +#progress li.current a { color: #333; - text-decoration: none; -} - -#progress li.passed a:hover { - text-decoration: underline; } fieldset { diff --git a/installer/test.php b/installer/test.php index 0f499eba3..d0cb77716 100644 --- a/installer/test.php +++ b/installer/test.php @@ -3,9 +3,6 @@

    Check config files

    load_config(); - $read_main = is_readable('../config/main.inc.php'); $read_db = is_readable('../config/db.inc.php'); -- cgit v1.2.3