Advertisement
maartenvr98

Login class [error]

Sep 15th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. $db_file = SITE_ROOT . 'core/classes/db/Db.class.php';
  2.  
  3. if(is_file($db_file)) {
  4.     require_once($db_file);
  5. }
  6. else {
  7.     die(ERROR_MSG);
  8. }
  9.  
  10. class Login {
  11.    
  12.     protected $username;
  13.     protected $password;
  14.    
  15.     public function __constuct($username, $password) {
  16.         $this->db = new Db();
  17.         $this->username = $username;
  18.         $this->password = $password;
  19.     }
  20.    
  21.     private function Encrypt($password, $method, $salt = NULL) {
  22.         $hashed = hash($method, $password . $salt);
  23.         return $hashed;
  24.     }
  25.    
  26.     private function Credentialscheck() {
  27.         return true;
  28.     }
  29.    
  30.     public function Login() {
  31.         $epass = Encrypt($this->password, 'sha256', '-N9TT-9G0A-B7FQ-RANC');
  32.         return $epass;
  33.     }
  34.    
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement