コード例 #1
0
ファイル: function.php プロジェクト: slumbersoul/gnw-weixin
function is_auth_or_redirect($redirect = null)
{
    $is_auth = is_auth();
    if (empty($redirect)) {
        $redirect = "/login";
    }
    if (!empty($redirect) && false == $is_auth) {
        if (stripos($redirect, 'login')) {
            web_setcookie('__webref', current_url(), null, '/');
        }
        header("Location: " . $redirect);
        exit;
    }
    return $is_auth;
}
コード例 #2
0
ファイル: storage.php プロジェクト: slumbersoul/gnw-weixin
 public function clear()
 {
     web_setcookie(self::AUTH_COOKIE_KEY, null, null, '/');
     web_setcookie(self::AUTH_MASTER_COOKIE_KEY, null, null, '/');
     $this->_isEmpty = true;
     $this->_session = null;
     $this->_sign = null;
     $this->_adminId = null;
 }