catch up with changes in PACK
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Mon, 2 Aug 2010 20:28:09 +0000 (20:28 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Mon, 2 Aug 2010 20:28:09 +0000 (20:28 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@584 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

www/inc/machine/session.php
www/inc/wext/transaction.php

index 4a3df97..71e9bea 100644 (file)
@@ -32,7 +32,7 @@ class Session
                $this->roles=array();
                $this->rights=array();
                $this->flags=array();
-               $sid=$trans->getHeader("Wob-SessionId");
+               $sid=$trans->getHeader("SessionId");
                $res=$db->select("session","sessionid,uname","sessionid=".$db->escapeString($sid));
                if(count($res)>0){
                        $this->sessid=$sid;
index 110f0b3..2f51cef 100644 (file)
@@ -13,6 +13,10 @@ class MSmokeTransaction extends WobTransaction
 {
        public function __construct()
        {
+       }
+       
+       protected function mkSession()
+       {
                //make sure we have a session
                global $session;
                if(!isset($session))new Session($this);
@@ -37,16 +41,19 @@ class MSmokeTransaction extends WobTransaction
        
        protected function isAuthenticated()
        {
+               $this->mkSession();
                return Session::instance()->isAuthenticated();
        }
        
        protected function isAuthorized($tn)
        {
+               $this->mkSession();
                return Session::instance()->isAuthenticated() && Session::instance()->canExecute($tn);
        }
        
        protected function userName()
        {
+               $this->mkSession();
                return Session::currentUserName();
        }
 };