New member class for immaterial entities on Xnet
[platal.git] / include / xnet / session.inc.php
index 147fab8..7fcb613 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once dirname(__FILE__).'/../../classes/Session.php';
-
 class XnetSession
 {
     // {{{ function init
 
-    function init() {
+    public static function init() {
         global $globals;
 
         S::init();
 
-        $_SESSION['session'] = new XnetSession;
-
         if (!S::logged()) {
             // prevent connexion to be linked to deconnexion
             if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false)
@@ -48,21 +44,21 @@ class XnetSession
     }
 
     // }}}
-    // {{{ function destroy()
+    // {{{ public static function destroy()
 
-    function destroy() {
+    public static function destroy() {
         S::destroy();
         XnetSession::init();
     }
 
     // }}}
-    // {{{ function doAuth()
+    // {{{ public static function doAuth()
 
     /** Try to do an authentication.
      *
      * @param page the calling page (by reference)
      */
-    function doAuth()
+    public static function doAuth()
     {
        if (S::identified()) { // ok, c'est bon, on n'a rien à faire
            return true;
@@ -76,9 +72,16 @@ class XnetSession
     }
 
     // }}}
+    // {{{ doAuthCookie
+
+    public static function doAuthCookie() {
+        return XnetSession::doAuth();
+    }
+
+    // }}}
     // {{{ doAuthX
 
-    function doAuthX() {
+    public static function doAuthX() {
         global $globals, $page;
 
         if (md5('1'.S::v('challenge').$globals->xnet->secret.Get::i('uid').'1') != Get::v('auth')) {
@@ -100,8 +103,8 @@ class XnetSession
         S::kill('loginX');
         Get::kill('auth');
         Get::kill('uid');
-        $path = Get::v('p');
-        Get::kill('p');
+        $path = Get::v('n');
+        Get::kill('n');
         Get::kill('PHPSESSID');
 
         $args = array();