From c9178c75cab8a35b0aa4b4000708569f9f3359c4 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Thu, 13 Jul 2006 21:53:49 +0000 Subject: [PATCH] forgotten handler_ prefixes in auth.php 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 | 10 ++++++++-- modules/auth.php | 6 +++--- modules/core.php | 9 --------- modules/platal.php | 12 +++++++++++- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/classes/Platal.php b/classes/Platal.php index 098c0d8..46d0d4d 100644 --- a/classes/Platal.php +++ b/classes/Platal.php @@ -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); diff --git a/modules/auth.php b/modules/auth.php index b4e929e..a6cbdfd 100644 --- a/modules/auth.php +++ b/modules/auth.php @@ -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; diff --git a/modules/core.php b/modules/core.php index c6a5911..820fb60 100644 --- a/modules/core.php +++ b/modules/core.php @@ -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'); diff --git a/modules/platal.php b/modules/platal.php index 737d5ee..e4dd6c7 100644 --- a/modules/platal.php +++ b/modules/platal.php @@ -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'); -- 2.1.4