X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/da2d6e5537e9fdcd6f424ea1cc8ab6ef8f45727e..b28c58864e20c556b65ec60f02c0df6401f73351:/article.inc.php diff --git a/article.inc.php b/article.inc.php index 1dbda25..8e121d3 100644 --- a/article.inc.php +++ b/article.inc.php @@ -66,16 +66,16 @@ class ArchiveArticle return; } - function index() + function index($api = TRUE) { $this->handler; if (empty($this->handler)) { return; } - $this->api = TRUE; + $this->api = $api; $Page = $this; - $res = include "./{$this->handler}/index.php"; - return $res; + global $User; + return require "./{$this->handler}/index.php"; } function restricted() @@ -223,7 +223,7 @@ class ArchiveArticle # keep either login or logout parts depending on user level global $User; $userexists = $User && property_exists($User, 'login') && $User->login; - if (! ($userexists and $User->admin("edit {$this->link}")) ) { + if (! ($userexists and !empty($this->editable)) ) { # remove matching elements until first corresponding closing tag $hideclass = $userexists ? 'logout' : 'login'; $tagmatch = '<([a-z]+) class="'.$hideclass.'"[^>]*>';