Welcome Guest, Not a member yet? Register   Sign In
md5 to sha1
#6

[eluser]clintonbeattie[/eluser]
Mmmm. I think I'm understanding. Thanks again. So how would my previous function be written to check if the SHA1'd password is in the database?

Here is my original code...

Code:
class Membership_model extends Model {


    function validate()
    {
        $this->db->where('username', $this->input->post('username'));
        $this->db->where('password', md5($this->input->post('password')));  
        $query = $this->db->get('membership');
        
        if($query->num_rows == 1)
        {
            return true;
        }
        
    }
    
    function create_member()
    {
        
        $new_member_insert_data = array(
            'first_name' => $this->input->post('first_name'),
            'last_name' => $this->input->post('last_name'),
            'email_address' => $this->input->post('email_address'),            
            'username' => $this->input->post('username'),
            'password' => md5($this->input->post('password'))                        
        );
        
        $insert = $this->db->insert('membership', $new_member_insert_data);
        return $insert;
    }
}


Messages In This Thread
md5 to sha1 - by El Forum - 10-19-2009, 11:24 AM
md5 to sha1 - by El Forum - 10-19-2009, 12:14 PM
md5 to sha1 - by El Forum - 10-19-2009, 12:17 PM
md5 to sha1 - by El Forum - 10-19-2009, 12:28 PM
md5 to sha1 - by El Forum - 10-19-2009, 12:42 PM
md5 to sha1 - by El Forum - 10-19-2009, 12:47 PM
md5 to sha1 - by El Forum - 10-19-2009, 03:07 PM
md5 to sha1 - by El Forum - 10-20-2009, 12:13 PM
md5 to sha1 - by El Forum - 10-21-2009, 01:07 AM
md5 to sha1 - by El Forum - 10-21-2009, 02:24 AM
md5 to sha1 - by El Forum - 10-21-2009, 11:11 AM
md5 to sha1 - by El Forum - 10-21-2009, 12:13 PM
md5 to sha1 - by El Forum - 10-22-2009, 11:36 AM
md5 to sha1 - by El Forum - 10-22-2009, 04:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB