admin('foto')) { abort("Beheerrechten verplicht voor instellen van covers", '403 unauthorised'); } $rootdir = 'foto' . $Page->path; $target = "$rootdir/index.jpg"; if (is_link($target) or file_exists($target)) { if (!unlink($target)) { abort("Kon bestaande cover niet weghalen voor {$Page->path}", '500 delete error'); } } if (isset($_GET['img'])) { $img = str_repeat('../', substr_count($target, '/')); # up to docroot $img .= ltrim($_GET['img'], '/'); if (!symlink($img, $target)) { abort("Fout bij instellen van cover voor {$Page->path}", '500 link error'); } } $album = pathinfo($rootdir); abort("/{$album['dirname']}#{$album['basename']}", '302 linked');