X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/fc74e45e15e3b1f17312f229496c25f7caff7d60..dc7b531b3d4c33d18f64396ca20b0e010579cc88:/page.inc.php?ds=sidebyside diff --git a/page.inc.php b/page.inc.php index b6723e9..120fb95 100644 --- a/page.inc.php +++ b/page.inc.php @@ -5,12 +5,12 @@ include_once 'head.inc.php'; print "
\n"; ob_start(); -include 'menu.html'; +include 'menu.inc.html'; ob_start(); -if (!empty($User)) { +if ($User and property_exists($User, 'login') and $User->login) { print '

'; - printf('Ingelogd: %s', '/login', $User['name']); - if (!empty($User['admin'])) { + printf('Ingelogd: %s', '/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 '

\n"; - global $User; - if (!empty($User['admin'])) { + global $User, $Page, $Args; + if ($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