Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_user inconsistence #50

Open
helpse opened this issue Sep 22, 2014 · 1 comment
Open

get_user inconsistence #50

helpse opened this issue Sep 22, 2014 · 1 comment

Comments

@helpse
Copy link

helpse commented Sep 22, 2014

At this file:
https://github.com/open-classifieds/common/blob/master/classes/auth/oc.php

 /**
 * Gets the currently logged in user from the session (with auto_login check).
 * Returns FALSE if no user is currently logged in.
 *
 * @return  mixed
 */
public function get_user($default = NULL)
{
    $user = parent::get_user($default);

    if ( ! $user)
    {
        // check for "remembered" login
        $user = $this->auto_login();
    }

    return $user;
}

parent::get_user() is returning NULL by default and auto_login() is returning FALSE.
We should use public function get_user($default = FALSE) to get a consitency.

@neo22s
Copy link
Contributor

neo22s commented Sep 23, 2014

I agree! this also meas a bit of refactor for each time we do ``if (Auth::instance()->get_user()`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants