Id = $dr[0]; $this->Username = $dr[1]; $this->Active= $dr[7]; $this->Banned = $dr[8]; $this->JoinDate = $dr[12]; $this->ProfileImage = $dr[14]; $this->Motto = $dr[15]; $this->Exp = $dr[16]; $this->SkwPoints = $dr[17]; $this->LastBlog = $dr[18]; $this->LastProd = $dr[19]; $this->LastDl = $dr[20]; $this->LastDoc = $dr[21]; $this->AllowPMs = $dr[22]; } } class UserModel { public $Id = 0; public $LoggedIn = 0; public $Username = ""; public $FirstName = ""; public $LastName = ""; public $Email= ""; public $Active= 0; public $Banned = 0; public $CanPost = 0; public $IsAdmin = 0; public $GetUpdates = 0; public $JoinDate = ""; public $ReadUpTo = -1; public $ProfileImage = "unknown.jpg"; public $Motto = ""; public $Exp = 0; public $SkwPoints = 0; public $LastBlog = ""; public $LastProd = ""; public $LastDL = ""; public $LastDoc = ""; public $AllowPMs = ""; public function __construct() { if ($_SESSION['ID'] != "") $this->loadUser(dbSelSingleRow("SELECT * from users WHERE id='" . $_SESSION['ID'] . "'")); else autoLogin(); } public function toArray() { return (array) $this; } public function Login($username, $md5Password) { $sql = "SELECT * from users WHERE username='" . $username . "' AND password='" . $md5Password . "'"; $dr = dbSelSingleRow($sql); if ($dr == null) { $sql = "SELECT * from users WHERE email='" . $username . "' AND password='" . $md5Password . "'"; $dr = dbSelSingleRow($sql); if ($dr == null) return 0; } //if($dr[7] == "0" || $dr[8] == "1") //{ // logout(); // header('location: /locked/' . genRand2(8) . $dr[0]); // return 0; //} $_SESSION['ID'] = $dr[0]; //$_SESSION['USER'] = $dr[1]; //$_SESSION['email'] = $dr[4]; //$_SESSION['pwd'] = $dr[5]; setcookie("skw13usr", $dr[1], time()+3600*24*30); /* expire in 30 days */ setcookie("skw13pwd", $dr[5], time()+3600*24*30); /* expire in 30 days */ $this->loadUser($dr); return 1; } private function autoLogin() { if ($_COOKIE["skw13usr"] == '') return 0; if (Login($_COOKIE["skw13usr"], $_COOKIE["skw13pwd"]) == 1) { setcookie("skw13usr", $_COOKIE["skw13usr"], time()+3600*24*30); /* expire in 30 days */ setcookie("skw13pwd", $_COOKIE["skw13pwd"], time()+3600*24*30); /* expire in 30 days */ return 1; } return 0; } private function loadUser($dr) { $this->LoggedIn = 1; $this->Id = $dr[0]; $this->Username = $dr[1]; $this->FirstName = $dr[2]; $this->LastName = $dr[3]; $this->Email= $dr[4]; $this->Active= $dr[7]; $this->Banned = $dr[8]; $this->CanPost = $dr[9]; $this->IsAdmin = $dr[10]; $this->GetUpdates = $dr[11]; $this->JoinDate = $dr[12]; $this->ReadUpTo = $dr[13]; $this->ProfileImage = $dr[14]; $this->Motto = $dr[15]; $this->Exp = $dr[16]; $this->SkwPoints = $dr[17]; $this->LastBlog = $dr[18]; $this->LastProd = $dr[19]; $this->LastDl = $dr[20]; $this->LastDoc = $dr[21]; $this->AllowPMs = $dr[22]; } } ?>
Fatal error: Class 'UserModel' not found in /home/staged10/public_html/skewworks.com/index.php on line 6