Ver Fonte

Page Limit User Preference

own3mall há 9 anos atrás
pai
commit
6adb319095
2 ficheiros alterados com 12 adições e 9 exclusões
  1. 6 4
      home.php
  2. 6 5
      index.php

+ 6 - 4
home.php

@@ -27,10 +27,6 @@ require_once("includes/helpers.php");
 require_once("includes/html_functions.php");
 startSession();
 
-if(hasValue($_SESSION['user_id'])){
-	$loggedInUserInfo = $db->getUserById($_SESSION['user_id']);
-}
-
 // Report all PHP errors
 error_reporting(E_ERROR);
 
@@ -44,6 +40,12 @@ define("CONFIG_FILE","includes/config.inc.php");
 require_once CONFIG_FILE;
 // Connect to the database server and select database.
 $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix);
+
+// Logged in user settings - access this global variable where needed
+if(hasValue($_SESSION['user_id'])){
+	$loggedInUserInfo = $db->getUserById($_SESSION['user_id']);
+}
+
 $settings = $db->getSettings();
 @$GLOBALS['panel_language'] = $settings['panel_language'];
 

+ 6 - 5
index.php

@@ -39,11 +39,6 @@ require_once("includes/html_functions.php");
 // Start the session valid for opengamepanel_web only
 startSession();
 
-// Logged in user settings - access this global variable where needed
-if(hasValue($_SESSION['user_id'])){
-	$loggedInUserInfo = $db->getUserById($_SESSION['user_id']);
-}
-
 // Useful for debugging :)
 // echo "<p>Session ID is " . session_id() . "</p>";
 // echo "<p>Lifetime is: " . $cookie_lifetime . "<br />Dir is " . rtrim(dirname($_SERVER["SCRIPT_NAME"]),"/") . "/" . "<br /> Session cookie domain path is " . $session_cookie_domain_path . "<br />SSL is " . $ssl . "</p>";
@@ -62,6 +57,12 @@ if ( '' == file_get_contents(CONFIG_FILE) ) {
 require_once CONFIG_FILE;
 // Connect to the database server and select database.
 $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix);
+
+// Logged in user settings - access this global variable where needed
+if(hasValue($_SESSION['user_id'])){
+	$loggedInUserInfo = $db->getUserById($_SESSION['user_id']);
+}
+
 $settings = $db->getSettings();
 @$GLOBALS['panel_language'] = $settings['panel_language'];