Guest User

Untitled

a guest
Feb 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.86 KB | None | 0 0
  1. <?php
  2. if (!$housekeeping->isAuthorized("hk_management.remotesignout")) {
  3.     $nopage = 1;
  4. } else {
  5. ?>
  6. <SPAN class=SUBHEADLINE>Remote Logout</SPAN><BR>
  7. <BR>
  8. This tool allows you to remotely disconnect a user from the hotel.<br/>
  9. <i>The user must be online or this tool is usless</i><br/>
  10. <?php
  11. $userQ = mysql_query("SELECT * FROM `users` WHERE `'".$type."'` = '".$_POST['search']."'");
  12. if (isset($_POST['disconnect'])) {
  13. $theip = $housekeeping->securePost($_POST['ip']);
  14.     if(isset($_POST['search']) == NULL) {
  15.         echo("<br/><span style=color:red><b>You left a field blank!</b></span><br />");
  16.     } else {
  17.         if($_POST['search_type'] == 'userid') {
  18.         $type = 'id';
  19.         } elseif($_POST['search_type'] == 'username') {
  20.         $type = 'username';
  21.         } elseif($_POST['search_type'] == 'ip') {
  22.         $type = 'ip_last';
  23.         }
  24.         if(mysql_num_rows($userQ) > 0) {
  25.         echo("<br/><span style=color:red><b>User not found</d></span><br />");
  26.         } else {
  27.         $userI = mysql_fetch_array($userQ);
  28.         $userid = $userI['id'];
  29.         if ($housekeeping->sendMUS('signout', $userid)) {
  30.         echo("<br/><span style=color:green><b>'".$_POST['search']."'</b> has been disconnected.</span><br />");
  31.         } else {
  32.         echo("<br/><span style=color:red><b>Unable to connect to $housekeeping->siteName</b>!</span><br />");
  33. }
  34. }
  35. }
  36. }
  37. ?>
  38.  
  39. <br/>
  40. <FORM action=main?remote_signout method=POST>
  41. <TABLE cellSpacing=0 cellPadding=3 border=0>
  42.   <TBODY>
  43.   <TR>
  44.     <TD>Select: </TD>
  45.     <TD><SELECT name=search_type>
  46.         <OPTION value=userid>userid is</OPTION>
  47.         <OPTION value=username>username is</OPTION>
  48.         <OPTION value=ip_last>ip_last is</OPTION>
  49.     </SELECT></TD>
  50.    </TR>
  51.   <TR>
  52.     <TD></TD>
  53.     <TD><INPUT value="" name=search style=width:200px> </TD></TR>
  54.   <TR>
  55.     <TD></TD>
  56.     <TD><INPUT type=submit value="Disconnect" name=disconnect id=disconnect>
  57. </TD></TR></TBODY></TABLE></FORM>
  58. <?php
  59. }
  60. ?>
Add Comment
Please, Sign In to add comment