X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fcore.php;h=adbcf38782e01543ceb89066ccb9eba2ff607273;hb=ec60dba7a82f71656896e0ea3acb4b74eafbb15c;hp=63d7d9ed1c3fb26a4abc645da9c56cd2d5eb321c;hpb=2a683f7ff213da0d2a2fdd26f88b2025394c91d6;p=platal.git diff --git a/modules/core.php b/modules/core.php index 63d7d9e..adbcf38 100644 --- a/modules/core.php +++ b/modules/core.php @@ -31,6 +31,7 @@ class CoreModule extends PLModule 'purge_cache' => $this->make_hook('purge_cache', AUTH_COOKIE, 'admin'), 'kill_sessions' => $this->make_hook('kill_sessions', AUTH_COOKIE, 'admin'), 'sql_errors' => $this->make_hook('sqlerror', AUTH_COOKIE, 'admin'), + 'assert_errors' => $this->make_hook('asserterror', AUTH_COOKIE, 'admin'), 'wiki_help' => $this->make_hook('wiki_help', AUTH_PUBLIC), 'wiki_preview' => $this->make_hook('wiki_preview', AUTH_COOKIE, 'user', NO_AUTH), @@ -188,6 +189,19 @@ class CoreModule extends PLModule $page->trigSuccess("Erreurs MySQL effacées."); } } + + function handler_asserterror(&$page) { + global $globals; + $page->coreTpl('assert_errors.tpl'); + $file = @file_get_contents($globals->spoolroot . '/spool/tmp/assert_errors'); + if ($file !== false) { + $page->assign('errors', utf8_encode($file)); + } + if (Post::has('clear')) { + @unlink($globals->spoolroot . '/spool/tmp/assert_errors'); + $page->trigSuccess("Erreurs d'assertion effacées."); + } + } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: