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");
//getters/setters
tf.write(trnGetSet(trn).toAscii());
+
+ //end
+ code="\n//end of class\n}\n";
+ tf.write(code.toAscii());
tf.write(PHPEND);
tf.close();
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)){
{
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"];
// 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
}
//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])){