login works, but nothing else is usable yet
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 7 Aug 2009 21:08:11 +0000 (21:08 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 7 Aug 2009 21:08:11 +0000 (21:08 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@319 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

src/wbase/WInterface.cpp
src/wbase/WTransaction.cpp
woc/phpout.cpp
www/inc/machine/session.php

index 40d9d43..1248317 100644 (file)
@@ -46,6 +46,8 @@ QString WInterface::name()const
 
 WInterface::~WInterface()
 {
+       QMutexLocker ml(&mtx);
+       inst.remove(inst.key((WInterface*)this));
 }
 
 QMap<QString,QString> WInterface::headers(QString)const
index 615cae1..5ecc24d 100644 (file)
@@ -91,7 +91,7 @@ QByteArray WTransaction::executeQuery(QString hreq,QByteArray data)
        QString hostspec=url.host();
        if(url.port()>0)hostspec+=":"+QString::number(port);
        hrh.setValue("Host",hostspec);
-       hrh.setValue("X-Wob-Request",hreq);
+       hrh.setValue("X-WobRequest",hreq);
        //TODO: hrh.setValue("X-MagicSmoke-Session",sessionid);
        hrh.setContentLength(data.size());
        hrh.setContentType("application/x-webobject; charset=UTF-8");
index 39d86ae..c354a5d 100644 (file)
@@ -721,6 +721,10 @@ void WocPHPServerOut::newTransaction(const WocTransaction&trn)
        //getters/setters
        tf.write(trnGetSet(trn).toAscii());
        
+       
+       //end
+       code="\n//end of class\n}\n";
+       tf.write(code.toAscii());
        tf.write(PHPEND);
        tf.close();
        
@@ -820,11 +824,11 @@ QString WocPHPServerOut::trnOutput(const WocTransaction&trn)
        QString code="\t/*start of output encoding*/\n";
        code+="\ttry{\n\t\t$xml=new DOMDocument;\n";
        code+="\t\t$root=$xml->createElement(\"WobResponse\");\n";
-       code+="\t\t$root->setAttribute(\"status\",statusString());\n";
+       code+="\t\t$root->setAttribute(\"status\",$this->statusString());\n";
        for(int i=0;i<sl.size();i++){
                QString t=trn.outputType(sl[i]);
                if(trn.isAttributeType(t)){
-                       code+="\t\t$root->setAttribute(\""+sl[i]+"\",$this->aoutput[\""+sl[i]+"\"];\n";
+                       code+="\t\t$root->setAttribute(\""+sl[i]+"\",$this->aoutput[\""+sl[i]+"\"]);\n";
                }else{
                        if(trn.isListType(t)){
                                if(trn.isObjectType(t)){
index 37bb596..c31bb6c 100644 (file)
@@ -63,8 +63,8 @@ class Session
        {
                global $db,$ClientSessionTimeout;
                //get host data
-               $uhres=$db->select("userhosts","host","uname=".$db->escapeString($trans->getusername()));
-               $hres=$db->select("host","*","hostname=".$db->escapeString($trans->gethostname));
+               $uhres=$db->select("userhost","host","uname=".$db->escapeString($trans->getusername()));
+               $hres=$db->select("host","*","hostname=".$db->escapeString($trans->gethostname()));
                $hosts=array();
                foreach($uhres as $hst)
                        $hosts[]=$hst["host"];
@@ -77,7 +77,7 @@ class Session
                // b) $hosts contains the transmitted host name
                $hostname=$trans->gethostname();
                if( !in_array($hostname,$hosts) && !in_array("_any",$hosts)){
-                       $trans->abortWithError("auth",translate("php::","Host/User combination not allowed");
+                       $trans->abortWithError("auth",translate("php::","Host/User combination not allowed"));
                }
                
                //validate host
@@ -91,14 +91,14 @@ class Session
                }
                
                //get user data
-               $ures=$db->select("users","*","uname=".$db->escapeString($trans->getusername()));
+               $ures=$db->select("user","*","uname=".$db->escapeString($trans->getusername()));
                if(count($ures)<1){
-                       $trans->abortWithError("auth",translate("php::","User Authentication failed"));
+                       $trans->abortWithError("auth",translate("php::","User Authentication failed--"));
                }
                //validate user
                $splt=explode(" ",$ures[0]["passwd"]);
                if(count($splt)!=2){
-                       $trans->abortWithError("auth",translate("php::","User Authentication failed"));
+                       $trans->abortWithError("auth",translate("php::","User Authentication failed-"));
                }
                $cmp=strtolower(sha1($splt[0].$trans->getpassword()));
                if($cmp!=strtolower($splt[1])){