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

[eluser]kimo_gusatava[/eluser]
hmmm I think i need to expand that further:

Code:
public function is_current_user($id=false) {
        $user = $this->get_user($id);
        if(sizeof($user)>0) {
            return ($user->id == $this->ci->session->userdata("id") && $id ) ? true: false;
        } else {
            return false;
        }
    }

so I can just call it like this :

Code:
public function view($id) {
        if($this->ion_auth->is_current_user($id)) {
            // display profile with editing options or a dashed board;
        } else {
            // display as other users or a front page or anything else;
        }
        
        
    }


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 06-29-2011, 10:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB