<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2010 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
$cache_exists = file_exists($wiki_cache);
if (Env::v('action') || !$cache_exists) {
if ($cache_exists && !$feed) {
- unlink($wiki_cache);
+ $wp->removePageCache();
+ $cache_exists = false;
}
// we leave pmwiki do whatever it wants and store everything
file_put_contents($wiki_cache, $wikiAll);
} elseif ($cache_exists) {
$wikiAll = file_get_contents($wiki_cache);
- } elseif (S::has_perms()) {
+ } elseif (S::admin()) {
$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();
}
}
$page->assign('perms_opts', PlWikiPage::permOptions());
$page->assign('canedit', $wp->canWrite());
-$page->assign('has_perms', S::has_perms());
+$page->assign('has_perms', S::admin());
$page->assign('wikipage', str_replace('.', '/', $n));
if (!$feed && $wp->writePerms() == 'admin' && !Env::v('action') && $wiki_exists) {
if (!Env::v('action')) {
$url = '/' . str_replace('.', '/', $n) . '?action=rss';
if (S::logged()) {
- $url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash');
+ $url .= '&user=' . S::user()->login() . '&hash=' . S::v('core_rss_hash');
}
$page->setRssLink($n, $url);
}