forgotten handler_ prefixes in auth.php
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 13 Jul 2006 21:53:49 +0000 (21:53 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 13 Jul 2006 21:53:49 +0000 (21:53 +0000)
make 'index' be called when path is empty, and put it in platal module.

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@468 839d8a87-29fc-0310-9880-83ba4fa771e5

classes/Platal.php
modules/auth.php
modules/core.php
modules/platal.php

index 098c0d8..46d0d4d 100644 (file)
@@ -48,6 +48,11 @@ class Platal
         }
     }
 
+    function set_index_module($mod)
+    {
+        $this->__idx = $mod;
+    }
+
     function find_hook()
     {
         $p = $this->path;
@@ -100,8 +105,9 @@ class Platal
         new_skinned_page('index.tpl', AUTH_PUBLIC);
 
         if (empty($this->path)) {
-            $this->__mods['core']->handler_index($page);
-        } else
+            $this->path = 'index';
+        }
+
         switch ($this->call_hook($page)) {
           case PL_FORBIDDEN:
             $this->__mods['core']->handler_403($page);
index b4e929e..a6cbdfd 100644 (file)
@@ -37,14 +37,14 @@ class AuthModule extends PLModule
         );
     }
 
-    function chall(&$page)
+    function handler_chall(&$page)
     {
         $_SESSION["chall"] = uniqid(rand(), 1);
         echo $_SESSION["chall"] . "\n" . session_id();
         exit;
     }
 
-    function econf(&$page)
+    function handler_econf(&$page)
     {
         global $globals;
 
@@ -97,7 +97,7 @@ class AuthModule extends PLModule
         exit;
     }
 
-    function manageurs(&$page)
+    function handler_manageurs(&$page)
     {
         global $globals;
 
index c6a5911..820fb60 100644 (file)
@@ -38,15 +38,6 @@ class CoreModule extends PLModule
         exit;
     }
 
-    function handler_index(&$page)
-    {
-        if (logged()) {
-            redirect("events");
-        }
-
-        return PL_OK;
-    }
-
     function handler_403(&$page)
     {
         header('HTTP/1.0 403 Forbidden');
index 737d5ee..e4dd6c7 100644 (file)
@@ -38,7 +38,8 @@ class PlatalModule extends PLModule
     function handlers()
     {
         return array(
-            'cacert.pem'  => $this->make_hook('cacert', AUTH_PUBLIC),
+            'index'       => $this->make_hook('index',     AUTH_PUBLIC),
+            'cacert.pem'  => $this->make_hook('cacert',    AUTH_PUBLIC),
             'changelog'   => $this->make_hook('changelog', AUTH_PUBLIC),
 
             // Preferences thingies
@@ -60,6 +61,15 @@ class PlatalModule extends PLModule
         );
     }
 
+    function handler_index(&$page)
+    {
+        if (logged()) {
+            redirect("events");
+        }
+
+        return PL_OK;
+    }
+
     function handler_cacert(&$page)
     {
         $data = file_get_contents('/etc/ssl/xorgCA/cacert.pem');