Welcome Guest, Not a member yet? Register   Sign In
Create an authentication library on 'Build a CMS in CodeIgniter' tutsplus
#2

[eluser]JoostV[/eluser]
Create an auth library. Make sure table name and credential field names (email, password) are dynamic. You can access $this->db things by fetching the CI superobject in your library with get_instance().

Code:
protected $tablename = 'users';
protected $loginfiels = 'email';
protected $passwordfield = 'password';

public function __construct() {
    $this->ci =& get_instance();
}

Have a look at IonAuth. Great library, and certainly worth while to learn from!
Also, on a real world project you are probably better of using a well developed library like IonAuth.


Messages In This Thread
Create an authentication library on 'Build a CMS in CodeIgniter' tutsplus - by El Forum - 09-16-2013, 04:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB