Fixes variable use.
[platal.git] / classes / plwikipage.php
index e60b21a..32460bc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -404,10 +404,11 @@ class PlWikiPage
           case 'public':
             return true;
           case 'logged':
-          case 'mdp':
             return S::logged();
+          case 'mdp':
+            return S::identified();
           case 'admin':
-            return S::has_perms();
+            return S::admin();
           default:
             return false;
         }
@@ -431,6 +432,9 @@ class PlWikiPage
             global $platal;
             $page =& Platal::page();
             $platal->force_login($page);
+        } else if ($perm == 'admin' && !S::admin()) {
+            global $platal;
+            $platal->error403();
         }
     }