Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]ChrisMiller[/eluser]
Hey,

Firstly good job with the Library & Documentation, very good documentation and I can almost always find what I am looking for without searching to much but have one suggestion for it. One Suggestion is to add more to the section for function "get_user()" that actually shows what the return object is so its easier then having to dump it out and then pick through it to find what is what. Luckily I have nothing better to do so here ya go...
Code:
stdClass Object (
    [id] => 1
    [group_id] => 1
    [ip_address] => 127.0.0.1
    [username] => administrator
    [password] => 59beecdf7fc966e2f17fd8f65a4a9aeb09d4a3d4
    [salt] => 9462e8eee0
    [email] => [email protected]
    [activation_code] => 19e181f2ccc2a7ea58a2c0aa2b69f4355e636ef4
    [forgotten_password_code] => 81dce1d0bc2c10fbdec7a87f1ff299ed7e4c9e4a
    [remember_code] => 9d029802e28cd9c768e8e62277c0df49ec65c48c
    [created_on] => 1268889823
    [last_login] => 1279464628
    [active] => 0
    [group] => admin
    [group_description] => Administrator
    [first_name] => Admin
    [last_name] => Account
    [company] => Some Corporation
    [phone] => (123)456-7890
)

Also could you maybe add a function for accessing the current logged in users information instead of having to call the get_user() function... Example being....
Code:
/**
* Get User Item
*
* @return string
* @author Chris Miller <[email protected]>
**/
public function get_user_item( $item=false, $id=0 ) {

    // Do we have a Valid Request????
    if ($item===false) return;
        
        
    // Does our User Obj Exist?? If no set it.
    if (!isset($this->user_obj[$id])){
        $this->user_obj[$id] = $this->get_user((($id==0) ? false : $id));
    }
        
    // Be nice and return requested Item or false if non-existant
    return (isset($this->user_obj[$id]->$item)) ? $this->user_obj[$id]->$item : false;
}

EXAMPLE USAGE:
$this->ion_auth->get_user_item('email'); // Returns Current Logged in User Email
$this->ion_auth->get_user_item('id');    // Returns Current Logged in Users ID
$this->ion_auth->get_user_item('email',2); // Returns User ID #2's email address
$this->ion_auth->get_user_item('fake_item'); // Returns (bool) false... non-existant
Just a Suggestion, alot of other libraries have it and is useful at times like when I only need the ID so I can put it in the database when the post something. The function also stores the request to prevent excessive calls back to the get_user() function.

Finially, You have the function "email_check()" twice in the documentation the second time it should say "identity_check()" you have the example correct just wrong title.

Thanks Again,
Chris


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 07-19-2010, 09:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB