Advertisement
Guest User

Untitled

a guest
May 22nd, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.17 KB | None | 0 0
  1. <!doctype html>
  2. <?php
  3. session_start();
  4. define("_VALID_PHP", true);
  5. require_once realpath(__DIR__.'/..').'/init.php';
  6. ?>
  7. <html>
  8. <head>
  9. <meta charset="utf-8">
  10. <title>DankHax Exec</title>
  11. <style type="text/css">
  12. #wrapper {
  13. margin-top: 5%;
  14. margin-right: auto;
  15. margin-left: auto;
  16. margin-bottom: auto;
  17. padding-top: 5px;
  18. padding-right: 18px;
  19. padding-left: 18px;
  20. padding-bottom: 4px;
  21. clear: both;
  22. height: 40%;
  23. width: 40%;
  24. border: 2px solid #DFDFDF;
  25. right: 30%;
  26. left: 30%;
  27. top: 50px;
  28. bottom: 50px;
  29. font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
  30. color: #000000;
  31. text-align: center;
  32. background-color: #F8F8F8;
  33. -webkit-box-shadow: 0 0 12px 3px #2F2F2F;
  34. box-shadow: 0 0 12px 3px #2F2F2F;
  35. }
  36. .main {
  37. background-color: #252525;
  38. background-image: 4.jpg;
  39. background-repeat:no-repeat;
  40. background-size:cover;
  41. }
  42. .noti {
  43. background-color: #AEF8A2;
  44. text-align: center;
  45. border: 1px solid #0F0F0F;
  46. color: #454545;
  47. }
  48.  
  49. .errorNoti {
  50. background-color: #ff8080;
  51. text-align: center;
  52. border: 1px solid #0F0F0F;
  53. color: #454545;
  54. }
  55.  
  56. }
  57. </style>
  58. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  59. </head>
  60. <body class="main" background="4.jpg">
  61. <div id="wrapper">
  62. <?php if (!$user->checkMembership("12")) : ?>
  63. <h3>This is an admin panel. Admins only.</h3>
  64. <?php else: ?>
  65.  
  66. <link rel= stylesheet" type="text/css" href="http://w2ui.com/stc/w2ui-1.4.2.min.css" />
  67.  
  68. <h2>DankHax Admin Panel</h2>
  69.  
  70.  
  71. <div class="noti" id="noti" style="display: none;">
  72. <p id="p1"><b>shit and more shit</b></p>
  73. </div>
  74.  
  75.  
  76.  
  77. <?php
  78. if (isset($_POST["uid"])) {
  79. $uid = $_POST["uid"];
  80. $name = $_POST["user"];
  81. $servername = "85.17.21.177";
  82. $username = "rin2mxem_uids";
  83. $password = "HX.4bc?)b.z%";
  84. $dbname = "rin2mxem_uids";
  85.  
  86. //$conn = new mysqli($servername, $username, $password, $dbname);
  87.  
  88. $sql = ("SELECT uid FROM `playerUids` WHERE `username` = '".$name."'");
  89. $conn = mysql_connect($servername, $username, $password);
  90. mysql_select_db($dbname, $conn);
  91. $result = mysql_query($sql);
  92. if (!$result) {
  93. die('MySQL error: ' . mysql_error());
  94. }
  95. if ($row = mysql_fetch_assoc($result)) {
  96. $oldUID = $row["uid"];
  97. }
  98. mysql_close($conn);
  99. //$oldUID = $result->fetch_assoc();
  100. $conn = new mysqli($servername, $username, $password, $dbname);
  101.  
  102. if ($conn->connect_error) {
  103. die("Connection failed: " . $conn->connect_error);
  104. }
  105.  
  106. if (isset($oldUID))
  107. {
  108. $sql = "update playerUids set uid = replace(uid, '".$oldUID."', '".$uid."');";
  109.  
  110. if ($conn->query($sql) === TRUE) {
  111. unset($_POST['uid']);
  112. $_POST['success'] = '1';
  113.  
  114. $date = date('Y/m/d H:i:s');
  115. $logg = fopen("uidlog.txt", "a");
  116. $admin = $user->username;
  117. $toLog = "[$date] | OLD UID: $oldUID | NEW UID: $uid | NAME: $name | CHANGED BY: $admin |";
  118. $logtxt = $toLog . "\n";
  119. fwrite($logg, $logtxt);
  120.  
  121. } else {
  122. echo "Error: " . $sql . "<br>" . $conn->error;
  123. }
  124.  
  125.  
  126. }
  127. else
  128. {
  129. $js = '<script>$("#p1").text("Username was not found from the database!"); $("#noti").slideDown(); </script>';
  130. echo ($js);
  131. }
  132. $conn->close();
  133. }
  134. if (isset($_POST['success']))
  135. {
  136. unset($_POST['success']);
  137. $name = $_POST["user"];
  138. $js = '<script>$("#p1").text("'.$name.'\'s UID was successfully changed!"); $("#noti").slideDown(); </script>';
  139. echo ($js);
  140. }
  141. if (isset($_POST['devmodeEnabled']))
  142. {
  143. if ($_POST['devmodeEnabled'] == 'enabled')
  144. {
  145. $myfile = fopen("maintaince.txt", "w");
  146. $txt = "1";
  147. fwrite($myfile, $txt);
  148. fclose($myfile);
  149. }
  150. else
  151. {
  152. $myfile = fopen("maintaince.txt", "w");
  153. $txt = "0";
  154. fwrite($myfile, $txt);
  155. fclose($myfile);
  156. }
  157. }
  158.  
  159. ?>
  160.  
  161.  
  162. <p>To change the UID please enter username and new UID.</p>
  163.  
  164.  
  165.  
  166. <form action="" method="post">
  167. <p>Username:
  168. <input id="user" type="text" placeholder="xxxxx" name="user" autocomplete="off" required>
  169. UID:
  170. <input id="uid" type="text" placeholder="xxxxxxxxx" name="uid" autocomplete="off" required>
  171. </p>
  172. <input type="submit" name="subUID" value="Change"/>
  173. </form>
  174.  
  175. <p>Toggle Development Mode (Disable User Execs)</p>
  176. <form action="" method="post">
  177. <input type="checkbox" name="devmodeEnabled" value="enabled">Enable Development Mode</br>
  178. <input type="submit" name="subDevMode" value="Set"/>
  179. </form>
  180.  
  181.  
  182. <?php endif;?>
  183.  
  184. </div>
  185. <h6>
  186. <center>I would like to point out that neither of us are web devs...
  187. </center>
  188. </h6>
  189. </body>
  190.  
  191.  
  192. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement