auth: admin permissions per function
[minimedit.git] / nieuws / index.php
index 8b82b61fb6f4b15a8b25ae9ce6028f295a6eedcf..9e972676ffd8eccc974e8cd41f2ca764b8cd3962 100644 (file)
@@ -2,18 +2,18 @@
 $replyform = $Page == 'melding' && !empty($User);
 @list ($year, $page) = explode('/', trim($Args, '/'));
 
-if ($User and $User->admin) {
+if ($User and $User->admin('news')) {
        print '<script src="/nieuws/edit.js"></script>'."\n";
 }
 
 if ($page and !is_numeric($page)) {
-       $edit = $User && $User->admin ? htmlspecialchars(@$_GET['edit']) : NULL;
+       $edit = $User && $User->admin('news') ? htmlspecialchars(@$_GET['edit']) : NULL;
        if ($edit) {
                $Article->title = $edit;
        }
        $Place[1] = ' <small class="date">'.$Article->date.'</small>';
        print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
-       if ($User and $User->admin) {
+       if ($User and $User->admin('news')) {
                $taglist = [];
                foreach (glob("$Page/.tags/*") as $tagpath) {
                        $tagname = pathinfo($tagpath, PATHINFO_BASENAME);