mysql = &$dbHandle; $useragent = addslashes(getenv("HTTP_USER_AGENT")); $bots = array(); $bots[] = "Googlebot"; foreach($bots as $key=>$botname) { if(strpos($useragent, $botname) !== FALSE) { return (0); } } session_set_cookie_params( (60*60*24*365*8) ); session_start(); if(!isset($_SESSION['registered'])) { $_SESSION['registered'] = time(); $_SESSION['expires'] = time() + (6000000); $useragent = getenv("HTTP_USER_AGENT"); $sql = "INSERT IGNORE INTO ".TABLE."_visitortracking (sessionid, sess_create, sess_lasthit, sess_hitcount, useragent)"; $sql.= " VALUES ('".session_id()."', '".time()."', '".time()."', '1', '".addslashes($useragent)."');"; } else { if($_SESSION['expires'] < time()) { session_destroy(); } else { $_SESSION['expires'] = time() + (6000); $sql = "UPDATE ".TABLE."_visitortracking SET sess_hitcount = sess_hitcount +1, sess_lasthit =".time()." WHERE sessionid = '".session_id()."';"; } } if($sql != "") { $this->mysql->query($sql, __FILE__, __LINE__); } } function __destruct() { // proudly doin' nothing. } } ?>mysql = &$dbHandle; } function isAuthenticated() { // returns 0 if user is not authenticated. // returns 1 if user is authenticated. if($_SESSION['authenticated'] == 1) { if($_SESSION['expires'] < time()) { return(0); } else { return(1); } } else { return(0); } } function accountType() { $uid = $this->getUserId(); if($uid != 0) { $sql = "SELECT account_type FROM ".TABLE."_accounts WHERE rsid = $uid;"; $res = $this->mysql->query($sql, __FILE__, __LINE__); $avr = mysql_fetch_array($res); return($avr['account_type']); } else { return("guest"); } } function AuthenticateUser($username, $password) { $sql = "SELECT rsid FROM ".TABLE."_accounts WHERE username LIKE '$username' AND password = '".md5($password)."' AND is_deleted = 0;"; $res = $this->mysql->query($sql, __FILE__, __LINE__); $num = mysql_num_rows($res); if($num == 0) { return(0); }else{ $avr = mysql_fetch_array($res); $uid = $avr['rsid']; $sql = "UPDATE ".TABLE."_visitortracking SET userid = $uid WHERE sessionid = '".session_id()."';"; $this->mysql->query($sql, __FILE__, __LINE__); return($avr['rsid']); } } function getUserByName($username) { $sql = "SELECT rsid FROM ".TABLE."_accounts WHERE username LIKE '$username';"; $res = $this->mysql->query($sql, __FILE__, __LINE__); $avr = mysql_fetch_array($res); return(new User($this->mysql, $avr['rsid'])); } function getUsername($userid = -1) { if($userid == -1){ return("Gast"); } if($userid == 0) { $userid = $_SESSION['userid']; } if($userid == 0) { return("Gast"); } $sql = "SELECT username FROM ".TABLE."_accounts WHERE rsid = $userid AND $userid != 0;"; $res = $this->mysql->query($sql, __FILE__, __LINE__); $avr = mysql_fetch_array($res); return($avr['username']); } function getUserid() { if($this->isAuthenticated() == 1) { return($_SESSION['userid']); } else { return(0); } } function RequireAuthentication() { if($this->isAuthenticated() != 1) { // ACCESS DENIED die("ACCESS DENIED"); } } } ?>
Fatal error: Class 'RewriteEx' not found in /storage/www/vflveitsbronn/vfl-veitsbronn.ticktoo.com/html/index.php on line 33