From f2ea796ba8d73c8f25310edfa04b6b58f43cd412 Mon Sep 17 00:00:00 2001 From: gareth Date: Wed, 7 Mar 2007 19:08:00 +0000 Subject: Added OGS --- ogs/gridserver/usersessions/.htaccess | 5 +++ ogs/gridserver/usersessions/index.php | 85 +++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 ogs/gridserver/usersessions/.htaccess create mode 100644 ogs/gridserver/usersessions/index.php (limited to 'ogs/gridserver/usersessions') diff --git a/ogs/gridserver/usersessions/.htaccess b/ogs/gridserver/usersessions/.htaccess new file mode 100644 index 0000000..3b76a74 --- /dev/null +++ b/ogs/gridserver/usersessions/.htaccess @@ -0,0 +1,5 @@ +Options +FollowSymlinks + +RewriteEngine on +RewriteOptions MaxRedirects=1 +RewriteRule .* index.php [L] diff --git a/ogs/gridserver/usersessions/index.php b/ogs/gridserver/usersessions/index.php new file mode 100644 index 0000000..e7a3817 --- /dev/null +++ b/ogs/gridserver/usersessions/index.php @@ -0,0 +1,85 @@ +0) { + $info=mysql_fetch_assoc($result); + $circuit_code = $info['circuit_code']; + if($circuit_code == 0) $circuit_code=$params['4']; + $secure_session_id=$info['secure_session_id']; + $session_id=$info['session_id']; + + $query = "SELECT * FROM local_user_profiles WHERE userprofile_LLUUID='$agent_id'"; + $result=mysql_query($query); + $userinfo=mysql_fetch_assoc($result); + $firstname=$userinfo['profile_firstname']; + $lastname=$userinfo['profile_lastname']; + $agent_id=$userinfo['userprofile_LLUUID']; + $exists=1; +} else { + $exists=0; +} + +// if only 3 params, assume we are sending an XML response +if(count($params)==3) { + output_xml_block("usersession",Array( + 'authkey' => $sim_sendkey, + 'circuit_code' => $circuit_code, + 'agent_id' => $agent_id, + 'session_id' => $session_id, + 'secure_session_id' => $secure_session_id, + 'firstname' => $firstname, + 'lastname' => $lastname + )); +} + +switch($cmd) { + case 'exists': + echo $exists; + break; + case 'delete': + $query = "UPDATE sessions SET session_active=0, session_end=NOW() WHERE agent_id='$agent_id' LIMIT 1"; + $deleteresult = mysql_query($query); + break; +} +?> -- cgit v1.1