X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnet.php;h=8df2ae34f888846c7f95becb05c531af8f08c8e3;hb=977168f6915e290cf8d9351651b9d8a0c908ac70;hp=b0bfe8b20b2e89f78682392298f98078e28dccb2;hpb=0783a5ed4d3409bcd7a7e1d908696159999810c8;p=platal.git diff --git a/classes/xnet.php b/classes/xnet.php index b0bfe8b..8df2ae3 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'; - } - } - } - - protected function find_nearest_key($key, array &$array) - { - global $globals; - if (in_array('%grp', array_keys($array)) && $key == $globals->asso('diminutif')) { - return '%grp'; - } - return parent::find_nearest_key($key, $array); + parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', + 'payment', 'bandeau', 'xnetnl'); } - public function near_hook() + public function hook_map($name) { - 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; } - public function pl_self($n = null) - { - global $globals; - return str_replace('%grp', $globals->asso('diminutif'), parent::pl_self($n)); - } - protected function find_hook() { $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(PlPage &$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); } }