Show
Ignore:
Timestamp:
08/30/08 12:49:26 (4 months ago)
Author:
vollmerk
Message:

improve error reporting on install and add in use existing database option

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/3.4/install.php

    r1634 r1711  
    6262if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } 
    6363else { $http_type = "http://"; } 
    64 $php_self = $http_type . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/^\/(.+\.php)\/?.*/","$1",$_SERVER['PHP_SELF']); 
     64define('WEB_PATH',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/' . basename($_SERVER['PHP_SELF']));   
     65define('WEB_ROOT',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));  
    6566 
    6667/* Catch the Current Action */ 
     
    7677                $charset  = $_REQUEST['charset']; 
    7778                 
    78                 header ("Location: " . $php_self . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset"); 
     79                header ("Location: " . WEB_PATH . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset"); 
    7980                 
    8081        break; 
     
    132133                } 
    133134 
    134                 if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } 
    135                 else { $http_type = "http://"; } 
    136  
    137                 $web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; 
    138  
    139                 header ("Location: " . $web_path . "/login.php"); 
     135                header ("Location: " . WEB_ROOT . "/login.php"); 
    140136        break;   
    141137        case 'show_create_account': 
     
    145141                /* Make sure we've got a valid config file */ 
    146142                if (!check_config_values($results)) {  
     143                        Error::add('general',_('Error: Config file not found or Unreadable'));  
    147144                        require_once Config::get('prefix') . '/templates/show_install_config.inc.php';  
    148145                        break; 
     
    212209                /* Do some basic tests here... most common error, no mysql */ 
    213210                if (!function_exists('mysql_query')) {  
    214                         header ("Location: test.php"); 
     211                        header ("Location: " . WEB_PATH . "/test.php"); 
    215212                } 
    216213                $htmllang = "en_US";