small re-organisation of usersessions/index.php
parent
8bb7f6a48e
commit
991245282c
|
@ -20,8 +20,6 @@ if($params[1]!=$sim_recvkey) {
|
|||
die();
|
||||
}
|
||||
|
||||
// if only 4 params, assume we are sending an XML response
|
||||
if(count($params)==3) {
|
||||
$link = mysql_connect($dbhost,$dbuser,$dbpasswd)
|
||||
OR die("Unable to connect to database");
|
||||
|
||||
|
@ -29,10 +27,8 @@ if(count($params)==3) {
|
|||
or die("Unable to select database");
|
||||
|
||||
$agent_id = strtolower($params[2]);
|
||||
|
||||
$query = "SELECT * FROM sessions WHERE agent_id='$agent_id' AND session_active=1";
|
||||
|
||||
|
||||
$result = mysql_query($query);
|
||||
if(mysql_num_rows($result)>0) {
|
||||
$info=mysql_fetch_assoc($result);
|
||||
|
@ -46,7 +42,10 @@ if(count($params)==3) {
|
|||
$firstname=$userinfo['profile_firstname'];
|
||||
$lastname=$userinfo['profile_lastname'];
|
||||
$agent_id=$userinfo['userprofile_LLUUID'];
|
||||
}
|
||||
|
||||
// if only 4 params, assume we are sending an XML response
|
||||
if(count($params)==3) {
|
||||
output_xml_block("usersession",Array(
|
||||
'authkey' => $sim_sendkey,
|
||||
'circuit_code' => $circuit_code,
|
||||
|
@ -57,7 +56,6 @@ if(count($params)==3) {
|
|||
'lastname' => $lastname
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue