X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnet.php;h=1251ba6697c11e8d20e72b928321a59b8bb24dc1;hb=27492fde1b530ce8631dea8b408e7e09231d966a;hp=bc30b178e960678c136410c7347f7ddca4d01e2e;hpb=08fa70684fd1332178cddb6b318151335fb4506c;p=platal.git diff --git a/classes/xnet.php b/classes/xnet.php index bc30b17..1251ba6 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' + ); } - protected function find_nearest_key($key, array &$array) + public function hook_map($name) { - global $globals; - if (in_array('%grp', array_keys($array)) && $key == $globals->asso('diminutif')) { - return '%grp'; - } - return parent::find_nearest_key($key, $array); - } - - public function near_hook() - { - global $globals; - $link = str_replace('%grp', $globals->asso('diminutif'), parent::near_hook()); - if ($link != $this->path) { - return $link; + if ($name == 'grp') { + global $globals; + if ($globals->asso()) { + return $globals->asso('shortname'); + } } return null; } @@ -61,18 +51,19 @@ class Xnet extends Platal { $ans = parent::find_hook(); $this->https = false; - if ($ans && $this->ns) { - $this->path = $this->ns . substr($this->path, 5); - $this->argv[0] = $this->ns . substr($this->argv[0], 5); - } return $ans; } - public 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: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>