From: konrad Date: Fri, 7 Aug 2009 21:08:11 +0000 (+0000) Subject: login works, but nothing else is usable yet X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=6943285f97da34269aa3c4176ecccac9735b0218;p=web%2Fkonrad%2Fsmoke.git login works, but nothing else is usable yet git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@319 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/src/wbase/WInterface.cpp b/src/wbase/WInterface.cpp index 40d9d43..1248317 100644 --- a/src/wbase/WInterface.cpp +++ b/src/wbase/WInterface.cpp @@ -46,6 +46,8 @@ QString WInterface::name()const WInterface::~WInterface() { + QMutexLocker ml(&mtx); + inst.remove(inst.key((WInterface*)this)); } QMap WInterface::headers(QString)const diff --git a/src/wbase/WTransaction.cpp b/src/wbase/WTransaction.cpp index 615cae1..5ecc24d 100644 --- a/src/wbase/WTransaction.cpp +++ b/src/wbase/WTransaction.cpp @@ -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"); diff --git a/woc/phpout.cpp b/woc/phpout.cpp index 39d86ae..c354a5d 100644 --- a/woc/phpout.cpp +++ b/woc/phpout.cpp @@ -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;iaoutput[\""+sl[i]+"\"];\n"; + code+="\t\t$root->setAttribute(\""+sl[i]+"\",$this->aoutput[\""+sl[i]+"\"]);\n"; }else{ if(trn.isListType(t)){ if(trn.isObjectType(t)){ diff --git a/www/inc/machine/session.php b/www/inc/machine/session.php index 37bb596..c31bb6c 100644 --- a/www/inc/machine/session.php +++ b/www/inc/machine/session.php @@ -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])){