X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fplatal.php;h=0824f2b137556e7ff761c55ea08c6e806a43ec15;hb=5d9d45a8e223225ea5c25b857cd5e11f1aabf6f7;hp=4ba474058f466e2f062b5bf97f5722d4d0bc4e96;hpb=eaf30d86cc99df2414cf4f171a9b0f11b0561e3b;p=platal.git diff --git a/modules/platal.php b/modules/platal.php index 4ba4740..0824f2b 100644 --- a/modules/platal.php +++ b/modules/platal.php @@ -39,7 +39,7 @@ class PlatalModule extends PLModule { return array( 'index' => $this->make_hook('index', AUTH_PUBLIC), - 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC), + 'cacert.pem' => $this->make_hook('cacert', AUTH_PUBLIC), 'changelog' => $this->make_hook('changelog', AUTH_PUBLIC), // Preferences thingies @@ -55,6 +55,7 @@ class PlatalModule extends PLModule 'password/smtp' => $this->make_hook('smtppass', AUTH_MDP), 'recovery' => $this->make_hook('recovery', AUTH_PUBLIC), 'exit' => $this->make_hook('exit', AUTH_PUBLIC), + 'review' => $this->make_hook('review', AUTH_PUBLIC), 'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC), ); } @@ -63,6 +64,8 @@ class PlatalModule extends PLModule { if (S::logged()) { pl_redirect('events'); + } else if (!@$GLOBALS['IS_XNET_SITE']) { + pl_redirect('review'); } } @@ -84,6 +87,7 @@ class PlatalModule extends PLModule $page->changeTpl('platal/changeLog.tpl'); $clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog')); + $clog = preg_replace('/=+\s*/', '
', $clog);
         // url catch only (not all wiki syntax)
         $clog = preg_replace(array(
             '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
@@ -96,6 +100,7 @@ class PlatalModule extends PLModule
           $clog);
         $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
         $clog = preg_replace('!vim:.*$!', '', $clog);
+        $clog = preg_replace("!(
(\\s|\n)*)?
(\s|\n)*
((\\s|\n)*
)?!m", "", "
$clog
"); $page->assign('ChangeLog', $clog); } @@ -417,6 +422,31 @@ Adresse de secours : " . Post::v('email') : "")); $page->changeTpl('platal/exit.tpl'); } } + + function handler_review(&$page, $action = null, $mode = null) + { + require_once 'wiki.inc.php'; + require_once dirname(__FILE__) . '/platal/review.inc.php'; + $dir = wiki_work_dir(); + $dom = 'Review'; + if (@$GLOBALS['IS_XNET_SITE']) { + $dom .= 'Xnet'; + } + if (!is_dir($dir)) { + $page->kill("Impossible de trouver le wiki"); + } + if (!file_exists($dir . '/' . $dom . '.Admin')) { + $page->kill("Impossible de trouver la page d'administration"); + } + $conf = preg_grep('/^text=/', explode("\n", file_get_contents($dir . '/' . $dom . '.Admin'))); + $conf = preg_split('/(text\=|\%0a)/', array_shift($conf), -1, PREG_SPLIT_NO_EMPTY); + $wiz = new PlWizard('Tour d\'horizon', 'core/plwizard.tpl', true); + foreach ($conf as $line) { + $list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY); + $wiz->addPage('ReviewPage', $list[0], $list[1]); + } + $wiz->apply($page, 'review', $action, $mode); + } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: