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