Example #1
0
/**
 * Return true if there is a currently logged in and authenticated user, false otherwise
 *
 * @param boolean auto-login anonymous user
 * @return bool
 * @access public
 */
function auth_is_user_authenticated()
{
    global $g_cache_cookie_valid, $g_login_anonymous;
    if ($g_cache_cookie_valid == true) {
        return $g_cache_cookie_valid;
    }
    $g_cache_cookie_valid = auth_is_cookie_valid(auth_get_current_user_cookie($g_login_anonymous));
    return $g_cache_cookie_valid;
}
function auth_is_user_authenticated()
{
    return auth_is_cookie_valid(auth_get_current_user_cookie());
}