This functions are for internal use only (mostly for the wiki engine).
when developping an handler, you MUST return PL_FORBIDDEN or PL_NOT_FOUND to
generate the corresponding error.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
$page->run();
}
+ public function error403()
+ {
+ $page =& self::page();
+
+ $this->__mods['core']->handler_403($page);
+ $page->assign('platal', $this);
+ $page->run();
+ }
+
+ public function error404()
+ {
+ $page =& self::page();
+
+ $this->__mods['core']->handler_404($page);
+ $page->assign('platal', $this);
+ $page->run();
+ }
+
public function on_subscribe($forlife, $uid, $promo, $pass)
{
$args = func_get_args();
$user = Platal::session()->tokenAuth($login, $token);
if (empty($user)) {
if ($require_auth) {
- $page->kill("Authentication required");
+ return PL_FORBIDDEN;
} else {
$user = null;
}
$wikiAll = "<p>La page de wiki $n n'existe pas. "
. "Il te suffit de <a href='" . str_replace('.', '/', $n) . "?action=edit'>l'éditer</a></p>";
} else {
- $page->coreTpl('404.tpl');
+ global $platal;
+ $platal->error404();
}
}