X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnet.php;h=fe5f4210aedbe44592c1458d20dd28adf797abc7;hb=5271d7689c96e1eb12386bc89688aeeeb439eee7;hp=58d1375acd23e10e110042ef252312a8b418b2f1;hpb=8fc4efa394721853bca6ee0e4f2028f33ed0867d;p=platal.git diff --git a/classes/xnet.php b/classes/xnet.php index 58d1375..fe5f421 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'; - } - } + parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', + 'payment', 'bandeau', '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'; + if ($name == 'grp') { + global $globals; + if ($globals->asso()) { + return $globals->asso('shortname'); + } } - 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; - } - return null; + return null; } 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(&$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); } }