Changeset 1712
- Timestamp:
- 08/30/08 12:49:39 (3 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
install.php (modified) (5 diffs)
-
lib/install.php (modified) (3 diffs)
-
templates/show_install.inc.php (modified) (3 diffs)
-
templates/show_install_account.inc.php (modified) (2 diffs)
-
templates/show_install_config.inc.php (modified) (4 diffs)
-
templates/show_install_lang.inc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/install.php
r1701 r1712 63 63 if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } 64 64 else { $http_type = "http://"; } 65 $php_self = $http_type . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/^\/(.+\.php)\/?.*/","$1",$_SERVER['PHP_SELF']); 65 66 define('WEB_PATH',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/' . basename($_SERVER['PHP_SELF'])); 67 define('WEB_ROOT',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF'])); 66 68 67 69 /* Catch the Current Action */ … … 82 84 } 83 85 84 header ("Location: " . $php_self. "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset");86 header ("Location: " . WEB_PATH . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset"); 85 87 86 88 break; … … 147 149 } 148 150 149 if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } 150 else { $http_type = "http://"; } 151 152 $web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; 153 154 header ("Location: " . $web_path . "/login.php"); 151 header ("Location: " . WEB_ROOT . "/login.php"); 155 152 break; 156 153 case 'show_create_account': … … 169 166 /* Make sure we've got a valid config file */ 170 167 if (!check_config_values($results)) { 168 Error::add('general',_('Error: Config file not found or Unreadable')); 171 169 require_once Config::get('prefix') . '/templates/show_install_config.inc.php'; 172 170 break; … … 250 248 Config::set('site_charset', $charset, '1'); 251 249 load_gettext(); 252 //header ("Content-Type: text/html; charset=$charset"); 250 253 251 /* Show the language options first */ 254 252 require_once 'templates/show_install_lang.inc.php'; -
trunk/lib/install.php
r1537 r1712 107 107 } 108 108 109 110 109 $data['database_username'] = $username; 111 110 $data['database_password'] = $password; … … 113 112 $data['database_name'] = $database; 114 113 115 if (!strlen($data['database_password'])) {116 Error::add('general','Error: Password required for Database creation');117 return false;118 }119 120 114 Config::set_by_array($data,'1'); 121 115 … … 133 127 $db_selected = @mysql_select_db($database, $dbh); 134 128 135 if ($db_selected && !$_POST['overwrite_db']) { 129 if ($db_selected && $_POST['existing_db']) { 130 // Rien a faire, we've got the db just blow through 131 } 132 elseif ($db_selected && !$_POST['overwrite_db']) { 136 133 Error::add('general','Error: Database Already exists and Overwrite not checked'); 137 134 return false; -
trunk/templates/show_install.inc.php
r1704 r1712 2 2 /* 3 3 4 Copyright (c) 2001 - 2007Ampache.org4 Copyright (c) Ampache.org 5 5 All rights reserved. 6 6 … … 61 61 <br /> 62 62 <span class="header2"><?php echo _('Insert Ampache Database'); ?></span> 63 <form method="post" action="<?php echo $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']. "?action=create_db&htmllang=$htmllang&charset=$charset"; ?>" enctype="multipart/form-data" >63 <form method="post" action="<?php echo WEB_PATH . "?action=create_db&htmllang=$htmllang&charset=$charset"; ?>" enctype="multipart/form-data" > 64 64 <table> 65 65 <tr> … … 96 96 </tr> 97 97 <tr> 98 <td class="align"><?php echo _('Use Existing Database'); ?></td> 99 <td><input type="checkbox" name="existing_db" value="1" /></td> 100 </tr> 101 <tr> 98 102 <td> </td> 99 103 <td><input type="submit" value="<?php echo _("Insert Database"); ?>" /></td> -
trunk/templates/show_install_account.inc.php
r1704 r1712 2 2 /* 3 3 4 Copyright (c) 2001 - 2007Ampache.org4 Copyright (c) Ampache.org 5 5 All rights reserved. 6 6 … … 56 56 <br /> 57 57 <span class="header2"><?php echo _('Create Admin Account'); ?></span> 58 <form method="post" action="<?php echo $GLOBALS['php_self']. "?action=create_account&htmllang=$htmllang&charset=$charset"; ?>" enctype="multipart/form-data" >58 <form method="post" action="<?php echo WEB_PATH . "?action=create_account&htmllang=$htmllang&charset=$charset"; ?>" enctype="multipart/form-data" > 59 59 <table> 60 60 <tr> -
trunk/templates/show_install_config.inc.php
r1704 r1712 2 2 /* 3 3 4 Copyright (c) 2001 - 2007Ampache.org4 Copyright (c) Ampache.org 5 5 All rights reserved. 6 6 … … 56 56 <br /> 57 57 <span class="header2"><?php echo _('Generate Config File'); ?></span> 58 <form method="post" action="<?php echo $_SERVER['PHP_SELF']. "?action=create_config"; ?>" enctype="multipart/form-data" >58 <form method="post" action="<?php echo WEB_PATH . "?action=create_config"; ?>" enctype="multipart/form-data" > 59 59 <table> 60 60 <tr> … … 124 124 <td> </td> 125 125 <td> 126 <?php $check_url = $GLOBALS['php_self']. "?action=show_create_config&htmllang=$htmllang&charset=$charset&local_db=" . $_REQUEST['local_db'] . "&local_host=" . $_REQUEST['local_host']; ?>126 <?php $check_url = WEB_PATH . "?action=show_create_config&htmllang=$htmllang&charset=$charset&local_db=" . $_REQUEST['local_db'] . "&local_host=" . $_REQUEST['local_host']; ?> 127 127 <a href="<?php echo $check_url; ?>">[<?php echo _('Check for Config'); ?>]</a> 128 128 </td> … … 130 130 </table> 131 131 <br /> 132 <form method="post" action="<?php echo $GLOBALS['php_self']. "?action=show_create_account&htmllang=$htmllang&charset=$charset"; ?>" enctype="multipart/form-data">132 <form method="post" action="<?php echo WEB_PATH . "?action=show_create_account&htmllang=$htmllang&charset=$charset"; ?>" enctype="multipart/form-data"> 133 133 <input type="submit" value="<?php echo _('Continue to Step 3'); ?>" /> 134 134 </form> -
trunk/templates/show_install_lang.inc.php
r1705 r1712 2 2 /* 3 3 4 Copyright (c) 2001 - 2007Ampache.org4 Copyright (c) Ampache.org 5 5 All rights reserved. 6 6 … … 143 143 <?php Error::display('general'); ?> 144 144 </p> 145 <form method="post" action="<?php echo $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']. "?action=init"; ?>" enctype="multipart/form-data" >145 <form method="post" action="<?php echo WEB_PATH . "?action=init"; ?>" enctype="multipart/form-data" > 146 146 147 147 <?php
