Welcome Guest, Not a member yet? Register   Sign In
Best way to handle passwords using CI library?
#3

[eluser]wiredesignz[/eluser]
Mine is almost identical to xwero

Code:
function try_login($attempt)    //$attempt is an object
{        
    if ($attempt->password)    
    {
        //find user, check password & create cookie if valid
        if ($user = $this->users->findBy("`username` = '{$attempt->username}'") AND $attempt->password == $this->encrypt->decode($user->password))    
        {
            set_cookie('ci_user', $user->uid, 0); //cookie expires on browser close
            if ($attempt->remember) set_cookie('ci_login', $user->uid, 86500);
            return TRUE;
        }
    }
    return FALSE;
}


Messages In This Thread
Best way to handle passwords using CI library? - by El Forum - 02-14-2008, 08:01 PM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 12:47 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 12:53 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 05:44 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 06:03 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 06:16 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 06:20 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 06:25 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 06:27 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 06:29 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 06:48 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 07:06 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 07:07 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 07:25 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 07:31 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 07:52 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 08:28 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 08:48 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 11:29 AM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 12:22 PM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 11:17 PM
Best way to handle passwords using CI library? - by El Forum - 02-15-2008, 11:32 PM
Best way to handle passwords using CI library? - by El Forum - 02-16-2008, 01:33 AM
Best way to handle passwords using CI library? - by El Forum - 02-16-2008, 02:15 AM
Best way to handle passwords using CI library? - by El Forum - 02-16-2008, 02:31 AM
Best way to handle passwords using CI library? - by El Forum - 02-16-2008, 02:37 AM
Best way to handle passwords using CI library? - by El Forum - 03-06-2008, 08:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB