I need a very fast turnaround on a simple set of functions that create responses for post statements. We have a very small database with 4 tables (User, admin, options and data). The current application is simply there to manage user log-ins and managers a user community created by? [login to view URL] We have extended the db by one table.
We now would like to be able to access the database via post commands that are secured by a session cookie. We expect to be able to interogate the db by sending urls (post)
We expect a range of commands to be enables including user managemnt calls such as register, confirm, change, inactivate, changepass, searchuser, listusers) but also some data exchanges with the new table (find,get,put,delete).? We reward puctuality! We will need daily communication on progress.?
## Deliverables
Clarification of the [login to view URL] script that will intorogate the attached mysql database:
URLS are sent to the webserver looking like this:? <[login to view URL]>
The php script will resolve the request and call functions withing a function script that wil generate return xml similar to the following:
<SERVER>
? <RESPONSE>
? ? ? <SID>REYyMTgzRTNGNjU1Qjc2RjkxRTAxNzJBNDc2RTdFQjR8MTkx
? ? ? </SID>
? ? </RESPONSE>
</SERVER>
The following calls must be supported on the User table:
- register (Registers a new user)- returns TRUE/FALSE
- confirm (Confirms a new registered user? - client side send) returns TRUE/FLASE
- login (creates the session id) - Returns Session ID
- logout (logs a user out) - Returns TRUE/FALSE
- change (Change any field in the user table except user or userid) - Returns? TRUE/FALSE
- deactivate (closes a user account) - Returns? TRUE/FALSE
- reactivate (reactivates a user) - Returns? TRUE/FALSE
- delete (deletes a user account) -? Returns TRUE/FALSE
- finduser (allows users to be found based on any wildcard search element within user) - Returns list of multiple records and details of each account
- finduserlight (as above, but only returns userid and username)
- userinfo (recalls 1 user records) - returns all information on one user
In regards to the data table only a few capabilities are required:
- delete line (based on name and type field)
- find record (based on wild card search in any field)
- retrieve record (based on name and type input)
- create record including long text post in foeld data!!!
- amend record including long text in field data!!!!
- addtodata (adds data at the end of the data field)
- retrievedata (simpley presents back the content of the datafield with no xml around it as a .xml (simply assume we will be storing xml documents in the data field, so we don't need more tags :)
I would expect something like this on the phpside:
// This is the vairable that sets the root path of the website
$Root_Path = "./";
$config = $Root_Path."[login to view URL]";
require($Root_Path."[login to view URL]");//<- the main script you deliver!
// Get variables
$action = $_GET['action'];
$xsid = $_GET['sid'];
$data = $_GET['data'];
$userid = $_GET['useridid'];
...
function isSessionIDValid($config, $xsid)
{...}
switch($action){
///////////////////////////////////////////////////////////////////////////////////////////
// LOGOUT
// Params: action, sid
////////////////////////////////////////////////////////////////////////////////////////////
case "logout":
? if(isSessionIDValid($config, $xsid)){
? //Instantiate the? command Class
? ? ? $ocommand = new command($config);
? ? ? $sid = $ocommand->delete_session($config, $xsid);
? ? ? unset($ocommand);
? ? ? echo "<RESPONSE>\n";
? ? ? echo "<LOGOUT>TRUE</LOGOUT>\n";
? ? ? echo "</RESPONSE>\n";
? ? }else{
? ? ? echo "<RESPONSE>\n";
? ? ? echo "<LOGOUT>FLASE</LOGOUT>\n";
? ? ? echo "</RESPONSE>\n";
}
break;
////////////////////////////////////////////////////////////////////////////////////////////
// LOGIN
// Params: action, user, pass
////////////////////////////////////////////////////////////////////////////////////////////
case "login":
....
The main delivery is the [login to view URL] where all the functions are housed, and the [login to view URL] where the get is being processed. [login to view URL] will be included via include(see above) in [login to view URL]
I hope this should be straight forward ifor a coder who has done this type of work before.
I have attached files here which is the original maaking script (as downloaded from the site) and the database dump from mysql which shows the db as well as the aditional table for the data. Please make sure that this works with the database as it is included, and not using different lables or names.
Kind regards
pgnnew