$roles=$ALLOWEDREQUESTS;
$roles[]="_admin";
//get roles from DB
- $res=$db->select("userrole","role","uname=".$user);
+ $res=$db->select("userrole","role","uname=".$db->escapeString($user));
$acl=array();
foreach($res as $rl)$acl[]=$rl["role"];
$dom=new DOMDocument;
$re=$dom->createElement("Role");
$re->setAttributeNode(new DOMAttr("name",$rl));
if(array_search($rl,$acl)===false)$re->setAttributeNode(new DOMAttr("set","0"));
- else $re->setAttributeNode(new DOMAttr("set","0"));
+ else $re->setAttributeNode(new DOMAttr("set","1"));
$root->appendChild($re);
}
$dom->appendChild($root);
//create new
$db->insert("users",array("uname"=>$usr[$i]["name"],"description"=>$usr[$i]["descr"]));
//print data
- $usr=$dom->createElement("User",$usr[$i]["descr"]);
- $usr->setAttributeNode(new DOMAttr("name",$usr[$i]["name"]));
- $root->appendChild($usr);
+ $udm=$dom->createElement("User",$usr[$i]["descr"]);
+ $udm->setAttributeNode(new DOMAttr("name",$usr[$i]["name"]));
+ $root->appendChild($udm);
}
$db->commitTransaction();
}