Changeset 1712

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

sync from branch

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/install.php

    r1701 r1712  
    6363if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; } 
    6464else { $http_type = "http://"; } 
    65 $php_self = $http_type . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/^\/(.+\.php)\/?.*/","$1",$_SERVER['PHP_SELF']); 
     65 
     66define('WEB_PATH',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/' . basename($_SERVER['PHP_SELF'])); 
     67define('WEB_ROOT',$http_type . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));  
    6668 
    6769/* Catch the Current Action */ 
     
    8284                } 
    8385                 
    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"); 
    8587                 
    8688        break; 
     
    147149                } 
    148150 
    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"); 
    155152        break;   
    156153        case 'show_create_account': 
     
    169166                /* Make sure we've got a valid config file */ 
    170167                if (!check_config_values($results)) {  
     168                        Error::add('general',_('Error: Config file not found or Unreadable'));  
    171169                        require_once Config::get('prefix') . '/templates/show_install_config.inc.php';  
    172170                        break; 
     
    250248                Config::set('site_charset', $charset, '1'); 
    251249                load_gettext(); 
    252                 //header ("Content-Type: text/html; charset=$charset"); 
     250 
    253251                /* Show the language options first */ 
    254252                require_once 'templates/show_install_lang.inc.php'; 
  • trunk/lib/install.php

    r1537 r1712  
    107107        }  
    108108 
    109  
    110109        $data['database_username'] = $username;  
    111110        $data['database_password'] = $password;  
     
    113112        $data['database_name']     = $database; 
    114113 
    115         if (!strlen($data['database_password'])) {  
    116                 Error::add('general','Error: Password required for Database creation');  
    117                 return false;  
    118         }  
    119          
    120114        Config::set_by_array($data,'1');  
    121115         
     
    133127        $db_selected = @mysql_select_db($database, $dbh); 
    134128 
    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']) {  
    136133                Error::add('general','Error: Database Already exists and Overwrite not checked');  
    137134                return false;  
  • trunk/templates/show_install.inc.php

    r1704 r1712  
    22/* 
    33 
    4  Copyright (c) 2001 - 2007 Ampache.org 
     4 Copyright (c) Ampache.org 
    55 All rights reserved. 
    66 
     
    6161                <br /> 
    6262                <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&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data" > 
     63                <form method="post" action="<?php echo WEB_PATH . "?action=create_db&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data" > 
    6464<table> 
    6565<tr> 
     
    9696</tr> 
    9797<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> 
    98102        <td>&nbsp;</td> 
    99103        <td><input type="submit" value="<?php echo _("Insert Database"); ?>" /></td> 
  • trunk/templates/show_install_account.inc.php

    r1704 r1712  
    22/* 
    33 
    4  Copyright (c) 2001 - 2007 Ampache.org 
     4 Copyright (c) Ampache.org 
    55 All rights reserved. 
    66 
     
    5656        <br /> 
    5757        <span class="header2"><?php echo _('Create Admin Account'); ?></span> 
    58         <form method="post" action="<?php echo $GLOBALS['php_self'] . "?action=create_account&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data" > 
     58        <form method="post" action="<?php echo WEB_PATH . "?action=create_account&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data" > 
    5959<table> 
    6060<tr> 
  • trunk/templates/show_install_config.inc.php

    r1704 r1712  
    22/* 
    33 
    4  Copyright (c) 2001 - 2007 Ampache.org 
     4 Copyright (c) Ampache.org 
    55 All rights reserved. 
    66 
     
    5656                <br /> 
    5757                <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" > 
    5959                <table> 
    6060<tr> 
     
    124124        <td>&nbsp;</td> 
    125125        <td> 
    126         <?php $check_url = $GLOBALS['php_self'] . "?action=show_create_config&amp;htmllang=$htmllang&amp;charset=$charset&amp;local_db=" . $_REQUEST['local_db'] . "&amp;local_host=" . $_REQUEST['local_host']; ?> 
     126        <?php $check_url = WEB_PATH . "?action=show_create_config&amp;htmllang=$htmllang&amp;charset=$charset&amp;local_db=" . $_REQUEST['local_db'] . "&amp;local_host=" . $_REQUEST['local_host']; ?> 
    127127        <a href="<?php echo $check_url; ?>">[<?php echo _('Check for Config'); ?>]</a> 
    128128        </td> 
     
    130130                </table> 
    131131                <br /> 
    132                 <form method="post" action="<?php echo $GLOBALS['php_self'] . "?action=show_create_account&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data"> 
     132                <form method="post" action="<?php echo WEB_PATH . "?action=show_create_account&amp;htmllang=$htmllang&amp;charset=$charset"; ?>" enctype="multipart/form-data"> 
    133133                <input type="submit" value="<?php echo _('Continue to Step 3'); ?>" /> 
    134134                </form> 
  • trunk/templates/show_install_lang.inc.php

    r1705 r1712  
    22/* 
    33 
    4  Copyright (c) 2001 - 2007 Ampache.org 
     4 Copyright (c) Ampache.org 
    55 All rights reserved. 
    66 
     
    143143                <?php Error::display('general'); ?> 
    144144                </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" > 
    146146 
    147147<?php