Ejemplo n.º 1
0
  Released under the GNU General Public License
*/
require '../includes/database_tables.php';
osc_db_connect(trim($_POST['DB_SERVER']), trim($_POST['DB_SERVER_USERNAME']), trim($_POST['DB_SERVER_PASSWORD']));
osc_db_select_db(trim($_POST['DB_DATABASE']));
osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($_POST['CFG_STORE_NAME']) . '" where configuration_key = "STORE_NAME"');
osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($_POST['CFG_STORE_OWNER_NAME']) . '" where configuration_key = "STORE_OWNER"');
osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($_POST['CFG_STORE_OWNER_EMAIL_ADDRESS']) . '" where configuration_key = "STORE_OWNER_EMAIL_ADDRESS"');
if (!empty($_POST['CFG_STORE_OWNER_NAME']) && !empty($_POST['CFG_STORE_OWNER_EMAIL_ADDRESS'])) {
    osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "\\"' . trim($_POST['CFG_STORE_OWNER_NAME']) . '\\" <' . trim($_POST['CFG_STORE_OWNER_EMAIL_ADDRESS']) . '>" where configuration_key = "EMAIL_FROM"');
} else {
    osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($_POST['CFG_STORE_OWNER_EMAIL_ADDRESS']) . '" where configuration_key = "EMAIL_FROM"');
}
if (!empty($_POST['CFG_ADMINISTRATOR_USERNAME'])) {
    $check_query = osc_db_query('select user_name from ' . TABLE_ADMINISTRATORS . ' where user_name = "' . trim($_POST['CFG_ADMINISTRATOR_USERNAME']) . '"');
    if (osc_db_num_rows($check_query)) {
        osc_db_query('update ' . TABLE_ADMINISTRATORS . ' set user_password = "******" where user_name = "' . trim($_POST['CFG_ADMINISTRATOR_USERNAME']) . '"');
    } else {
        osc_db_query('insert into ' . TABLE_ADMINISTRATORS . ' (user_name, user_password) values ("' . trim($_POST['CFG_ADMINISTRATOR_USERNAME']) . '", "' . osc_encrypt_password(trim($_POST['CFG_ADMINISTRATOR_PASSWORD'])) . '")');
    }
}
osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($_POST['CFG_STORE_OWNER_EMAIL_ADDRESS']) . '" where configuration_key = "MODULE_PAYMENT_PAYPAL_EXPRESS_SELLER_ACCOUNT"');
?>

<div class="row">
  <div class="col-sm-9">
    <div class="alert alert-info">
      <h1>New Installation</h1>

      <p>This web-based installation routine will correctly setup and configure osCommerce Online Merchant to run on this server.</p>
      <p>Please follow the on-screen instructions that will take you through the database server, web server, and store configuration options. If help is needed at any stage, please consult the documentation or seek help at the community support forums.</p>
Ejemplo n.º 2
0
        //Connected successfully
        $db_selected = @osc_db_select_db(trim($config['db']));
        if (!$db_selected) {
            $error = $error . '<BR>Can\'t use the database specified. Error: ' . mysql_error();
        }
        //mysql_close($link);
    }
    //echo $error;exit;
    $sql = " SHOW TABLES FROM " . trim($config['db']);
    $result = osc_db_query($sql);
    if (!$result) {
        echo "DB Error, could not list tables\n";
        echo 'MySQL Error: ' . mysql_error();
        exit;
    }
    $numtable = osc_db_num_rows($result);
    mysql_free_result($result);
    if ($numtable > 0) {
        header("Location: ../");
    }
}
$compat_register_globals = true;
if (function_exists('ini_get') && PHP_VERSION < 4.3 && (int) ini_get('register_globals') == 0) {
    $compat_register_globals = false;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!--[if IE]>
Ejemplo n.º 3
0
changeText('statusText', 'Updating Reviews');
//--></script>

<?php 
flush();
osc_db_query("create table reviews_description ( reviews_id int(5) not null, languages_id int(5) not null, reviews_text text not null, primary key (reviews_id, languages_id))");
osc_db_query("alter table reviews add products_id int(5) not null default '0' after reviews_id");
osc_db_query("alter table reviews add customers_id int(5) after products_id");
osc_db_query("alter table reviews add customers_name varchar(64) not null default '' after customers_id");
osc_db_query("alter table reviews add date_added datetime after reviews_rating");
osc_db_query("alter table reviews add last_modified datetime after date_added");
osc_db_query("alter table reviews add reviews_read int(5) not null default '0'");
$reviews_query = osc_db_query("select r.reviews_id, re.products_id, re.customers_id, r.reviews_rating, re.date_added, re.reviews_read, r.reviews_text from reviews r, reviews_extra re where r.reviews_id = re.reviews_id order by r.reviews_id");
while ($reviews = osc_db_fetch_array($reviews_query)) {
    $customer_query = osc_db_query("select customers_firstname, customers_lastname from customers where customers_id = '" . $reviews['customers_id'] . "'");
    if (osc_db_num_rows($customer_query)) {
        $customer = osc_db_fetch_array($customer_query);
        $customers_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
    } else {
        $customers_name = '';
    }
    osc_db_query("update reviews set products_id = '" . $reviews['products_id'] . "', customers_id = '" . $reviews['customers_id'] . "', customers_name = '" . addslashes($customers_name) . "', date_added = '" . $reviews['date_added'] . "', last_modified = '', reviews_read = '" . $reviews['reviews_read'] . "' where reviews_id = '" . $reviews['reviews_id'] . "'");
    osc_db_query("insert into reviews_description (reviews_id, languages_id, reviews_text) values ('" . $reviews['reviews_id'] . "', '" . $languages[0]['id'] . "', '" . addslashes($reviews['reviews_text']) . "')");
}
osc_db_query("alter table reviews drop reviews_text");
osc_db_query("drop table reviews_extra");
?>

<script language="javascript"><!--
changeStyle('reviews', 'normal');
changeText('reviewsMarker', '*');
Ejemplo n.º 4
0
changeText('addressBookMarker', '*');
changeText('statusText', 'Updating Address Book .. done!');

changeStyle('configuration', 'bold');
changeText('configurationMarker', '?');
changeText('statusText', 'Updating Configuration');
//--></script>

<?php 
flush();
osc_db_update_configuration_key('ENTRY_COMPANY_LENGTH', 'ENTRY_COMPANY_MIN_LENGTH');
osc_db_query("update configuration set use_function = 'tep_cfg_get_zone_name' where configuration_key = 'STORE_ZONE'");
osc_db_update_configuration_key('STORE_ORIGIN_ZIP', 'SHIPPING_ORIGIN_ZIP');
osc_db_query("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Country of Origin', 'SHIPPING_ORIGIN_COUNTRY', '223', 'Select the country of origin to be used in shipping quotes.', '7', '1', 'tep_get_country_name', 'tep_cfg_pull_down_country_list(', now())");
$country_query = osc_db_query("select configuration_value as name from configuration where configuration_key = 'STORE_ORIGIN_COUNTRY'");
if (osc_db_num_rows($country_query) > 0) {
    $country = osc_db_fetch_array($country_query);
    if ($country['name'] != '') {
        $new_country_query = osc_db_query("select countries_id from countries where countries_iso_code_2 = '" . $country['name'] . "'");
        $new_country = osc_db_fetch_array($new_country_query);
        if ($new_country['countries_iso_code_2'] != NULL) {
            osc_db_query("update configuration set configuration_value = " . $new_country['countries_iso_code_2'] . " where configuration_key = 'SHIPPING_ORIGIN_COUNTRY'");
        }
    }
}
osc_db_query("delete from configuration where configuration_key = 'STORE_ORIGIN_COUNTRY'");
osc_db_query("insert into configuration_group values ('15', 'Sessions', 'Session options', '15', '1')");
osc_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Session Directory', 'SESSION_WRITE_DIRECTORY', '/tmp', 'If sessions are file based, store them in this directory.', '15', '1', now())");
osc_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Force Cookie Use', 'SESSION_FORCE_COOKIE_USE', 'False', 'Force the use of sessions when cookies are only enabled.', '15', '2', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())");
osc_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check SSL Session ID', 'SESSION_CHECK_SSL_SESSION_ID', 'False', 'Validate the SSL_SESSION_ID on every secure HTTPS page request.', '15', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())");
osc_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check User Agent', 'SESSION_CHECK_USER_AGENT', 'False', 'Validate the clients browser user agent on every page request.', '15', '4', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())");