X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/a1bb8561064d0985ecb6c65054bf352f667bc9b7..28665e987ef8be35ce4f7082bd7aa5c91371397a:/edit/foto/cover/index.php diff --git a/edit/foto/cover/index.php b/edit/foto/cover/index.php index feddc8d..6e59e85 100644 --- a/edit/foto/cover/index.php +++ b/edit/foto/cover/index.php @@ -1,20 +1,14 @@ admin('foto')) { + abort("Beheerrechten verplicht voor instellen van covers", '403 unauthorised'); } -$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"; - exit; + abort("Kon bestaande cover niet weghalen voor {$Page->path}", '500 delete error'); } } @@ -22,12 +16,9 @@ if (isset($_GET['img'])) { $img = str_repeat('../', substr_count($target, '/')); # up to docroot $img .= ltrim($_GET['img'], '/'); if (!symlink($img, $target)) { - http_response_code(500); - print "Fout bij instellen van cover voor $Args\n"; - exit; + abort("Fout bij instellen van cover voor {$Page->path}", '500 link error'); } } $album = pathinfo($rootdir); -header("Location: /{$album['dirname']}#{$album['basename']}"); -http_response_code(302); +abort("/{$album['dirname']}#{$album['basename']}", '302 linked');