$za_dir->close(); unset($za_dir); } if (isset($_POST['submit'])) { $zc_install->validateStoreSetup($_POST); if ($_POST['demo_install'] == 'true') { $zc_install->fileExists('demo/' . DB_TYPE . '_demo.sql', ERROR_TEXT_DEMO_SQL_NOTEXIST, ERROR_CODE_DEMO_SQL_NOTEXIST); } if ($zc_install->error == false) { if ($_POST['demo_install'] == 'true') { $zc_install->dbDemoDataInstall(); } $zc_install->dbStoreSetup(); // Close the database connection $zc_install->db->Close(); header('location: index.php?main_page=admin_setup' . zcInstallAddSID()); exit; } } require '../includes/classes/db/' . DB_TYPE . '/query_factory.php'; $db = new queryFactory(); $db->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE) or die("Unable to connect to database"); //if not submit, set some defaults $sql = "select countries_id, countries_name from " . DB_PREFIX . "countries order by countries_name"; $country = $db->Execute($sql); $country_string = ''; while (!$country->EOF) { $country_string .= '<option value="' . $country->fields['countries_id'] . '"' . setSelected($country->fields['countries_id'], $_POST['store_country']) . '>' . $country->fields['countries_name'] . '</option>'; $country->MoveNext(); } $sql = "select zone_id, zone_name from " . DB_PREFIX . "zones";
$zc_install->isEmpty($_POST['physical_path'], ERROR_TEXT_PHYSICAL_PATH_ISEMPTY, ERROR_CODE_PHYSICAL_PATH_ISEMPTY); $zc_install->fileExists($zc_install->trimTrailingSlash($_POST['physical_path']) . '/index.php', ERROR_TEXT_PHYSICAL_PATH_INCORRECT, ERROR_CODE_PHYSICAL_PATH_INCORRECT); $zc_install->isEmpty($_POST['virtual_http_path'], ERROR_TEXT_VIRTUAL_HTTP_ISEMPTY, ERROR_CODE_VIRTUAL_HTTP_ISEMPTY); if ($_POST['enable_ssl'] == 'true' || $_POST['enable_ssl_admin'] == 'true') { // @TODO: actually *test* the HTTPS URL if supplied, to determine whether it's actually valid or not. $zc_install->isEmpty($_POST['virtual_https_path'], ERROR_TEXT_VIRTUAL_HTTPS_ISEMPTY, ERROR_CODE_VIRTUAL_HTTPS_ISEMPTY); $zc_install->isEmpty($_POST['virtual_https_server'], ERROR_TEXT_VIRTUAL_HTTPS_SERVER_ISEMPTY, ERROR_CODE_VIRTUAL_HTTPS_SERVER_ISEMPTY); } if (!$zc_install->fatal_error) { $zc_install->setConfigKey('DIR_FS_CATALOG', $zc_install->trimTrailingSlash($_POST['physical_path'])); $zc_install->setConfigKey('virtual_http_path', $zc_install->trimTrailingSlash($_POST['virtual_http_path'])); $zc_install->setConfigKey('virtual_https_path', $zc_install->trimTrailingSlash($_POST['virtual_https_path'])); $zc_install->setConfigKey('virtual_https_server', $zc_install->trimTrailingSlash($_POST['virtual_https_server'])); $zc_install->setConfigKey('ENABLE_SSL', $_POST['enable_ssl']); $zc_install->setConfigKey('ENABLE_SSL_ADMIN', $_POST['enable_ssl_admin']); header('location: index.php?main_page=config_checkup&action=write' . zcInstallAddSID()); exit; } } // quick sanitization foreach ($_POST as $key => $val) { if (is_array($val)) { foreach ($val as $key2 => $val2) { $_POST[$key][$key2] = htmlspecialchars($val2, ENT_COMPAT, CHARSET, TRUE); } } else { $_POST[$key] = htmlspecialchars($val, ENT_COMPAT, CHARSET, TRUE); } } setInputValue($_POST['physical_path'], 'PHYSICAL_PATH_VALUE', $dir_fs_www_root); setInputValue($_POST['virtual_http_path'], 'VIRTUAL_HTTP_PATH_VALUE', 'http://' . $virtual_path);
/** * @package Installer * @access private * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: license_default.php 6981 2007-09-12 18:26:56Z drbyte $ */ if ($zc_install->error) { include DIR_WS_INSTALL_TEMPLATE . 'templates/display_errors.php'; } ?> <iframe src="includes/templates/template_default/templates/gpl_license.html"></iframe> <form method="post" action="index.php?main_page=license<?php echo zcInstallAddSID(); ?> "> <input type="radio" name="license_consent" id="agree" value="agree" /> <label for="agree"><?php echo AGREE; ?> </label><br /> <input type="radio" name="license_consent" id="disagree" checked="checked" value="disagree" /> <label for="disagree"><?php echo DISAGREE; ?> </label><br /> <input type="submit" name="submit" class="button" value="<?php echo INSTALL; ?>
if (!isset($_POST['admin_pass'])) { $_POST['admin_pass'] = ''; } if (!isset($_POST['admin_pass_confirm'])) { $_POST['admin_pass_confirm'] = ''; } if (!isset($_POST['check_for_updates'])) { $_POST['check_for_updates'] = 'True'; } $zc_install->validateAdminSetup($_POST); $zc_install->isEqual($zc_install->configInfo['admin_pass'], zen_db_prepare_input($_POST['admin_pass_confirm']), ERROR_TEXT_ADMIN_PASS_NOTEQUAL, ERROR_CODE_ADMIN_PASS_NOTEQUAL); if (!$zc_install->error) { $zc_install->dbAdminSetup(); $zc_install->resetConfigKeys(); $zc_install->resetConfigInfo(); header('location: index.php?main_page=finished' . zcInstallAddSID()); exit; } } // quick sanitization foreach ($_POST as $key => $val) { if (is_array($val)) { foreach ($val as $key2 => $val2) { $_POST[$key][$key2] = htmlspecialchars($val2, ENT_COMPAT, CHARSET, TRUE); } } else { $_POST[$key] = htmlspecialchars($val, ENT_COMPAT, CHARSET, TRUE); } } setInputValue($_POST['admin_username'], 'ADMIN_USERNAME_VALUE', ''); setInputValue($_POST['admin_email'], 'ADMIN_EMAIL_VALUE', '');
//endif newprefix != DB_PREFIX } //endif prefix POST'd // ? if (isset($_POST['upgrade'])) { header('location: index.php?main_page=system_setup' . zcInstallAddSID()); exit; } if ($db_upgraded_to_version == $latest_version && $zc_install->error == false && $failed_entries == 0) { // if all db upgrades have been applied, go to the 'finished' page. header('location: index.php?main_page=finished' . zcInstallAddSID()); exit; } else { //return for more upgrades if (!$zc_install->fatal_error && !$zc_install->error && $failed_entries == 0) { header('location: index.php?main_page=database_upgrade' . zcInstallAddSID()); exit; } } //endif } // end if POST==submit if (isset($_POST['skip'])) { header('location: index.php?main_page=finished' . zcInstallAddSID()); exit; } if (isset($_POST['refresh'])) { header('location: index.php?main_page=database_upgrade' . zcInstallAddSID()); exit; } $adminName = isset($_POST['adminid']) ? $_POST['adminid'] : '';
* activate installer */ require 'includes/classes/installer.php'; $zc_install = new installer(); $zc_install->error = false; $zc_install->fatal_error = false; $zc_install->error_list = array(); if (!isset($_GET['main_page']) || $_GET['main_page'] == 'index' || isset($_GET['reset']) && $_GET['reset'] == 1) { $zc_install->resetConfigKeys(); } /* * check validity of session data */ if (isset($_GET['main_page']) && !in_array($_GET['main_page'], array('', 'index', 'license', 'inspect', 'time_out', 'store_setup', 'admin_setup', 'finished'))) { if (!isset($_SESSION['installerConfigKeys']) || sizeof($_SESSION['installerConfigKeys']) < 1 || !isset($_SESSION['installerConfigKeys']['DIR_FS_SQL_CACHE'])) { header('location: index.php?main_page=time_out' . zcInstallAddSID()); } } /* * language determination */ $language = isset($_GET['language']) && $_GET['language'] != '' ? preg_replace('/[^a-zA-Z_]/', '', $_GET['language']) : $zc_install->getConfigKey('language'); if ($language == '') { $language = 'english'; } if (!file_exists('includes/languages/' . $language . '.php')) { $zc_install->throwException('Specified language file not found. Defaulting to english. (' . 'includes/languages/' . $language . '.php)'); $language = 'english'; } $zc_install->setConfigKey('language', $language); /*
<?php /** * @package Installer * @access private * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: header_php.php 6981 2007-09-12 18:26:56Z drbyte $ */ $zc_install->resetConfigKeys(); if (isset($_POST['submit'])) { if (isset($_POST['license_consent']) && $_POST['license_consent'] == 'agree') { header('location: index.php?main_page=inspect' . zcInstallAddSID()); exit; } if (isset($_POST['license_consent']) && $_POST['license_consent'] == 'disagree') { header('location: index.php' . zcInstallAddSID()); exit; } }
if (isset($_POST['submit'])) { if (!$zc_install->fatal_error) { $zc_install->setConfigKey('is_upgrade', 0); header('location: index.php?main_page=database_setup' . zcInstallAddSID()); exit; } } else { if (isset($_POST['upgrade'])) { if (!$zc_install->fatal_error) { $zc_install->setConfigKey('is_upgrade', 1); header('location: index.php?main_page=database_setup' . zcInstallAddSID()); exit; } } else { if (isset($_POST['db_upgrade'])) { if (!$zen_cart_allow_database_upgrade_button_disable) { $zc_install->setConfigKey('is_upgrade', 1); header('location: index.php?main_page=database_upgrade' . zcInstallAddSID()); exit; } } else { if (isset($_POST['refresh'])) { $zc_install->logDetails('System Inspection Results: ' . str_replace(array('<br />', '<br>', ' '), '', $data)); header('location: index.php?main_page=inspect' . zcInstallAddSID()); exit; } else { $zc_install->logDetails('System Inspection Results: ' . str_replace(array('<br />', '<br>', ' '), '', $data)); } } } }