• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PhPass Login Password Check - Help !

#1
[eluser]sanguina[/eluser]
Using Phpass library to handle password hashing and am stuck at the login password check.

The official PhPass documentation suggests the following
Code:
// example 2: checking a password
$user = $this->user_model->get(123);
$hashed = $user->password;
$password = $this->input->post('password');
if ($this->phpass->check($password, $hashed))
    echo 'logged in';
else
    echo 'wrong password';

And I am doing this (simplified version):
Code:
function login($email, $password)
{
$query = $this->db->get_where( 'users', array('email' => $email));
$row = $query->row();
$hashed = $row->password;
$this->load->library('phpass');
if ($this->phpass->check($password, $hashed))  {echo 'logged in';}
        else { echo 'wrong password'}
         }

Without hashing my structure works fine but after hashing - this password check is not letting me in.

Any help would be greatly appreciated :bug:


Messages In This Thread
PhPass Login Password Check - Help ! - by El Forum - 08-09-2012, 07:00 PM
PhPass Login Password Check - Help ! - by El Forum - 08-09-2012, 09:57 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.