Session prefix, if you are hosting multiple sites, make the session name different to avoid conflict.

This commit is contained in:
Stefan Brannfjell
2014-09-06 13:43:49 +02:00
parent e0ad3aae09
commit 8ab9f11ef5
6 changed files with 21 additions and 15 deletions

View File

@@ -1,7 +1,4 @@
<?php
// Verify the PHP version, gives tutorial if fail.
if (version_compare(phpversion(), '5.3.3', '<')) die('PHP 5.3.3 is required<br><br>WINDOWS:<br>Download and use the latest Uniform Server.<br><a href="http://www.uniformserver.com/">CLICK ME</a> to get to their website. <br> XAMPP sucks and is insecure. Kthxbye.<br><br>LINUX DEBIAN:<br>Edit /etc/apt/sources.list<br>etc if you use nano text editor, make sure you are root and do<br>nano /etc/apt/sources.list<br><br>At the bottom, add this:<br><br>deb http://packages.dotdeb.org stable all<br>deb-src http://packages.dotdeb.org stable all<br><br>save file. <br><br>Then in terminal, do these 2 commands:<br>gpg --keyserver keys.gnupg.net --recv-key 89DF5277<br><br>gpg -a --export 89DF5277 | sudo apt-key add -<br><br>And then do these 2 commands:<br><br>apt-get update<br>apt-get upgrade<br><br>You now have the latest stable PHP version.<br>');
<?php if (version_compare(phpversion(), '5.3.3', '<')) die('PHP version 5.3.3 or higher is required.');
$time = time();
$version = '1.5_SVN';
@@ -12,6 +9,7 @@ $accQueriesData = array();
session_start();
ob_start();
require 'config.php';
$sessionPrefix = $config['session_prefix'];
if ($config['paypal']['enabled'] || $config['zeotss']['enabled']) {
$curlcheck = function_exists('curl_version') ? true : false;
@@ -27,18 +25,15 @@ require 'function/itemparser/itemlistparser.php';
if (isset($_SESSION['token'])) {
$_SESSION['old_token'] = $_SESSION['token'];
//var_dump($_SESSION['old_token'], $_SESSION['token']);
}
Token::generate();
if (user_logged_in() === true) {
$session_user_id = $_SESSION['user_id'];
$session_user_id = getSession('user_id');
$user_data = user_data($session_user_id, 'id', 'name', 'password', 'email', 'premdays');
$user_znote_data = user_znote_account_data($session_user_id, 'ip', 'created', 'points', 'cooldown');
}
$errors = array();
// Log IP
if ($config['log_ip']) {
$visitor_config = $config['ip_security'];