X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnet.php;h=6dc2e237f5ffa89dd98a5ab3b247dbd3bbe672a8;hb=22771578c2d44fe4488546116a84e1561f083ed7;hp=c221c450ed9fc8ac5b2e4b804769cad158adcf4c;hpb=409de7a72aeb2cef7abfa7dbb4c3a8289e2312f9;p=platal.git diff --git a/classes/xnet.php b/classes/xnet.php index c221c45..6dc2e23 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'; - } - } - } - - function find_nearest_key($key, &$array) - { - global $globals; - $k = parent::find_nearest_key($key, $array); - if (is_null($k) && in_array('%grp', array_keys($array)) && $globals->asso()) { - return '%grp'; - } - return $k; + parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', + 'payment', 'bandeau', 'xnetnl', 'geoloc'); } - function list_hooks() + public function hook_map($name) { - $link = parent::list_hooks(); - if (strpos($link, '%grp') !== false) { + if ($name == 'grp') { global $globals; - return str_replace('%grp', $globals->asso('diminutif'), $link); + if ($globals->asso()) { + return $globals->asso('shortname'); + } } - return $link; + 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: ?>