X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fxnet.php;h=74f1b74e9568df4b30d5af1a38762d8add25b644;hb=831ca5edb6ef4f5de006c7c1a015c8c43750ec10;hp=bb960448b6b6e4edcbd1cde3f44e0e05ae1ffd5a;hpb=e9e9306b81a5493276c9e817cdcd083a1add72e7;p=platal.git diff --git a/htdocs/xnet.php b/htdocs/xnet.php index bb96044..74f1b74 100644 --- a/htdocs/xnet.php +++ b/htdocs/xnet.php @@ -1,6 +1,6 @@ run(); exit; @@ -37,87 +33,7 @@ if (!($path = Env::v('n')) || substr($path, 0, 4) != 'Xnet') { /*** WIKI CODE ***/ -require_once 'wiki.inc.php'; - -$n = wiki_pagename(); -if (!$n) { - pl_redirect(''); -} - -new_skinned_page('wiki.tpl'); -$perms = wiki_get_perms($n); - -switch (Env::v('action')) { - case '': - wiki_apply_perms($perms[0]); - break; - - case 'edit': - wiki_apply_perms($perms[1]); - break; - - default: - wiki_apply_perms('admin'); - break; -} - -if ($p = Post::v('setrperms')) { - wiki_apply_perms('admin'); - if (wiki_set_perms($n, $p, $perms[1])) { - $perms = wiki_get_perms($n); - $page->trig('Permissions mises à jour'); - } -} - -if ($p = Post::v('setwperms')) { - wiki_apply_perms('admin'); - if (wiki_set_perms($n, $perms[0], $p)) { - $perms = wiki_get_perms($n); - $page->trig('Permissions mises à jour'); - } -} - -$wiki_cache = wiki_work_dir().'/cache_'.$n.'.tpl'; -$cache_exists = file_exists($wiki_cache); - -if (Env::v('action') || !$cache_exists) { - @unlink($wiki_cache); - - // we leave pmwiki do whatever it wants and store everything - ob_start(); - require_once($globals->spoolroot.'/wiki/pmwiki.php'); - - $wikiAll = ob_get_clean(); - // the pmwiki skin we are using (almost empty) has these keywords: - $i = strpos($wikiAll, ""); - $j = strpos($wikiAll, "", $i); -} - -if (Env::v('action')) { - $page->assign('xorg_extra_header', substr($wikiAll, 0, $i)); - $wikiAll = substr($wikiAll, $j); -} else { - if (!$cache_exists) { - $wikiAll = substr($wikiAll, $j); - wiki_putfile($wiki_cache, $wikiAll); - } else { - $wikiAll = file_get_contents($wiki_cache); - } -} - -$page->assign('perms', $perms); -$page->assign('perms_opts', wiki_perms_options()); - -$page->assign('canedit', wiki_may_have_perms($perms[1])); -$page->assign('has_perms', wiki_may_have_perms('admin')); - -$page->assign('wikipage', str_replace('.', '/', $n)); -$page->assign('pmwiki', $wikiAll); - -$page->addCssLink('wiki.css'); -$page->addJsLink('wiki.js'); - -$page->useMenu(); -$page->run(); +include 'wiki/engine.php'; +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>