<?php
+if (!$User) return;
abort("aanpasdienst onbekend", '404 unknown');
<?php
$rootdir = $Page->link;
+$nav = explode('/', $rootdir);
+$nav[0] = "Foto's"; # override of root 'foto'
+$title = array_pop($nav);
+$Page->title = ($nav ? implode(' ', $nav) . ': ' : '') . $title;
+
+if (!$User) {
+ $img = "$rootdir/index.jpg";
+ if (file_exists($img)) {
+ # cover image of current album
+ $Page->image = "/$img";
+ }
+ return;
+}
+
if ($User->admin('foto')) {
if ($Page->restricted) {
$access = '<span class="icon icon-locked">🔒</span> Bewoners';
print "<aside>$access</aside>\n\n";
}
-$nav = explode('/', $rootdir);
-$nav[0] = "Foto's"; # override of root 'foto'
-$title = array_pop($nav);
-$Page->title = ($nav ? implode(' ', $nav) . ': ' : '') . $title;
-
$link = '';
print "<h2>";
foreach ($nav as $i => $linktitle) {
print $Page->raw; # page intro
}
+if (!function_exists('showthumb')) {
function showthumb($path)
{
// assume all album entries are symlinks to archive originals
return sprintf('<a href="/%s"><%s /></a>'."\n", $target, $imgtag);
}
+}
if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) {
natsort($imgs);
$Page->title .= ': '.htmlspecialchars($Issue->subject);
$Page->teaser = $Issue->body;
+ if (!$User) return;
$Page->body = $replies; # find image
print "<h2>{$Page->title}</h2>\n";
print "</div>\n";
return;
}
+elseif (!$User) return;
if ($_POST) {
require_once 'upload.inc.php';
<?php
+if (!$User) return;
$message = NULL;
if (isset($_POST['mail'])) {
$target = ltrim($_REQUEST['goto'], '/');
$target = new ArchiveArticle("$target.html");
- if ($target and $target->handler == 'melding') {
+ if ($target and $target->handler) {
# run forbidden handler to determine metadata
- #TODO: generic solution
+ $User = NULL;
$caller = $Page;
$Page = $target;
ob_start();
<?php
+if (!$User) return;
+
if (!$User->login) {
http_response_code(303);
$target = urlencode($_SERVER['REQUEST_URI']);
return;
}
+if (!$User) {
+ return;
+}
if (!$User->admin('user')) {
http_response_code(403);
$Page->place['warn'] = "Geen gebruikersrechten om e-mails in te zien.";
$replyform = $Page->handler == 'melding' && $User->login;
@list ($year, $page) = explode('/', trim($Page->path, '/'));
+if (!$User) return;
+
if ($User->admin("edit {$Page->handler}")) {
$Page->raw = '<script src="/nieuws/edit.js"></script>'."\n" . $Page->raw;
}
<?php
+if (!$User) return;
header('Content-Type: application/atom+xml; charset=utf-8');
print '<?xml version="1.0" encoding="utf-8"?>';
$siteref = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'];
<?php
+if (!$User) return;
list ($size, $imgpath) = explode('/', ltrim($Page->path, '/'), 2);
$imgpath = preg_replace('{^(?=[0-9]+/)}', 'data/', $imgpath, 1);