Replacing $var with $_SESSION['var'] code and removing global var
declarations
This commit is contained in:
@@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
function apidb_session_start()
|
function apidb_session_start()
|
||||||
{
|
{
|
||||||
global $current;
|
|
||||||
|
|
||||||
session_set_cookie_params(time() + 3600 * 48);
|
session_set_cookie_params(time() + 3600 * 48);
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
if($current)
|
if(isset($_SESSION['current']))
|
||||||
$current->connect();
|
$_SESSION['current']->connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -19,12 +18,10 @@ function apidb_session_destroy()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* session handler functions
|
* session handler functions
|
||||||
* sessions are stored in a mysql table
|
* sessions are stored in a mysql table
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function _session_open($save_path, $session_name)
|
function _session_open($save_path, $session_name)
|
||||||
{
|
{
|
||||||
opendb();
|
opendb();
|
||||||
@@ -57,7 +54,6 @@ function _session_read($key)
|
|||||||
|
|
||||||
function _session_write($key, $value)
|
function _session_write($key, $value)
|
||||||
{
|
{
|
||||||
global $current;
|
|
||||||
global $msg_buffer;
|
global $msg_buffer;
|
||||||
global $apidb_debug;
|
global $apidb_debug;
|
||||||
|
|
||||||
@@ -79,8 +75,8 @@ function _session_write($key, $value)
|
|||||||
mysql_query("INSERT INTO debug VALUES(null, '$key = $messages')");
|
mysql_query("INSERT INTO debug VALUES(null, '$key = $messages')");
|
||||||
|
|
||||||
|
|
||||||
if($current)
|
if(isset($_SESSION['current']))
|
||||||
mysql_query("REPLACE session_list VALUES ('$key', $current->userid, '".get_remote()."', '$value', '$messages', NOW())");
|
mysql_query("REPLACE session_list VALUES ('$key', ".$_SESSION['current']->userid.", '".get_remote()."', '$value', '$messages', NOW())");
|
||||||
else
|
else
|
||||||
mysql_query("REPLACE session_list VALUES ('$key', 0, '".get_remote()."', null, '$messages', NOW())");
|
mysql_query("REPLACE session_list VALUES ('$key', 0, '".get_remote()."', null, '$messages', NOW())");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user