Should not consider admin pages as special.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Jun 2008 21:38:37 +0000 (23:38 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Jun 2008 21:38:37 +0000 (23:38 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
_admin.php
_public.php
class.xorg.auth.php

index 6ab8699..8cbb165 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-define('IS_ADMIN_PAGE', 1);
 
 require_once dirname(__FILE__) . '/widget.auth.php';
 require_once dirname(__FILE__) . '/widget.post.perms.php';
index e5f5f23..bb3e6b4 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+define('IS_PUBLIC_PAGE', 1);
+
 require_once dirname(__FILE__) . '/page.auth.php';
 require_once dirname(__FILE__) . '/widget.auth.php';
 require_once dirname(__FILE__) . '/widget.post.perms.php';
index ebd6d2b..e84a774 100644 (file)
@@ -71,13 +71,13 @@ class xorgAuth extends dcAuth {
     $type = $blog->settings->get('xorg_blog_type');
     $owner = $blog->settings->get('xorg_blog_owner');
     $level = $this->xorg_infos['grpauth'];
-    $rec = $core->getUser($this->userID());
+    $rec = $core->getUser($this->user_id);
     $wasAdmin = $rec->f('user_super');
     $isAdmin = $this->xorg_infos['perms'] == 'admin';
     if (($wasAdmin && !$isAdmin) || (!$wasAdmin && $isAdmin)) {
       $cur = new cursor($this->con, 'dc_user');
       $cur->user_super = $isAdmin ? '1' : '0';
-      $core->updUser($this->userID(), $cur);
+      $core->updUser($this->user_id, $cur);
     }
     if ($_SESSION['xorg-group'] != $owner) {
       $this->killSession();
@@ -212,7 +212,7 @@ class xorgAuth extends dcAuth {
 
   public function userID() {
     $this->buildFromSession();
-    if (!defined('IS_ADMIN_PAGE')) {
+    if (defined('IS_PUBLIC_PAGE')) {
       return null;
     }
     return parent::userID();