2 if (!$User or !$User->admin('foto')) {
3 http_response_code(403);
4 print "Beheerrechten verplicht voor instellen van covers\n";
8 $rootdir = 'foto' . $Args;
9 $target = "$rootdir/index.jpg";
11 if (is_link($target) or file_exists($target)) {
12 if (!unlink($target)) {
13 http_response_code(500);
14 print "Kon bestaande cover niet weghalen voor $Args\n";
19 if (isset($_GET['img'])) {
20 $img = str_repeat('../', substr_count($target, '/')); # up to docroot
21 $img .= ltrim($_GET['img'], '/');
22 if (!symlink($img, $target)) {
23 http_response_code(500);
24 print "Fout bij instellen van cover voor $Args\n";
29 $album = pathinfo($rootdir);
30 header("Location: /{$album['dirname']}#{$album['basename']}");
31 http_response_code(302);