[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * @package Installer 4 * @access private 5 * @copyright Copyright 2003-2006 Zen Cart Development Team 6 * @copyright Portions Copyright 2003 osCommerce 7 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 8 * @version $Id: header_php.php 3122 2006-03-06 22:38:26Z drbyte $ 9 */ 10 11 if (!isset($_GET['debug']) && !zen_not_null($_POST['debug'])) define('ZC_UPG_DEBUG',false); 12 if (!isset($_GET['debug2']) && !zen_not_null($_POST['debug2'])) define('ZC_UPG_DEBUG2',false); 13 if (!isset($_GET['debug3']) && !zen_not_null($_POST['debug3'])) define('ZC_UPG_DEBUG3',false); 14 15 16 $zc_install->error = false; 17 $zc_install->fatal_error = false; 18 $zc_install->error_list = array(); 19 20 21 if (isset($_POST['submit'])) { 22 include('../includes/configure.php'); 23 24 if (!isset($_POST['admin_username'])) $_POST['admin_username'] = ''; 25 if (!isset($_POST['admin_email'])) $_POST['admin_email'] = ''; 26 if (!isset($_POST['admin_pass'])) $_POST['admin_pass'] = ''; 27 if (!isset($_POST['admin_pass_confirm'])) $_POST['admin_pass_confirm'] = ''; 28 if (!isset($_POST['check_for_updates'])) $_POST['check_for_updates'] = 'True'; 29 30 $admin_username = zen_db_prepare_input($_POST['admin_username']); 31 $admin_email = zen_db_prepare_input($_POST['admin_email']); 32 $admin_pass = zen_db_prepare_input($_POST['admin_pass']); 33 $admin_pass_confirm = zen_db_prepare_input($_POST['admin_pass_confirm']); 34 35 if (isset($_POST['check_for_updates']) && $_POST['check_for_updates']== '1' ) { 36 $check_for_updates = 1; 37 } else { 38 $check_for_updates = 0; 39 } 40 41 $zc_install->isEmpty($admin_username, ERROR_TEXT_ADMIN_USERNAME_ISEMPTY, ERROR_CODE_ADMIN_USERNAME_ISEMPTY); 42 $zc_install->isEmpty($admin_email, ERROR_TEXT_ADMIN_EMAIL_ISEMPTY, ERROR_CODE_ADMIN_EMAIL_ISEMPTY); 43 $zc_install->isEmail($admin_email, ERROR_TEXT_ADMIN_EMAIL_NOTEMAIL, ERROR_CODE_ADMIN_EMAIL_NOTEMAIL); 44 $zc_install->isEmpty($admin_pass, ERROR_TEXT_ADMIN_PASS_ISEMPTY, ERROR_CODE_ADMIN_PASS_ISEMPTY); 45 $zc_install->isEqual($admin_pass, $admin_pass_confirm, ERROR_TEXT_ADMIN_PASS_NOTEQUAL, ERROR_CODE_ADMIN_PASS_NOTEQUAL); 46 47 48 if (!$zc_install->error) { 49 include('../includes/classes/db/' . DB_TYPE . '/query_factory.php'); 50 $db = new queryFactory; 51 $db->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE) or die("Unable to connect to database"); 52 $sql = "update " . DB_PREFIX . "admin set admin_name = '" . $admin_username . "', admin_email = '" . $admin_email . "', admin_pass = '" . zen_encrypt_password($admin_pass) . "' where admin_id = 1"; 53 $db->Execute($sql) or die("Error in query: $sql".$db->ErrorMsg()); 54 55 // enable/disable automatic version-checking 56 $sql = "update " . DB_PREFIX . "configuration set configuration_value = '".($check_for_updates ? 'true' : 'false' ) ."' where configuration_key = 'SHOW_VERSION_UPDATE_IN_HEADER'"; 57 $db->Execute($sql) or die("Error in query: $sql".$db->ErrorMsg()); 58 59 $db->Close(); 60 header('location: index.php?main_page=finished&language=' . $language); 61 exit; 62 } 63 } 64 if (!isset($_POST['admin_username'])) $_POST['admin_username'] = ''; 65 if (!isset($_POST['admin_email'])) $_POST['admin_email'] = ''; 66 67 setInputValue($_POST['admin_username'], 'ADMIN_USERNAME_VALUE', ''); 68 setInputValue($_POST['admin_email'], 'ADMIN_EMAIL_VALUE', ''); 69 70 // this sets the first field to email address on login - setting in /common/tpl_main_page.php 71 $zc_first_field= 'onload="document.getElementById(\'admin_username\').focus()"'; 72 73 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |