"</div>";
}
+function pl_clear_errors()
+{
+ unset($GLOBALS['pl_errors']);
+}
+
function pl_dump_env()
{
echo "<div class='phperror'><pre>";
}
}
+function wiki_apply_feed_perms($perm)
+{
+ if ($perm == 'public') {
+ return;
+ }
+
+ require_once 'rss.inc.php';
+ $uid = init_rss(null, Env::v('user'), Env::v('hash'));
+ if (!$uid) {
+ exit;
+ }
+ $res = XDB::query('SELECT user_id, IF (nom_usage <> \'\', nom_usage, nom) AS nom, prenom, perms
+ FROM auth_user_md5
+ WHERE user_id = {?}', $uid);
+ if (!$res->numRows()) {
+ exit;
+ }
+ $table = $res->fetchOneAssoc();
+ $_SESSION = array_merge($_SESSION, $table, array('forlife' => Env::v('user')));
+ if ($perm == 'logged' || S::has_perms()) {
+ return;
+ }
+ exit;
+}
+
function wiki_apply_perms($perm) {
global $page, $platal, $globals;
// Check user perms
switch (Env::v('action')) {
case 'rss': case 'atom': case 'sdf': case 'dc':
+ wiki_apply_feed_perms($perms['0']);
$feed = true;
- case '': case 'search': case 'rss': case 'atom':
+ case '': case 'search':
break;
case 'edit':
}
}
-// Check user perms
-wiki_apply_perms($perms[0]);
-
if ($feed) {
echo $wikiAll;
+ pl_clear_errors();
exit;
}
+// Check user perms
+wiki_apply_perms($perms[0]);
+
$page->assign('perms', $perms);
$page->assign('perms_opts', wiki_perms_options());
$page->addCssLink('wiki.css');
$page->addJsLink('wiki.js');
if (!Env::v('action')) {
- $page->setRssLink($n, '/' . str_replace('.', '/', $n) . '?action=rss');
+ $url = '/' . str_replace('.', '/', $n) . '?action=rss';
+ if (S::logged()) {
+ $url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash');
+ }
+ $page->setRssLink($n, $url);
}
$page->run();
include_once($FarmD.'/scripts/xlpage-utf-8.php');
if ($action == 'rss' || $action == 'atom' || $action == 'rdf' || $action == 'dc') {
- include_once("$FarmD/scripts/feeds.php");
$FmtPV['$MarkupExcerpt'] = '$page["text"]';
$FeedFmt[$action]['item']['title'] = '[$Group] {$Title}';
$FeedFmt[$action]['item']['description'] = '$LastModifiedSummary';
$FeedFmt[$action]['feed']['title'] = 'Polytechnique.org :: Wiki :: $FullName';
+ $pagelist = null;
+ include_once("$FarmD/scripts/feeds.php");
}
// Theme-ing {{{