Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class User_Full Extends Conectar
- {
- protected $_nick;
- protected $_pass;
- public function __construct($name, $pass)
- {
- $this->_nick = $name;
- $this->_pass = $pass;
- }
- public function Login()
- {
- if(empty($this->_nick or empty ($this->_pass))
- {
- header("Locantion: ".Conectar::ruta()."?acc=index&v=1");
- exit;
- }else{
- $pass_end = sha1($this->_pass, true);
- $pass_encript = base64_encode($pass_end);
- parent::Conect_LS();
- $sql_qry = sprintf
- (
- "SELECT name,password FROM account_data WHERE name=%s AND password=%s",
- parent::Anti_Sql($this->_nick),
- parent::Anti_Sql($pass_encript)
- );
- $res = mysql_query($sql_qry);
- if(mysql_num_rows($res == 0)
- {
- header("Locantion: ".Conectar::ruta()."?acc=index&v=2");
- exit;
- }else{
- if($reg = mysql_fetch_array($res))
- {
- $_SESSION["ses_nick"] = $reg[$this->_nick];
- $_SESSION["ses_pass"] = $reg[$pass_encript];
- header("Location: ".Conectar::ruta()."?acc=profile");
- exit;
- }
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement