function browserSupported() { $browserData = getBrowserData(); $browser = $browserData["browser"]; $version = intval($browserData["version"]); //print "browser:$browser version:" . intval($version); if ("IE" == $browser) { if ($version < 9) { if (compatibilityModeIE9()) { return true; } else { return false; } } } elseif ("Firefox" == $browser) { if ($version < 4) { return false; } } elseif ("Safari" == $browser) { if ($version < 5) { return false; } //{ print "version:$version<br />"; return false; } else { print "it's fine"; } } elseif ("Chrome" == $browser) { // return false; } elseif ("Opera" == $browser) { // return false; } else { } return true; }
function connectUser($login, $password, $string) { $activated = false; $banned = true; $connected = false; $registered = false; $data = array(); if (md5(getIp() . strtolower($string)) == $_SESSION['userCheck'] || !$_SESSION['do_check']) { $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_caver`"; $sql .= " WHERE Login = '******' AND Password ='******' "; $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__); if ($data['Count'] > 0) { $registered = true; $banned = $data[0]['Banned'] == "YES"; $activated = $data[0]['Activated'] == "YES"; } else { $banned = false; $activated = true; } } $connected = $registered && !$banned && $activated; //Set the session setSession($connected, $data[0]); if ($connected) { //Update the date of last connection for this user $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_caver` "; $sql .= "SET Date_last_connection = Now(), "; $sql .= "Ip = '" . getIp() . "', "; $sql .= "Browser = '" . getBrowserData() . "', "; $sql .= "Connection_counter = Connection_counter + 1 "; $sql .= "WHERE Id = " . $_SESSION['user_id']; $req = execSQL($sql, "function", __FILE__, __FUNCTION__); } $return = array('Connected' => $connected, 'Activated' => $activated, 'Banned' => $banned, 'Registered' => $registered); return $return; }