public function before() { $ret = parent::before(); $request = APF::get_instance()->get_request(); $cookiename = APF::get_instance()->get_config('AuthCookieName'); $cookie = @$request->get_cookie($cookiename); // 为flash上传做的改动 if (empty($cookie) || @$request->get_parameter('is_flash')) { $cookie = $request->get_parameter($cookiename); } $is_myself = self::is_auth($cookie); if (!$is_myself) { $oauth_config = APF::get_instance()->get_config('oauth', 'ldap'); $client_id = $oauth_config['client_id']; $oauth_url = $oauth_config['oauth_url']; header("HTTP/1.1 302 Found"); $array = array("client_id" => $client_id, "response_type" => "code"); header("Location: " . $oauth_url . '/authorize.php?' . http_build_query($array)); exit; } if ($ret != self::STEP_CONTINUE) { return $ret; } return self::STEP_CONTINUE; }
public function before() { $ret = parent::before(); $request = APF::get_instance()->get_request(); $cookiename = APF::get_instance()->get_config('AuthCookieName'); $cookie = @$request->get_cookie($cookiename); // 为flash上传做的改动 if (empty($cookie)) { $cookie = $request->get_parameter($cookiename); } $is_myself = self::is_auth($cookie); if (!$is_myself) { $request->set_user_id(0); $request->set_username('none'); } if ($ret != self::STEP_CONTINUE) { return $ret; } return self::STEP_CONTINUE; }