Test fix for superglobal bug in php.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1351 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2005-02-23 23:46:35 +00:00
parent b211596bd4
commit afe2d218e3
2 changed files with 39 additions and 10 deletions

View File

@ -32,8 +32,8 @@ if ( $debug )
// Use new style autoglobals where possible
if ( version_compare( phpversion(), "4.1.0", "<") )
{
$_SERVER = &$HTTP_SERVER_VARS;
$_SESSION = &$HTTP_SESSION_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
}
// Useful debugging lines for mobile devices

View File

@ -20,7 +20,11 @@
function userLogin( $username, $password )
{
global $user, $cookies, $_SESSION, $_SERVER;
global $user, $cookies;
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION, $_SERVER;
}
$sql = "select * from Users where Username = '".mysql_escape_string($username)."' and Password = password('".mysql_escape_string($password)."') and Enabled = 1";
$result = mysql_query( $sql );
@ -47,7 +51,11 @@ function userLogin( $username, $password )
function userLogout()
{
global $user, $_SESSION;
global $user;
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION;
}
unset( $_SESSION['user'] );
unset( $user );
@ -56,8 +64,11 @@ function userLogout()
}
function authHash( $use_remote_addr=true )
{
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION;
}
if ( ZM_OPT_USE_AUTH && ZM_AUTH_METHOD == "hashed" )
{
@ -80,8 +91,11 @@ function authHash( $use_remote_addr=true )
}
function getStreamSrc( $args )
{
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION;
}
$stream_src = ZM_PATH_ZMS;
@ -111,8 +125,11 @@ function getStreamSrc( $args )
}
function getZmuCommand( $args )
{
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION;
}
$zmu_command = ZMU_PATH;
@ -268,8 +285,11 @@ function getFormChanges( $values, $new_values, $types=false )
}
function getBrowser( &$browser, &$version )
{
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SERVER;
}
if (ereg( 'MSIE ([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$log_version))
{
@ -313,8 +333,11 @@ function isInternetExplorer()
}
function isWindows()
{
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SERVER;
}
return ( preg_match( '/Win/', $_SERVER['HTTP_USER_AGENT'] ) );
}
@ -577,9 +600,12 @@ function reScale( $dimension, $scale=SCALE_SCALE )
function parseSort( $save_to_session=false )
{
global $_SESSION;
global $sort_field, $sort_asc; // Inputs
global $sort_query, $sort_column, $sort_order; // Outputs
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION;
}
if ( !isset($sort_field) )
{
@ -638,9 +664,12 @@ function parseSort( $save_to_session=false )
function parseFilter( $save_to_session=false )
{
global $_SESSION;
global $trms; // Inputs
global $filter_query, $filter_sql, $filter_fields; // Outputs
if ( version_compare( phpversion(), "4.1.0", "<") )
{
global $_SESSION;
}
$filter_query = '';
$filter_sql = '';