-if ($User and $User->admin('foto')) {
- $access = '🔓 Openbaar';
- if (isset($PageAccess)) {
- $access = "🔒 Bewoners";
- if ($PageAccess != $rootdir) {
+if (!$User) {
+ $img = "$rootdir/index.jpg";
+ if (file_exists($img)) {
+ # cover image of current album
+ $Page->image = "/$img";
+ }
+ return;
+}
+
+if ($User->admin('foto')) {
+ if ($Page->restricted) {
+ $access = '<span class="icon icon-locked">🔒</span> Bewoners';
+ if ($Page->restricted != $rootdir) {