projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
{site}.inc.php is the base for all jobs.
[platal.git]
/
include
/
wiki
/
engine.php
diff --git
a/include/wiki/engine.php
b/include/wiki/engine.php
index
859dd95
..
f8c01fc
100644
(file)
--- a/
include/wiki/engine.php
+++ b/
include/wiki/engine.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
7
Polytechnique.org *
+ * Copyright (C) 2003-200
8
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-33,8
+33,9
@@
$feed = false;
// Check user perms
switch (Env::v('action')) {
case 'rss': case 'atom': case 'sdf': case 'dc':
// Check user perms
switch (Env::v('action')) {
case 'rss': case 'atom': case 'sdf': case 'dc':
+ wiki_apply_feed_perms($perms[0]);
$feed = true;
$feed = true;
- case '': case 'search':
case 'rss': case 'atom':
+ case '': case 'search':
break;
case 'edit':
break;
case 'edit':
@@
-50,7
+51,7
@@
if ($p = Post::v('setrperms')) {
wiki_apply_perms('admin');
if (wiki_set_perms($n, $p, $perms[1])) {
$perms = wiki_get_perms($n);
wiki_apply_perms('admin');
if (wiki_set_perms($n, $p, $perms[1])) {
$perms = wiki_get_perms($n);
- $page->trig('Permissions mises à jour');
+ $page->trig
Success
('Permissions mises à jour');
}
}
}
}
@@
-58,7
+59,7
@@
if ($p = Post::v('setwperms')) {
wiki_apply_perms('admin');
if (wiki_set_perms($n, $perms[0], $p)) {
$perms = wiki_get_perms($n);
wiki_apply_perms('admin');
if (wiki_set_perms($n, $perms[0], $p)) {
$perms = wiki_get_perms($n);
- $page->trig('Permissions mises à jour');
+ $page->trig
Success
('Permissions mises à jour');
}
}
}
}
@@
-79,6
+80,8
@@
if (Env::v('action') || !$cache_exists) {
require_once($globals->spoolroot.'/wiki/pmwiki.php');
$wikiAll = ob_get_clean();
require_once($globals->spoolroot.'/wiki/pmwiki.php');
$wikiAll = ob_get_clean();
+ pl_clear_errors();
+
// the pmwiki skin we are using (almost empty) has these keywords:
$i = strpos($wikiAll, "<!--/HeaderText-->");
$j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
// the pmwiki skin we are using (almost empty) has these keywords:
$i = strpos($wikiAll, "<!--/HeaderText-->");
$j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
@@
-89,6
+92,10
@@
$wiki_exists = file_exists(wiki_work_dir() . '/' . wiki_filename($n));
if ($feed) {
$wikiAll = str_replace('dc:contributor', 'author', $wikiAll);
$wikiAll = preg_replace('!<author>.*?\..*?\.(\d{4})\|(.*?)</author>!u', '<author>$2 (X$1)</author>', $wikiAll);
if ($feed) {
$wikiAll = str_replace('dc:contributor', 'author', $wikiAll);
$wikiAll = preg_replace('!<author>.*?\..*?\.(\d{4})\|(.*?)</author>!u', '<author>$2 (X$1)</author>', $wikiAll);
+ $wikiAll = str_replace('<link>./', '<link>' . $globals->baseurl . '/' . $platal->ns, $wikiAll);
+ echo $wikiAll;
+ pl_clear_errors();
+ exit;
} elseif (Env::v('action')) {
$page->assign('xorg_extra_header', substr($wikiAll, 0, $i));
$wikiAll = substr($wikiAll, $j);
} elseif (Env::v('action')) {
$page->assign('xorg_extra_header', substr($wikiAll, 0, $i));
$wikiAll = substr($wikiAll, $j);
@@
-109,11
+116,6
@@
if ($feed) {
// Check user perms
wiki_apply_perms($perms[0]);
// Check user perms
wiki_apply_perms($perms[0]);
-if ($feed) {
- echo $wikiAll;
- exit;
-}
-
$page->assign('perms', $perms);
$page->assign('perms_opts', wiki_perms_options());
$page->assign('perms', $perms);
$page->assign('perms_opts', wiki_perms_options());
@@
-130,7
+132,11
@@
if (!$feed && $perms[1] == 'admin' && !Env::v('action') && $wiki_exists) {
$page->addCssLink('wiki.css');
$page->addJsLink('wiki.js');
if (!Env::v('action')) {
$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();
}
$page->run();