summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
93c5256)
Treat news maintenance like any other edit location.
-if (!$User or !$User->admin('news'))
- abort("geen beheersrechten", '401 unauthorised');
-
if (!$_POST)
abort("niets te doen", '405 post error');
if (!$Args)
abort("pagina niet opgegeven", '409 input error');
$pagename = ltrim($Args, '/').'.html';
if (!$_POST)
abort("niets te doen", '405 post error');
if (!$Args)
abort("pagina niet opgegeven", '409 input error');
$pagename = ltrim($Args, '/').'.html';
+if (!$User or !$User->admin("edit $pagename"))
+ abort("geen beheersrechten", '401 unauthorised');
+
@list ($category, $year, $article) = explode('/', $pagename);
if (empty($article) or !file_exists($pagename))
abort("artikel onbekend: $pagename", '404 page error');
@list ($category, $year, $article) = explode('/', $pagename);
if (empty($article) or !file_exists($pagename))
abort("artikel onbekend: $pagename", '404 page error');
$replyform = $Page == 'melding' && !empty($User);
@list ($year, $page) = explode('/', trim($Args, '/'));
$replyform = $Page == 'melding' && !empty($User);
@list ($year, $page) = explode('/', trim($Args, '/'));
-if ($User and $User->admin('news')) {
+if ($User and $User->admin("edit $Page")) {
print '<script src="/nieuws/edit.js"></script>'."\n";
}
if ($page and !is_numeric($page)) {
print '<script src="/nieuws/edit.js"></script>'."\n";
}
if ($page and !is_numeric($page)) {
- $edit = $User && $User->admin('news') ? htmlspecialchars(@$_GET['edit']) : NULL;
+ $edit = $User && $User->admin("edit $Page$Args") ? htmlspecialchars(@$_GET['edit']) : NULL;
if ($edit) {
$Article->title = $edit;
}
if ($edit) {
$Article->title = $edit;
}
$Place[1] = ' <small class="date">'.$Article->date.'</small>';
}
print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Article->raw);
$Place[1] = ' <small class="date">'.$Article->date.'</small>';
}
print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Article->raw);
- if ($User and $User->admin('news')) {
+ if ($User and $User->admin("edit $Page$Args")) {
$taglist = [];
foreach (glob("$Page/.tags/*") as $tagpath) {
$tagname = pathinfo($tagpath, PATHINFO_BASENAME);
$taglist = [];
foreach (glob("$Page/.tags/*") as $tagpath) {
$tagname = pathinfo($tagpath, PATHINFO_BASENAME);