cookie_name = 'siteAuth'; $this->cookie_time = (3600 * 24 * 100); $this->sitename=$sitename; $this->langID=$langID; if($_SESSION["lang"]=="")$_SESSION["lang"]="1"; if($_REQUEST["lang"]!="")$_SESSION["lang"]=$_REQUEST["lang"]; if($_SESSION["lang"]=="1" or $_SESSION["lang"]=="2"){ if($_SESSION["lang"]=="1") require_once("gms.languages/gr.php"); if($_SESSION["lang"]=="2") require_once("gms.languages/uk.php"); }else{ redirect("error.php?msg=Invalid Language Selected"); } } function usersLogin($userName, $userPassword,$post_autologin=""){ $userName= mysql_real_escape_string($userName); $userPassword= mysql_real_escape_string($userPassword); $sql="SELECT id,username,minor_tax,discount,name,email,tel,password FROM users WHERE (username='".mysql_real_escape_string($userName)."' OR email='".mysql_real_escape_string($userName)."') AND password = '".mysql_real_escape_string($userPassword)."' AND is_valid = '1'"; $q=executeQuery($sql); if($q[1]>0){ for($i=0; $i<$q[1]; $i++){ $row = mysql_fetch_row($q[0]); $_SESSION["member_user"]=$row[1]; $_SESSION["member_id"]=$row[0]; $_SESSION["userID"]=$row[0]; $_SESSION["userUSERNAME"]=$row[1]; $_SESSION["userMINORTAX"]=$row[2]; $_SESSION["userDISCOUNT"]=$row[3]; $_SESSION["userNAME"]=$row[4]; $_SESSION["userSITE"]=$_SESSION["siteUrl"]; $_SESSION["userEMAIL"]=$row[5]; $_SESSION["userTELEPHONE"]=$row[6]; $date = date("Y/m/d H:i:s"); $sql="UPDATE users SET u_last_login = 'now()' WHERE u_id = '".$row[0]."'"; mysql_query($sql); //$q=executeQuery($sql); if($post_autologin == "on") setcookie ($this->cookie_name, 'usr='.$userName.'&hash='.$userPassword, time() + $this->cookie_time); } }else{ if($post_autologin=="true") return "wrong_no_message"; return "wrong"; } }//end function function checkvalidusername($userName){ }//end function function checkvalidemail($email){ }//end function function doHtmlHeader($title,$meta,$thumb="",$flash=""){ //LoadNoCacheHeader(); //LoadCharSetHeader(); $this->title=$title; $this->meta=$meta; $username = $_POST['username']; $password = $_POST['password']; $post_autologin= $_POST['autologin']; $logout = $_POST['logout']; if($logout=="true"){ unset($_SESSION["member_user"]); unset($_SESSION["member_id"]); unset($_SESSION["userID"]); unset($_SESSION["userUSERNAME"]); unset($_SESSION["userMINORTAX"]); unset($_SESSION["userDISCOUNT"]); unset($_SESSION["userNAME"]); unset($_COOKIE[$this->cookie_name]); setcookie ($this->cookie_name,' ', time() - 1); } if(!$_SESSION["userID"]){ if(isset($this->cookie_name)){ if(isset($_COOKIE[$this->cookie_name])){ parse_str($_COOKIE[$this->cookie_name]); if(($usr) && ($hash)){ $rtn = $this->usersLogin($usr,$hash,"true"); } } } } if ($username&&$password) $rtn = $this->usersLogin($username, $password,$post_autologin); ?> Βελονισμός, ιατρικός βελονισμός | Ελληνική ιατρική εταιρεία βελονισμού Βελονισμός, ιατρικός βελονισμός |