From 7a05c64ddc1db17c4ef5bf035a596612d9019928 Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Wed, 16 Jun 2010 00:32:26 +0200 Subject: [PATCH] Adds the url to authenticate in xnet from xorg (auth-groupex) in platal.conf --- classes/xnet.php | 7 ++++++- classes/xnetsession.php | 4 ++-- configs/platal.ini | 5 +++-- core | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/classes/xnet.php b/classes/xnet.php index 08e6163..be74a32 100644 --- a/classes/xnet.php +++ b/classes/xnet.php @@ -47,7 +47,12 @@ class Xnet extends Platal 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); } } diff --git a/classes/xnetsession.php b/classes/xnetsession.php index f642780..0ebc2e6 100644 --- a/classes/xnetsession.php +++ b/classes/xnetsession.php @@ -35,13 +35,13 @@ class XnetSession extends XorgSession } global $globals; - if (!S::logged()) { + if (!S::logged() && $globals->xnet->auth_baseurl) { // prevent connection to be linked to disconnection if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false) $returl = "http://{$_SERVER['SERVER_NAME']}".substr($_SERVER['REQUEST_URI'], 0, $i); else $returl = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; - $url = "https://www.polytechnique.org/auth-groupex"; + $url = $globals->xnet->auth_baseurl; $url .= "?session=" . session_id(); $url .= "&challenge=" . S::v('challenge'); $url .= "&pass=" . md5(S::v('challenge') . $globals->xnet->secret); diff --git a/configs/platal.ini b/configs/platal.ini index 517bccb..2e9f08a 100644 --- a/configs/platal.ini +++ b/configs/platal.ini @@ -83,5 +83,6 @@ per_page = 20 notif = "" [Xnet] -secret = "" -evts_domain = "" +secret = "" +evts_domain = "" +auth_baseurl = "" diff --git a/core b/core index 5fe3a77..bbeb39f 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 5fe3a77aecc4416235d5f017212a112e5929ee85 +Subproject commit bbeb39f78c0e4a7fbcc745c5c905de52d71f8b38 -- 2.1.4