if (isset($_SERVER['SCRIPT_NAME'])) { # on Windows _APP_MAIN_DIR becomes \ and abs url would look something like HTTP_HOST\/restOfUrl, so \ should be trimed too # @modified Chis Florinel <*****@*****.**> $app_main_dir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\'); define('_APP_MAIN_DIR', $app_main_dir); } else { die('[config.php] Cannot determine APP_MAIN_DIR, please set manual and comment this line'); } // Get the ls DB class if (LS_MYSQL_CONNECTION == 1) { require_once 'class/class.db.php'; } else { require_once 'class/class.dbn.php'; } // MySQLi connection $lsdb = new ls_mysql(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT); $lsdb->set_charset("utf8"); // All important files include_once 'include/functions.php'; include_once 'class/class.lsbase.php'; include_once 'class/class.postmail.php'; include_once 'class/class.userlogin.php'; include_once 'class/class.user.php'; // Now launch the rewrite class, depending on the settings in db. $getURL = new LS_rewrite($_SERVER['REQUEST_URI']); // We are not using apache so take the ugly urls $tempp = $getURL->lsGetseg(0); $tempp1 = $getURL->lsGetseg(1); $tempp2 = $getURL->lsGetseg(2); $tempp3 = $getURL->lsGetseg(3); $tempp4 = $getURL->lsGetseg(4);
<?php } elseif (isset($_POST['user']) && $_GET['step'] == 3) { ?> Last Step - Create Admin<br /><br /> <?php if (isset($_POST['user']) && isset($_POST['pass'])) { if ($_POST['email'] == '' || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $errors = 'Please insert a valid email address.<br />'; } if (!preg_match('/^([a-zA-Z0-9\\-_])+$/', $_POST['username'])) { $errors .= 'Please insert a valid username (A-Z,a-z,0-9,-_).'; } if (count($errors) == 0) { // MySQL/i connection if (DB_USER && DB_PASS) { $lsdb = new ls_mysql(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT); $lsdb->set_charset("utf8"); } // The new password encrypt with hash_hmac $passcrypt = hash_hmac('sha256', $_POST['pass'], DB_PASS_HASH); $lsdb->query('INSERT INTO ' . DB_PREFIX . 'jrc_user SET username = "******", password = "******", email = "' . smartsql($_POST['email']) . '", name = "' . smartsql($_POST['name']) . '", time = NOW(), access = 1'); $lsdb->query('UPDATE ' . DB_PREFIX . 'jrc_setting SET value = "' . smartsql($_POST['email']) . '" WHERE varname = "email"'); @$lsdb->query('ALTER DATABASE ' . DB_NAME . ' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci'); // Finally close all db connections $lsdb->ls_close();
if (isset($_SERVER['SCRIPT_NAME'])) { # on Windows _APP_MAIN_DIR becomes \ and abs url would look something like HTTP_HOST\/restOfUrl, so \ should be trimed too # @modified Chis Florinel <*****@*****.**> $app_main_dir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\'); define('_APP_MAIN_DIR', $app_main_dir); } else { die('[config.php] Cannot determine APP_MAIN_DIR, please set manual and comment this line'); } // Get the ls DB class if (LS_MYSQL_CONNECTION == 1) { require_once 'class/class.db.php'; } else { require_once 'class/class.dbn.php'; } // MySQLi connection $lsdb = new ls_mysql(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT); $lsdb->set_charset("utf8"); // All important files include_once 'include/functions.php'; include_once 'class/class.lsbase.php'; include_once 'class/PHPMailerAutoload.php'; include_once 'class/class.userlogin.php'; include_once 'class/class.user.php'; // Undo register_globals. undoRegisterGlobals(); // If magic quotes is on, strip the slashes that it added. if (get_magic_quotes_gpc()) { $_REQUEST = array_map("undoMagicQuotes", $_REQUEST); $_GET = array_map("undoMagicQuotes", $_GET); $_POST = array_map("undoMagicQuotes", $_POST); $_COOKIE = array_map("undoMagicQuotes", $_COOKIE);