head: indicate explicit og:type of website
[minimedit.git] / page.inc.php
index b6723e9917c629b4483456281b3ff636276b0809..7a54bf7424b59603c98509a65ae83da5962bcf1b 100644 (file)
@@ -5,12 +5,12 @@ include_once 'head.inc.php';
 
 print "<header>\n";
 ob_start();
-include 'menu.html';
+include 'menu.inc.html';
 ob_start();
 if (!empty($User)) {
        print '<div class="login"><p>';
-       printf('<span>Ingelogd: <b><a href="%s">%s</a></b></span>', '/login', $User['name']);
-       if (!empty($User['admin'])) {
+       printf('<span>Ingelogd: <b><a href="%s">%s</a></b></span>', '/login', $User->login);
+       if ($User->admin("edit $Page$Args")) {
                $editpage = $Page.$Args;
                if (is_dir($editpage)) {
                        if (file_exists("$editpage/index.html")) {
@@ -40,11 +40,11 @@ print $body;
 
 register_shutdown_function(function () {
        print '<footer>';
-       @include 'footer.html';
+       @include 'footer.inc.html';
        print "</footer>\n";
 
-       global $User;
-       if (!empty($User['admin'])) {
+       global $User, $Page, $Args;
+       if (!empty($User) and $User->admin("edit $Page$Args")) {
                $ckesrc = '/lib/ckeditor'; # local install
                if (!file_exists(DOCROOT . $ckesrc)) {
                        $ckesrc = '//cdn.ckeditor.com/4.7.3/full-all'; # remote fallback