Allow to customize the login page in handler_groupex.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Wed, 10 Aug 2011 22:50:51 +0000 (00:50 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Thu, 8 Sep 2011 23:14:46 +0000 (01:14 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
modules/auth.php

index d973cd5..85d86d0 100644 (file)
@@ -31,7 +31,7 @@ class AuthModule extends PLModule
 
             'auth-redirect.php'             => $this->make_hook('redirect',           AUTH_COOKIE, 'user'),
             'auth-groupex.php'              => $this->make_hook('groupex_old',        AUTH_COOKIE, 'user'),
-            'auth-groupex'                  => $this->make_hook('groupex',            AUTH_COOKIE, 'user'),
+            'auth-groupex'                  => $this->make_hook('groupex',            AUTH_PUBLIC),
             'admin/auth-groupes-x'          => $this->make_hook('admin_authgroupesx', AUTH_MDP,    'admin'),
         );
     }
@@ -118,8 +118,12 @@ class AuthModule extends PLModule
      */
     function handler_groupex($page, $charset = 'utf8')
     {
+        if (!S::logged()) {
+            $page->assign('referer', true);
+            return PL_DO_AUTH;
+        }
+
         $this->load('auth.inc.php');
-        $page->assign('referer', true);
 
         $gpex_pass = Get::s('pass');
         $gpex_url  = urldecode(Get::s('url'));