From cd7dbe18e398e8f452dbf68a34a537a554f210ac Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 1 Mar 2008 11:29:00 +0000 Subject: [PATCH] user management for client interface git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@97 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- doc/prog_protocol.html | 33 +++++ src/overview.cpp | 51 ++++++- src/smoke.pro | 8 +- src/smoke_de.ts | 316 ++++++++++++++++++++++++++++++++++++------- src/smoke_de_SAX.ts | 316 +++++++++++++++++++++++++++++++++++++------ src/user.cpp | 200 +++++++++++++++++++++++++++ src/user.h | 70 ++++++++++ www/inc/machine/session.php | 152 +++++++++++++++++++++- www/machine.php | 20 +++- 9 files changed, 1064 insertions(+), 102 deletions(-) diff --git a/doc/prog_protocol.html b/doc/prog_protocol.html index 2f5205c..e296e47 100644 --- a/doc/prog_protocol.html +++ b/doc/prog_protocol.html @@ -268,6 +268,14 @@ Both calls use this structure for the request:

The adduser call also uses it for the response, leaving out any user name that already existed or does not conform to the syntax requirements. +

Deleting a User

+ +The deleteuser transaction deletes one single user. The request contains only the user name to be deleted. The response is empty.

+ +FIXME: this call can fail silently if the user is still referenced somewhere. The client program must refresh its list of users to find out whether the user still exists.

+ +FIXME 2: currently this transaction is not atomic for a reason: if it fails to delete the user it will at least succeed in deleting its access rights. +

Getting User ACLs

The getuseracl transaction returns the ACL of a specific user. The request contains only the login name of the user. The response looks like:

@@ -280,3 +288,28 @@ The getuseracl transaction returns the ACL of a specific user. The requ All setable roles must be listed, so that the client can use these for displaying in a dialog. + +

Setting User ACLs

+ +The setuseracl transaction can be used to update a users ACL. The request is identical to the response of getuseracl, while the response is an empty document on success - only the status "OK" counts.

+ +Any role listed in the request is changed accordingly, non-existant roles are ignored, roles not listed are left unchanged.

+ +

Getting a Users Hosts

+ +The getuserhosts transaction returns the allowed client hosts of a specific user. The request contains only the login name of the user. The response looks like:

+ +

+<Hosts user="username">
+  <Host name="hostname" set="1|0"/>
+  ...
+</Hosts>
+
+ +All setable hosts must be listed, so that the client can use these for displaying in a dialog. + +

Setting User Hosts

+ +The setuserhosts transaction can be used to update a users allowed client hosts. The request is identical to the response of getuserhosts, while the response is an empty document on success - only the status "OK" counts.

+ +Any host listed in the request is changed accordingly, non-existant hosts are ignored, hosts not listed are left unchanged.

