public function set_session() { $this->sessions('abc', $this->in_vars('abc')); if ($this->is_vars('redirect')) { \org\rhaco\net\http\Header::redirect($this->in_vars('redirect')); } }
private function redirect($apps, $url, $args = array()) { if (strpos($url, '://') !== false) { \org\rhaco\net\http\Header::redirect($url); } foreach ($apps as $m) { if (isset($m['name']) && $m['name'] == $url) { \org\rhaco\net\http\Header::redirect(empty($args) ? $m['format'] : vsprintf($m['format'], $args)); } } throw new \InvalidArgumentException('map `' . $url . '` not found'); }
/** * ログアウト * @arg string $logout_redirect ログアウト後にリダイレクトされるマップ名 * @automap */ public function do_logout() { /** * ログアウト前処理 * @param self $this */ $this->object_module('before_do_logout', $this); $this->rm_sessions('logined_redirect_to'); $this->logout(); if ($this->map_arg('logout_redirect') !== null) { $redirect = $this->map_arg('logout_redirect'); foreach ($this->maps as $m) { if ($m['name'] == $redirect) { \org\rhaco\net\http\Header::redirect($m['format']); } } } foreach ($this->package_maps as $k => $m) { if ($m['method'] == 'index' && strpos($m['format'], '%s') === false) { \org\rhaco\net\http\Header::redirect($m['format']); } } $this->vars('login', $this->is_login()); }