Moving to GitHub.
[platal.git] / modules / xnet.php
index 6964996..a1bba73 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -27,6 +27,7 @@ class XnetModule extends PLModule
             'index'        => $this->make_hook('index',        AUTH_PUBLIC),
             'exit'         => $this->make_hook('exit',         AUTH_PUBLIC),
 
+            'login'        => $this->make_hook('login',        AUTH_COOKIE, 'groups'),
             'admin'        => $this->make_hook('admin',        AUTH_PASSWD, 'admin'),
             'groups'       => $this->make_hook('groups',       AUTH_PUBLIC),
             'groupes.php'  => $this->make_hook('groups2',      AUTH_PUBLIC),
@@ -40,6 +41,14 @@ class XnetModule extends PLModule
         );
     }
 
+    function handler_login()
+    {
+        // We require different credentials for '/login/' ("groups" instead of "user").
+        // We have to redirect the call to the actual CoreModule->handler_login.
+        $args = func_get_args();
+        return call_user_func_array(array("CoreModule", "handler_login"), $args);
+    }
+
     function handler_photo($page, $x = null)
     {
         if (!$x || !($profile = Profile::get($x))) {
@@ -293,5 +302,5 @@ class XnetModule extends PLModule
     }
 }
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>