I have the following authentication script which works perfectly in IE, but not in FF.
If anyone would be so kind to cast an eye over it and see any potential faults - i'd be so grateful.
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('SESSION_BYPASS', 1);
define('LOCATION_BYPASS', 1);
define('THIS_SCRIPT', 'chat_auth');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
globalize($_GET, array('username' => STR,'password' => STR));
if ($username == '')
{
die('0');
}
// get userid for given username
if ($bbuserinfo = $DB_site->query_first('SELECT userid, usergroupid, membergroupids, username, password, salt FROM ' . TABLE_PREFIX . 'user WHERE username = "' . addslashes(htmlspecialchars_uni($username)) . '"'))
{
if ($bbuserinfo['password'] != md5(md5($password) . $bbuserinfo['salt']))
{
//bad password
die('0');
}
else
{
//is used activated?
if ( $bbuserinfo['usergroupid'] == 3 || $bbuserinfo['usergroupid'] == 4 )
{
die('0');
}
//is user banned?
if ( $bbuserinfo['usergroupid'] == 8 )
{
die('0');
}
//is the user an admin / super mod?
if ( $bbuserinfo['usergroupid'] == 5 || $bbuserinfo['usergroupid'] == 6 )
{
die('2');
}
//user is regular user
die('1');
}
}
else
{
//bad username
die('0');
}
?>