in fact, it's even simpler to give a doAuthCookie to xnet as well, that is
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 31 Jul 2006 19:53:47 +0000 (19:53 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 31 Jul 2006 19:53:47 +0000 (19:53 +0000)
an alias for doAuth

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@760 839d8a87-29fc-0310-9880-83ba4fa771e5

include/wiki.inc.php
include/xnet/session.inc.php
include/xorg/session.inc.php

index d34e578..861340e 100644 (file)
@@ -104,24 +104,21 @@ function wiki_may_have_perms($perm) {
 }
 
 function wiki_apply_perms($perm) {
-    global $page, $platal;
+    global $page, $platal, $globals;
 
     switch ($perm) {
       case 'public':
         return;
 
       case 'logged':
-        if (empty($GLOBALS['IS_XNET_SITE'])) {
-            if (!XorgSession::doAuthCookie()) {
-                $platal = new Platal();
-                $platal->force_login($page);
-            }
-            return;
+        if (!call_user_func(array($globals->session, 'doAuthCookie'))) {
+            $platal = new Platal();
+            $platal->force_login($page);
         }
-        /* fallthrough */
+        return;
 
       default:
-        if (call_user_func(array($globals->session, 'doAuth'))) {
+        if (!call_user_func(array($globals->session, 'doAuth'))) {
             $platal = empty($GLOBALS['IS_XNET_SITE']) ? new Platal() : new Xnet();
             $platal->force_login($page);
         }
index 0a27fc3..e8e5160 100644 (file)
@@ -74,6 +74,13 @@ class XnetSession
     }
 
     // }}}
+    // {{{ doAuthCookie
+
+    function doAuthCookie() {
+        return XnetSession::doAuth();
+    }
+
+    // }}}
     // {{{ doAuthX
 
     function doAuthX() {
index 45ff08b..d59a4d5 100644 (file)
@@ -21,8 +21,6 @@
 
 require_once dirname(__FILE__).'/../../classes/Session.php';
 
-// {{{ class XorgSession
-
 class XorgSession
 {
     // {{{ function init
@@ -165,7 +163,6 @@ class XorgSession
     // }}}
 }
 
-// }}}
 // {{{ function try_cookie()
 
 /** réalise la récupération de $_SESSION pour qqn avec cookie