foto: lock characters from icon font
[minimedit.git] / foto / index.php
index 4b61f37c08a36830db868574cc6ba1984d0bec4d..0ce4d206aa2a4c72b2336fc8a2b7e3fae665c71d 100644 (file)
@@ -1,16 +1,18 @@
 <?php
 $rootdir = $Page . $Args;
 
-if ($User and $User->admin('foto')) {
-       $access = '🔓 Openbaar';
-       if (isset($PageAccess)) {
-               $access = "🔒 Bewoners";
+if ($User->admin('foto')) {
+       if (!empty($PageAccess)) {
+               $access = '<span class="icon icon-locked">&#x1F512;</span> Bewoners';
                if ($PageAccess != $rootdir) {
                        $access .= sprintf(' vanaf <a href="%s">%s</a>',
                                "/$PageAccess", pathinfo($PageAccess, PATHINFO_FILENAME)
                        );
                }
        }
+       else {
+               $access = '<span class="icon icon-locked">&#x1F513;</span> Openbaar';
+       }
        print "<aside>$access</aside>\n\n";
 }
 
@@ -64,7 +66,7 @@ if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) {
 
                $html = '<img src="/'.$cover.'" />';
                $html .= "<figcaption>$album</figcaption>";
-               if (empty($User) and file_exists("$path/.private")) {
+               if (!$User->login and file_exists("$path/.private")) {
                        $html = '<strike title="bewoners">'.$html.'</strike>';
                }
                $html = "<figure>$html</figure>";