4 if (empty($User['admin'])) {
5 http_response_code(403);
6 print "Beheerrechten verplicht voor instellen van covers\n";
10 $rootdir = 'foto' . $Args;
11 $target = "$rootdir/index.jpg";
13 if (is_link($target) or file_exists($target)) {
14 if (!unlink($target)) {
15 http_response_code(500);
16 print "Kon bestaande cover niet weghalen voor $Args\n";
21 if (isset($_GET['img'])) {
22 $img = str_repeat('../', substr_count($target, '/')); # up to docroot
23 $img .= ltrim($_GET['img'], '/');
24 if (!symlink($img, $target)) {
25 http_response_code(500);
26 print "Fout bij instellen van cover voor $Args\n";
31 $album = pathinfo($rootdir);
32 header("Location: /{$album['dirname']}#{$album['basename']}");
33 http_response_code(302);