Welcome Guest, Not a member yet? Register   Sign In
Login with the encryption class
#1

[eluser]PQMailer[/eluser]
Hello,

I have a little problem. I want to use the encryption class to encode the mail addresses and the passwords in the database. I want to check the login with the email address. But the encryption class always generates an other encoded string. To check if the e-mail address exists i found a solution. I wanted to use something like this.

Code:
$this->db->select('email');
$control = $this->db->get('users')->result_array();
$email_decode = array();
foreach($control as $value):
array_push($email_decode, $this->encrypt->decode($value['email']));
endforeach;
if( ! in_array($input['email'], $email_decode)){
echo $this->lang->line('login_wrong_email');
exit;
}


But how can i check the password ? Because i can't use something like this, if the mail address is encoded.

Code:
$email = $input['email'];
$query = $this->db->get_where('users', array('email' => $email));
$row = $query->row();
if($row->password != $input['password']){
echo $this->lang->line('login_wrong_password');
exit;
}

Do anyone have an idea how a login with the encryption class can be realized ?


Messages In This Thread
Login with the encryption class - by El Forum - 04-20-2011, 03:47 AM
Login with the encryption class - by El Forum - 04-20-2011, 04:44 AM
Login with the encryption class - by El Forum - 04-20-2011, 06:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB