X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnet.php;h=be74a32793ec0b0364f3c65f89e30562b7283e47;hb=c76545c351fae4e2298624ff9ee5bf854dc5a5b6;hp=3d5dbb19d0e2735b56435fe331546691ba1f0d04;hpb=42a50827dc2ac2b13ddaf77ea16c0989cd8b960d;p=platal.git diff --git a/classes/xnet.php b/classes/xnet.php index 3d5dbb1..be74a32 100644 --- a/classes/xnet.php +++ b/classes/xnet.php @@ -1,6 +1,6 @@ asso()) { - if ($p = strpos($this->path, '/')) { - $this->ns = substr($this->path, 0, $p).'/'; - $this->path = '%grp'.substr($this->path, $p); - } else { - $this->ns = $this->path.'/'; - $this->path = '%grp'; + public function hook_map($name) + { + if ($name == 'grp') { + global $globals; + if ($globals->asso()) { + return $globals->asso('shortname'); } } + return null; } - function find_hook() + protected function find_hook() { $ans = parent::find_hook(); - if ($ans && $this->ns) { - $this->path = $this->ns . substr($this->path, 5); - $this->argv[0] = $this->ns . substr($this->argv[0], 5); - } + $this->https = false; return $ans; } - function force_login(&$page) + public function force_login(PlPage &$page) { - http_redirect(S::v('loginX')); + $redirect = S::v('loginX'); + if (!$redirect) { + $page->trigError('Impossible de s\'authentifier. Problème de configuration de plat/al.'); + return; + } + http_redirect($redirect); } } +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>