diff --git a/src/overview.cpp b/src/overview.cpp index 34c71c4..86f3018 100644 --- a/src/overview.cpp +++ b/src/overview.cpp @@ -13,6 +13,7 @@ #include "overview.h" #include "webrequest.h" #include "eventedit.h" +#include "checkdlg.h" #include #include @@ -44,10 +45,9 @@ MOverview::MOverview(MWebRequest*mw,QString pk) m->addAction(tr("&Close Session"),this,SLOT(close())); m=mb->addMenu(tr("&Event")); - m->addAction(tr("&Update Event List"),this,SLOT(updateEvents()))->setEnabled(req->hasRole("geteventlist")); - m->addAction(tr("&Show details...")); + m->addAction(tr("&Update Event List"),this,SLOT(updateEvents())) ->setEnabled(req->hasRole("geteventlist")); + m->addAction(tr("&Show/Edit details..."),this,SLOT(editEvent())) ->setEnabled(req->hasRole("geteventdata")); m->addAction(tr("&New Event..."),this,SLOT(newEvent()))->setEnabled(req->hasRole("createevent")); - m->addAction(tr("&Cancel Event...")); m=mb->addMenu(tr("&Customer")); m->addAction(tr("&Show all customers")); @@ -265,7 +265,19 @@ void MOverview::newUser() updateUsers(); } -void MOverview::deleteUser(){} +void MOverview::deleteUser() +{ + //get selection + QModelIndex sel=usertable->currentIndex(); + if(!sel.isValid())return; + //get uname & descr + QString name=usermodel->data(usermodel->index(sel.row(),0)).toString(); + //make sure user wants this + if(QMessageBox::question(this,tr("Delete User?"),tr("Really delete user '%1'?").arg(name),QMessageBox::Yes|QMessageBox::No)!=QMessageBox::Yes)return; + //delete + MUser(req,name).deleteUser(); + updateUsers(); +} void MOverview::editUserDescription() { @@ -284,8 +296,35 @@ void MOverview::editUserDescription() updateUsers(); } -void MOverview::editUserRoles(){} -void MOverview::editUserHosts(){} +void MOverview::editUserRoles() +{ + //get selection + QModelIndex sel=usertable->currentIndex(); + if(!sel.isValid())return; + //get uname & descr + QString name=usermodel->data(usermodel->index(sel.row(),0)).toString(); + //... + MUser usr(req,name); + MCheckList acl=usr.getRoles(); + MCheckDialog cd(this,acl,"Edit ACL of user "+name); + if(cd.exec()==QDialog::Accepted) + usr.setRoles(cd.getCheckList()); +} + +void MOverview::editUserHosts() +{ + //get selection + QModelIndex sel=usertable->currentIndex(); + if(!sel.isValid())return; + //get uname & descr + QString name=usermodel->data(usermodel->index(sel.row(),0)).toString(); + //... + MUser usr(req,name); + MCheckList acl=usr.getHosts(); + MCheckDialog cd(this,acl,"Edit hosts of user "+name); + if(cd.exec()==QDialog::Accepted) + usr.setHosts(cd.getCheckList()); +} void MOverview::updateHosts(){} diff --git a/src/smoke.pro b/src/smoke.pro index c0d7e71..0203a0f 100644 --- a/src/smoke.pro +++ b/src/smoke.pro @@ -32,7 +32,8 @@ SOURCES = \ eventedit.cpp \ event.cpp \ room.cpp \ - user.cpp + user.cpp \ + checkdlg.cpp HEADERS = \ keygen.h \ mainwindow.h \ @@ -42,7 +43,10 @@ HEADERS = \ eventedit.h \ event.h \ room.h \ - user.h + user.h \ + checkdlg.h \ + ../www/machine.php \ + ../www/inc/machine/session.php RESOURCES += files.qrc diff --git a/src/smoke_de.ts b/src/smoke_de.ts index 48bce52..ecee680 100644 --- a/src/smoke_de.ts +++ b/src/smoke_de.ts @@ -1,5 +1,141 @@ - + + + @default + + + serverinfo + + + + + startsession + + + + + sessionauth + + + + + closesession + + + + + getmyroles + + + + + getusers + + + + + setuserdescription + + + + + getuseracl + + + + + setuseracl + + + + + getuserhosts + + + + + setuserhosts + + + + + adduser + + + + + deleteuser + + + + + gethosts + + + + + sethost + + + + + addhost + + + + + deletehost + + + + + geteventlist + + + + + geteventdata + + + + + seteventdata + + + + + getroomdata + + + + + setroomdata + + + + + getcustomerlist + + + + + _admin + + + + + MCheckDialog + + + Ok + + + + + Cancel + + + MEvent @@ -327,186 +463,274 @@ At least %1 Bits of random are required. MOverview - + &Session - + &Re-Login - + &Close Session - + &Event - + &Customer - + C&onfigure - + Events - + Warning - + I was unable to renew the login at the server, the error was: %1 - + &Offline mode - - &Show details... - - - - + &New Event... - - &Cancel Event... - - - - + &Show all customers - + C&art - + Add &Ticket - + Add &Voucher - + &Remove Item - + &Abort Shopping - + &Show all orders - + New Event... - + Details... - + Order Ticket... - + Shopping Cart - + Add Ticket - + Add Voucher - + Remove Item - + Customer: - + Delivery Address: - + Comments: - + Save Order - + Clear - + Start Time - + Title - + ddd MMMM d yyyy, h:mm ap time format - + &Update Event List + + + &Show/Edit details... + + + + + Users + + + + + New User... + + + + + Delete User... + + + + + Description... + + + + + Hosts... + + + + + Roles... + + + + + Hosts + + + + + Login Name + + + + + Description + + + + + New User + + + + + Please enter new user name (only letters, digits, and underscore allowed): + + + + + Error + + + + + The user name must contain only letters, digits, and underscores and must be at least one character long! + + + + + Edit Description + + + + + Descriptionof user %1: + + + + + MUserHost + + + _any + + + + + _online + + + + + _anon + + MWebRequest @@ -566,7 +790,7 @@ At least %1 Bits of random are required. - + Error parsing EventList XML data (line %1 column %2): %3 diff --git a/src/smoke_de_SAX.ts b/src/smoke_de_SAX.ts index 4699ce8..0157dd1 100644 --- a/src/smoke_de_SAX.ts +++ b/src/smoke_de_SAX.ts @@ -1,5 +1,142 @@ + + + @default + + + serverinfo + Informadschjon' übern Sörvor. + + + + startsession + 'Ne Seschon anfang' + + + + sessionauth + Am Sörvor anmeld'n + + + + closesession + Dsum Sörvor gude Nachd sachn + + + + getmyroles + Rausfinden was isch machn darf + + + + getusers + Guggn welche Nudsor es gibd + + + + setuserdescription + Nen bleeden Gommendar über jemand andres machn + + + + getuseracl + Rausfinden was een andror darf + + + + setuseracl + Dem Andorn was vorbiedn dürfen + + + + getuserhosts + Rausfinden von wo ä Nudsor arbäden darf + + + + setuserhosts + Fesdleechn von wo ä Nudsor arbäden darf + + + + adduser + 'Nen neuen Nudsor anlechen + + + + deleteuser + 'Nen Nudsor löschen. Eefach so. + + + + gethosts + Rausfinden von wo mor alles arbäden gönnde. + + + + sethost + 'Ne Arbedsschdelle ändorn + + + + addhost + 'Ne neue Arbedsschdelle einrischdn + + + + deletehost + 'Ne Arbedsschdelle dichd machn + + + + geteventlist + Lisde dor Veranschdaldungen holen + + + + geteventdata + Dedails zu eener Veranschdaldung holen + + + + seteventdata + Dedails zu eener Veranschdaldung ändorn + + + + getroomdata + Räumlischgeden anzeichen + + + + setroomdata + Räumlischgeden ändorn + + + + getcustomerlist + Lisde dor Gunden anguggn + + + + _admin + Godd. Darf alles, gann alles, wees alles bessor. + + + + MCheckDialog + + + Ok + + + + + Cancel + + + MEvent @@ -327,186 +464,279 @@ At least %1 Bits of random are required. MOverview - + &Session &Sidsung - + &Re-Login &Noch'ma einloggn - + &Close Session Sidsung &Zumachn - + &Event &Veranschdaldung - + &Customer &Gunde - + C&onfigure G&onfiguriern - + Events Veranschdaldungen - + Warning Dumm gelaufen - + I was unable to renew the login at the server, the error was: %1 Isch gann de' Verbindung off'n gross'n Reschner nisch erneuern. Der will nisch weil: %1 - + &Offline mode &Ohne Neds und Dobbelden Boden - + &Show details... - &Dedails anzeigen... + &Dedails anzeigen... - + &New Event... - &Neue Veranschdaldung... + Veranschdaldung &absach'n... - - &Cancel Event... - Veranschdaldung &absach'n... - - - + &Show all customers &Alle Gunden anzeigen - + C&art Eing&aufswagen - + Add &Ticket Ein&driddsgarde hinzufüchen - + Add &Voucher &Gudschein hinzufüchen - + &Remove Item Doch &ni' nehm' - + &Abort Shopping &Eingauf Abbrechen - + &Show all orders &Alle Beschdellungen anzeichen - + New Event... Neue Veranschdaldung... - + Details... Dedails anzeichen... - + Order Ticket... Eindriddsgarde beschdellen... - + Shopping Cart Eingaufswagen - + Add Ticket Eindriddsgarde hinzufüchen - + Add Voucher Gudschein hinzufüchen - + Remove Item Doch ni' nehm' - + Customer: Gunde: - + Delivery Address: Adresse wo's Zeuch hin soll: - + Comments: Wischdiches Gelaber und Gerede: - + Save Order Beschdellung abschbeichern - + Clear Wechwerfen und von vorne! - + Start Time - + Title - + ddd MMMM d yyyy, h:mm ap time format ddd, d.M.yyyy hh:mm - + &Update Event List + + + &Show/Edit details... + + + + + Users + + + + + New User... + + + + + Delete User... + + + + + Description... + + + + + Hosts... + + + + + Roles... + + + + + Hosts + + + + + Login Name + + + + + Description + + + + + New User + + + + + Please enter new user name (only letters, digits, and underscore allowed): + + + + + Error + + + + + The user name must contain only letters, digits, and underscores and must be at least one character long! + + + + + Edit Description + + + + + Descriptionof user %1: + + + + + MUserHost + + + _any + Irschendeen Gombjudor + + + + _online + De Webseidn + + + + _anon + Annonühm + MWebRequest @@ -566,7 +796,7 @@ At least %1 Bits of random are required. Isch gann misch ned anmälden. - + Error parsing EventList XML data (line %1 column %2): %3 diff --git a/src/user.cpp b/src/user.cpp index 549de5c..f364241 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -15,6 +15,7 @@ #include #include +#include MUser::MUser(MWebRequest*r,QDomElement&e) { @@ -79,6 +80,12 @@ bool MUser::create() } } +void MUser::deleteUser() +{ + if(!isValid())return; + req->request("deleteuser",m_userid.toUtf8()); +} + bool MUser::setDescription(QString d) { m_descr=d; @@ -101,3 +108,196 @@ bool MUser::setDescription(QString d) return false; } } + +MCheckList MUser::getRoles() +{ + //call + req->request("getuseracl",m_userid.toUtf8()); + //check success + MCheckList ret; + if(req->responseStatus()==MWebRequest::Ok){ + QDomDocument doc; + if(!doc.setContent(req->responseBody()))return ret; + QDomNodeList nl=doc.documentElement().elementsByTagName("Role"); + for(int i=0;irequest("setuseracl",doc.toByteArray()); + if(req->responseStatus()==MWebRequest::Ok)return true; + else return false; +} + +MCheckList MUser::getHosts() +{ + //call + req->request("getuserhosts",m_userid.toUtf8()); + //check success + MCheckList ret; + if(req->responseStatus()==MWebRequest::Ok){ + QDomDocument doc; + if(!doc.setContent(req->responseBody()))return ret; + QDomNodeList nl=doc.documentElement().elementsByTagName("Host"); + for(int i=0;irequest("setuserhosts",doc.toByteArray()); + if(req->responseStatus()==MWebRequest::Ok)return true; + else return false; +} + +/********************************************************/ + +MAcl::MAcl() +{ + m_set=false; +} + +MAcl::MAcl(const MAcl&a) + :MCheckItem() +{ + m_role=a.m_role; + m_set=a.m_set; +} + +MAcl::MAcl(QString r,bool s) +{ + m_role=r; + m_set=s; +} + +QString MAcl::role()const +{ + return m_role; +} + +QString MAcl::key()const +{ + return m_role; +} + +QString MAcl::description()const +{ + return QCoreApplication::translate("@default",m_role.toAscii().data()); +} + +QString MAcl::label()const +{ + QString d=description(); + if(d==m_role)return m_role; + else return m_role+": "+d; +} + +bool MAcl::isSet()const +{ + return m_set; +} + +void MAcl::set(bool b) +{ + m_set=b; +} + +MCheckItem* MAcl::copy()const +{ + return new MAcl(*this); +} + +/**************************************************/ + +MUserHost::MUserHost() +{ + m_set=false; +} + +MUserHost::MUserHost(const MUserHost&h) + :MCheckItem() +{ + m_host=h.m_host; + m_set=h.m_set; +} + +MUserHost::MUserHost(QString h,bool s) +{ + m_host=h; + m_set=s; +} + +QString MUserHost::host()const +{ + return m_host; +} + +QString MUserHost::key()const +{ + return m_host; +} + +QString MUserHost::label()const +{ + QStringList special; + special< +#include "checkdlg.h" + class MWebRequest; class QDomElement; @@ -41,13 +43,81 @@ class MUser /**creates user in database; returns true on success*/ bool create(); + /**deletes user from database*/ + void deleteUser(); + /**sets new description, both locally and on server*/ bool setDescription(QString); + /**returns roles of this user (queries server); returns empty list if call fails, returns filled list if call succeeds, the bool will contain whether the user has the role*/ + MCheckList getRoles(); + + /**sends the updated roles to the server; returns true on success*/ + bool setRoles(const MCheckList&); + + /**returns hosts that a user may connect from*/ + MCheckList getHosts(); + + /**send the updated host list of the user to the server; returns true on success*/ + bool setHosts(const MCheckList&); + private: MWebRequest*req; QString m_userid,m_descr; }; +/**overwrites MCheckItem to represent an ACL item for the user*/ +class MAcl:public MCheckItem +{ + public: + MAcl(); + MAcl(const MAcl&); + MAcl(QString,bool); + + /**returns the role this ACL represents*/ + virtual QString role()const; + /**returns the role this ACL represents*/ + virtual QString key()const; + /**attempts to translate the role using the currently active language, this should yield a description of the role if successful or the role name if it fails*/ + virtual QString description()const; + /**returns a usable label (role name + description) for the MCheckDialog */ + virtual QString label()const; + /**returns whether the role is set for this user*/ + virtual bool isSet()const; + /**changes the role setting (used by MCheckDialog)*/ + virtual void set(bool); + + protected: + virtual MCheckItem* copy()const; + private: + QString m_role; + bool m_set; +}; + +/**overwrites MCheckItem to represent a host item for the user*/ +class MUserHost:public MCheckItem +{ + public: + MUserHost(); + MUserHost(const MUserHost&); + MUserHost(QString,bool); + + /**returns the host this item represents*/ + virtual QString host()const; + /**returns the host this item represents*/ + virtual QString key()const; + /**returns a usable label (host name + opt. description for special hosts) for the MCheckDialog */ + virtual QString label()const; + /**returns whether the host is allowed for this user*/ + virtual bool isSet()const; + /**changes the host setting (used by MCheckDialog)*/ + virtual void set(bool); + + protected: + virtual MCheckItem* copy()const; + private: + QString m_host; + bool m_set; +}; #endif diff --git a/www/inc/machine/session.php b/www/inc/machine/session.php index 1deec2d..8a3b4f9 100644 --- a/www/inc/machine/session.php +++ b/www/inc/machine/session.php @@ -248,7 +248,7 @@ function getUserAclXml($user) header("X-MagicSmoke-Status: Ok"); //create list of roles $roles=$ALLOWEDREQUESTS; - $roles[]="_admin"; + $roles[]=tr("_admin"); //get roles from DB $res=$db->select("userrole","role","uname=".$db->escapeString($user)); $acl=array(); @@ -267,6 +267,138 @@ function getUserAclXml($user) print($dom->saveXML()); } +//set the ACL of a user +function setUserAclXml($txt) +{ + //DOM + $xml=new DOMDocument; + if(!$xml->loadXML($txt)){ + header("X-MagicSmoke-Status: SyntaxError"); + die("unable to parse XML data"); + } + //get user name + $acl=$xml->getElementsByTagName("ACL"); + if($acl->length != 1){ + header("X-MagicSmoke-Status: SyntaxError"); + die("expected exactly 1 ACL element"); + } + global $db,$ALLOWEDREQUESTS; + $roles=$ALLOWEDREQUESTS; + $roles[]=tr("_admin"); + $usr=$acl->item(0)->getAttribute("user"); + //check user name + $db->beginTransaction(); + $res=$db->select("users","count(uname)","uname=".$db->escapeString($usr)); + if($res[0][0]!=1){ + header("X-MagicSmoke-Status: SyntaxError"); + $db->rollbackTransaction(); + die("unknown user name"); + } + //update roles + $acl=$xml->getElementsByTagName("Role"); + for($i=0;$i<$acl->length;$i++){ + //does role exist? + $name=$acl->item($i)->getAttribute("name"); + if(array_search($name,$roles)===false)continue; + $isset=$acl->item($i)->getAttribute("set")+0; + if($isset){ + $res=$db->select("userrole","count(role)","uname=".$db->escapeString($usr)." AND role=".$db->escapeString($name)); + if($res[0][0]!=0)continue; + $db->insert("userrole",array("uname"=>$usr,"role"=>$name)); + }else{ + $db->deleteRows("userrole","uname=".$db->escapeString($usr)." AND role=".$db->escapeString($name)); + } + } + $db->commitTransaction(); + header("X-MagicSmoke-Status: Ok"); +} + +//return the hosts of a specific user +function getUserHostsXml($user) +{ + //sanity check + $user=trim($user); + if(ereg("^[A-Za-z0-9_]+$",$user)===false){ + header("X-MagicSmoke-Status: SyntaxError"); + die("invalid user name"); + } + //go on... + global $db; + header("X-MagicSmoke-Status: Ok"); + //create list of hosts + $hosts=array(); + $res=$db->select("host","hostname",""); + for($i=0;$iselect("userhosts","host","uname=".$db->escapeString($user)); + $acl=array(); + foreach($res as $rl)$acl[]=$rl["host"]; + $dom=new DOMDocument; + $root=$dom->createElement("Hosts"); + $root->setAttributeNode(new DOMAttr("user",$user)); + foreach($hosts as $hs){ + $re=$dom->createElement("Host"); + $re->setAttributeNode(new DOMAttr("name",$hs)); + if(array_search($hs,$acl)===false)$re->setAttributeNode(new DOMAttr("set","0")); + else $re->setAttributeNode(new DOMAttr("set","1")); + $root->appendChild($re); + } + $dom->appendChild($root); + print($dom->saveXML()); +} + +//set the Hosts of a user +function setUserHostsXml($txt) +{ + //DOM + $xml=new DOMDocument; + if(!$xml->loadXML($txt)){ + header("X-MagicSmoke-Status: SyntaxError"); + die("unable to parse XML data"); + } + //get user name + $acl=$xml->getElementsByTagName("Hosts"); + if($acl->length != 1){ + header("X-MagicSmoke-Status: SyntaxError"); + die("expected exactly 1 Hosts element"); + } + global $db; + //create list of hosts + $hosts=array(); + $res=$db->select("host","hostname",""); + for($i=0;$iitem(0)->getAttribute("user"); + //check user name + $db->beginTransaction(); + $res=$db->select("users","count(uname)","uname=".$db->escapeString($usr)); + if($res[0][0]!=1){ + header("X-MagicSmoke-Status: SyntaxError"); + $db->rollbackTransaction(); + die("unknown user name"); + } + //update roles + $acl=$xml->getElementsByTagName("Host"); + for($i=0;$i<$acl->length;$i++){ + //does role exist? + $name=$acl->item($i)->getAttribute("name"); + if(array_search($name,$hosts)===false)continue; + $isset=$acl->item($i)->getAttribute("set")+0; + if($isset){ + $res=$db->select("userhosts","count(host)","uname=".$db->escapeString($usr)." AND host=".$db->escapeString($name)); + if($res[0][0]!=0)continue; + $db->insert("userhosts",array("uname"=>$usr,"host"=>$name)); + }else{ + $db->deleteRows("userhosts","uname=".$db->escapeString($usr)." AND host=".$db->escapeString($name)); + } + } + $db->commitTransaction(); + header("X-MagicSmoke-Status: Ok"); +} + //helper function: parse User-XML-structure function parseUserXml($txt) { @@ -323,6 +455,24 @@ function addUserXml($txt) } $dom->appendChild($root); print($dom->saveXML()); + header("X-MagicSmoke-Status: Ok"); +} + +//delete a user +function deleteUserXml($txt) +{ + global $db; + $usr=trim($txt); + //delete ACL + $db->deleteRows("userroles","uname=".$db->escapeString($usr)); + //delete Hosts + $db->deleteRows("userhosts","uname=".$db->escapeString($usr)); + //delete open sessions + $db->deleteRows("session","user=".$db->escapeString($usr)); + //attempt to delete User itself + $db->deleteRows("users","uname=".$db->escapeString($usr)); + //say OK anyway; FIXME: check for success above + header("X-MagicSmoke-Status: Ok"); } ?> \ No newline at end of file diff --git a/www/machine.php b/www/machine.php index 3e99118..9f92709 100644 --- a/www/machine.php +++ b/www/machine.php @@ -158,16 +158,28 @@ if($SMOKEREQUEST=="getuseracl"){ exit(); } -if($SMOKEREQUEST=="setuseracl"){} -if($SMOKEREQUEST=="getuserhosts"){} -if($SMOKEREQUEST=="setuserhosts"){} +if($SMOKEREQUEST=="setuseracl"){ + setUserAclXml($REQUESTDATA); + exit(); +} +if($SMOKEREQUEST=="getuserhosts"){ + getUserHostsXml($REQUESTDATA); + exit(); +} +if($SMOKEREQUEST=="setuserhosts"){ + setUserHostsXml($REQUESTDATA); + exit(); +} if($SMOKEREQUEST=="adduser"){ addUserXml($REQUESTDATA); exit(); } -if($SMOKEREQUEST=="deleteuser"){} +if($SMOKEREQUEST=="deleteuser"){ + deleteUserXml($REQUESTDATA); + exit(); +} if($SMOKEREQUEST=="gethosts"){} if($SMOKEREQUEST=="sethost"){} if($SMOKEREQUEST=="addhost"){} -- 1.7.2.5