Adds the url to authenticate in xnet from xorg (auth-groupex) in platal.conf
authorPascal Corpet <pascal.corpet@m4x.org>
Tue, 15 Jun 2010 22:32:26 +0000 (00:32 +0200)
committerPascal Corpet <pascal.corpet@m4x.org>
Tue, 15 Jun 2010 22:32:26 +0000 (00:32 +0200)
classes/xnet.php
classes/xnetsession.php
configs/platal.ini
core

index 08e6163..be74a32 100644 (file)
@@ -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);
     }
 }
 
index f642780..0ebc2e6 100644 (file)
@@ -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);
index 517bccb..2e9f08a 100644 (file)
@@ -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 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 5fe3a77aecc4416235d5f017212a112e5929ee85
+Subproject commit bbeb39f78c0e4a7fbcc745c5c905de52d71f8b38