X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fcore.php;h=dad9b021b8f09dadada16e88546d492598ad5952;hb=d7610c358d074c78e1e8dc25fe0cf0e5e7e1c55e;hp=f5bac89a897b2370c000f01ef21f0d3fdc7f723e;hpb=05d5ce155e474db3f3cd0901f16aac0c3dce48ca;p=platal.git diff --git a/modules/core.php b/modules/core.php index f5bac89..dad9b02 100644 --- a/modules/core.php +++ b/modules/core.php @@ -37,6 +37,7 @@ class CoreModule extends PLModule 'valid.html' => $this->make_hook('valid', AUTH_PUBLIC), 'favicon.ico' => $this->make_hook('favicon', AUTH_PUBLIC), + 'robots.txt' => $this->make_hook('robotstxt', AUTH_PUBLIC, 'user', NO_HTTPS), ); } @@ -77,9 +78,23 @@ class CoreModule extends PLModule exit; } + function handler_robotstxt(&$page) + { + global $globals; + if (!$globals->core->restricted_platal) { + return PL_NOT_FOUND; + } + + header('Content-Type: text/plain'); + echo "User-agent: *\n"; + echo "Disallow: /\n"; + exit; + } + function handler_purge_cache(&$page) { require_once 'wiki.inc.php'; + S::assert_xsrf_token(); $page->clear_compiled_tpl(); wiki_clear_all_cache(); @@ -99,10 +114,10 @@ class CoreModule extends PLModule } if (isset($_SESSION['log'])) { - $_SESSION['log']->log("suid_start", "login by ".S::v('forlife')); + S::logger()->log("suid_start", "login by ".S::v('forlife')); } - $_SESSION['suid'] = $_SESSION; - $_SESSION['perms'] =& XorgSession::make_perms($level); + Platal::session()->startSUID(S::i('uid')); + Platal::session()->makePerms($level); pl_redirect('/'); } @@ -113,6 +128,8 @@ class CoreModule extends PLModule $page->changeTpl('core/bug.tpl', SIMPLE); $page->addJsLink('close_on_esc.js'); if (Env::has('send') && trim(Env::v('detailed_desc'))) { + S::assert_xsrf_token(); + $body = wordwrap(Env::v('detailed_desc'), 78) . "\n\n" . "----------------------------\n" . "Page : " . Env::v('page') . "\n\n" @@ -128,7 +145,7 @@ class CoreModule extends PLModule $mymail->setTxtBody($body); $mymail->send(); } elseif (Env::has('send')) { - $page->trig("Merci de remplir une explication du problème rencontré"); + $page->trigError("Merci de remplir une explication du problème rencontré"); } }