<?php
-ob_clean();
-
-if (!$User or !$User->admin('foto')) {
+if (!$User->admin('foto')) {
http_response_code(403);
print "Beheerrechten verplicht voor instellen van covers\n";
exit;
}
-$rootdir = 'foto' . $Args;
+$rootdir = 'foto' . $Page->path;
$target = "$rootdir/index.jpg";
if (is_link($target) or file_exists($target)) {
if (!unlink($target)) {
http_response_code(500);
- print "Kon bestaande cover niet weghalen voor $Args\n";
+ print "Kon bestaande cover niet weghalen voor {$Page->path}\n";
exit;
}
}
$img .= ltrim($_GET['img'], '/');
if (!symlink($img, $target)) {
http_response_code(500);
- print "Fout bij instellen van cover voor $Args\n";
+ print "Fout bij instellen van cover voor {$Page->path}\n";
exit;
}
}
$album = pathinfo($rootdir);
header("Location: /{$album['dirname']}#{$album['basename']}");
http_response_code(302);
+exit;