diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-30 19:49:39 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-30 19:49:39 +0000 |
commit | 3267cf14b9fa2ffdf1918fe68dd067ee932a5867 (patch) | |
tree | 4f9ff7f027b61d52f5620943ccd66a22ee1a796d /install.php | |
parent | 96d7639ca1e320019e870c109e42f0618c16cf6b (diff) | |
download | ampache-3267cf14b9fa2ffdf1918fe68dd067ee932a5867.tar.gz ampache-3267cf14b9fa2ffdf1918fe68dd067ee932a5867.tar.bz2 ampache-3267cf14b9fa2ffdf1918fe68dd067ee932a5867.zip |
sync from branch
Diffstat (limited to 'install.php')
-rw-r--r-- | install.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/install.php b/install.php index 0c6873ef..b7249318 100644 --- a/install.php +++ b/install.php @@ -62,7 +62,9 @@ $hostname = scrub_in($_REQUEST['local_host']); $database = scrub_in($_REQUEST['local_db']); if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } else { $http_type = "http://"; } -$php_self = $http_type . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/^\/(.+\.php)\/?.*/","$1",$_SERVER['PHP_SELF']); + +define('WEB_PATH',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/' . basename($_SERVER['PHP_SELF'])); +define('WEB_ROOT',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF'])); /* Catch the Current Action */ switch ($_REQUEST['action']) { @@ -81,7 +83,7 @@ switch ($_REQUEST['action']) { break; } - header ("Location: " . $php_self . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset"); + header ("Location: " . WEB_PATH . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset"); break; case 'create_config': @@ -146,12 +148,7 @@ switch ($_REQUEST['action']) { break; } - if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } - else { $http_type = "http://"; } - - $web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; - - header ("Location: " . $web_path . "/login.php"); + header ("Location: " . WEB_ROOT . "/login.php"); break; case 'show_create_account': @@ -168,6 +165,7 @@ switch ($_REQUEST['action']) { /* Make sure we've got a valid config file */ if (!check_config_values($results)) { + Error::add('general',_('Error: Config file not found or Unreadable')); require_once Config::get('prefix') . '/templates/show_install_config.inc.php'; break; } @@ -249,7 +247,7 @@ switch ($_REQUEST['action']) { Config::set('lang',$htmllang,'1'); Config::set('site_charset', $charset, '1'); load_gettext(); - //header ("Content-Type: text/html; charset=$charset"); + /* Show the language options first */ require_once 'templates/show_install_lang.inc.php'; break; |