app = $app; return $this; } /** * Redirect to the correct guest location * * @return gatekeeper */ protected function give_guest_access() { $request = http_request::getInstance(); $parm = $request->get_parms('nolog', 'redirect'); if (!is_null($parm['nolog']) && phrasea::guest_allowed($this->app)) { try { $auth = new Session_Authentication_Guest($this->app); $this->app->openAccount($auth); } catch (Exception $e) { $url = '/login/?redirect=' . $parm['redirect'] . '&error=' . urlencode($e->getMessage()); phrasea::redirect($url); } phrasea::redirect('/' . $this->_directory . '/'); } return $this; } /** * Checks if session is open * Redirect if session is missing * * @return Void */ public function require_session() { if ($this->app->isAuthenticated()) { return true; } phrasea::headers(403); return; } }