added support for PostgreSQL
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 22 May 2010 12:41:00 +0000 (12:41 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 22 May 2010 12:41:00 +0000 (12:41 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@465 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

wob/user.wolf
www/inc/machine/session.php

index 415e829..8320696 100644 (file)
@@ -60,7 +60,7 @@
        
        <Table name="session">
                <Column name="sessionid" type="string:64" primarykey="yes"/>
-               <Column name="user" type="string:64" notnull="yes" foreignkey="user:uname"/>
+               <Column name="uname" type="string:64" notnull="yes" foreignkey="user:uname"/>
                <!-- unix timestamp at which to delete this session -->
                <Column name="timeout" type="int64" notnull="yes"/>
        </Table>
index 4b99538..0e0777a 100644 (file)
@@ -33,10 +33,10 @@ class Session
                $this->rights=array();
                $this->flags=array();
                $sid=$trans->getHeader("Wob-SessionId");
-               $res=$db->select("session","sessionid,user","sessionid=".$db->escapeString($sid));
+               $res=$db->select("session","sessionid,uname","sessionid=".$db->escapeString($sid));
                if(count($res)>0){
                        $this->sessid=$sid;
-                       $this->user=$res[0]["user"];
+                       $this->user=$res[0]["uname"];
                        $this->initRights();
                        $this->initFlags($res[0]["flags"]);
                }
@@ -168,7 +168,7 @@ class Session
                        $sid=getRandom(128);
                }
                $valid=time()+$ClientSessionTimeout;
-               $ret=array("sessionid"=>$sid,"user"=>$trans->getusername(),"timeout"=>$valid);
+               $ret=array("sessionid"=>$sid,"uname"=>$trans->getusername(),"timeout"=>$valid);
                $db->insert("session",$ret);
                $db->commitTransaction();