X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnet.php;h=9e24b3a71b1c7e3e130fa8321743328c991fb0ae;hb=285e2fe72d086ae94fc95696a0cefc8755113277;hp=c29ec14ed4a0d6481ea63dce3cc065025f74ff53;hpb=6995a9b92e68cffcf7a8375080f9e5a210acf0af;p=platal.git diff --git a/classes/xnet.php b/classes/xnet.php index c29ec14..9e24b3a 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'; + 'bandeau', + 'geoloc', + 'payment', + 'xnetevents', + 'xnetgrp', + 'xnetlists', + 'xnetnl' + ); + } + + 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: ?>