Advertisement
Guest User

Untitled

a guest
Oct 16th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.63 KB | None | 0 0
  1. <?php
  2. require('../includes/config.php');
  3. require('../structure/database.php');
  4. require('../structure/base.php');
  5. require('../structure/user.php');
  6.  
  7. $database = new database($db_host, $db_name, $db_user, $db_password);
  8. $base = new base($database);
  9. $user = new user($database);
  10. $user->updateLastActive();
  11.  
  12. $username = $user->getUsername($_COOKIE['user'], 2);
  13. $rank = $user->getRank($username);
  14.  
  15. if($rank < 4) $base->redirect('../index.php');
  16.  
  17. $salt = substr(hash(sha256, sha1(time())), 10);
  18. $rpassword = $_POST['requested_password'] == $salt .hash(sha256, md5(sha1($_POST['password']))) . substr($salt, 0, -51);
  19.  
  20. ?>
  21. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  22. <html xmlns:IE>
  23. <head>
  24. <meta http-equiv="Expires" content="0">
  25. <meta http-equiv="Pragma" content="no-cache">
  26. <meta http-equiv="Cache-Control" content="no-cache">
  27. <meta name="MSSmartTagsPreventParsing" content="TRUE">
  28. <title><?php echo $data['wb_title']; ?></title>
  29. <link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all">
  30. <link href="../css/main/title-5.css" rel="stylesheet" type="text/css" media="all">
  31. <link href="../css/kbase-2.css" rel="stylesheet" type="text/css" media="all" />
  32. <link rel="shortcut icon" href="../img/favicon.ico" />
  33. <?php include('../includes/google_analytics.html'); ?>
  34. <script type="text/javascript">
  35. function goBack()
  36. {
  37. window.history.back();
  38. }
  39. </script>
  40. </head>
  41. <div id="body">
  42. <?php $base->getNavBar($username, $path, $rank); ?>
  43. <br/><br/>
  44.  
  45. <div style="text-align: center; background: none;">
  46. <div class="titleframe e">
  47. <b>Administration - Recovery requests</b><br> <a href="../index.php" class=c>Main Menu</a> - <a href="index.php">Admin Control Panel</a>
  48. </div>
  49. </div>
  50. <br/>
  51. <br/>
  52. <div class="titleframe e" style="text-align:left; color:white; width:750px; margin-left:auto; margin-right:auto;">
  53. Recovery requests are displayed one at a time to keep the steady flow. - <b>currently functional but under development</b>.<br><br/>
  54. <?php
  55. //query details
  56. $tracking = $database->processQuery("SELECT id, ip, date, account, a1, a2, a3, a4, a5, message_content, reg_date, requested_password FROM tracking WHERE status = 0 ORDER BY id ASC LIMIT 0,1", array(), true);
  57.  
  58. if($database->getRowCount() == 0)
  59. {
  60. ?>
  61. <center><h2>No recovery requests at this time.</h2></center>
  62. <?php
  63. }
  64. else {
  65. $recovery = $database->processQuery("SELECT cancel, a1, a2, a3, a4, a5 FROM `recoveries` WHERE `id` = ?", array($tracking[0]['account']), true);
  66. $users = $database->processQuery("SELECT password, reg_date FROM users WHERE id = ?", array($user->getIdByName($username)), true);
  67. $database->processQuery("SELECT password FROM users WHERE id = ? LIMIT 1", array($user->getUserId($_COOKIE['user'])), true);
  68.  
  69. if (isset($_POST['password'])) {
  70. $tracking = hash(sha256, md5(sha1($_POST['requested_password'])));
  71.  
  72. //update user password
  73. $update = $database->processQuery("UPDATE `users` SET `password` = ? WHERE `id` = ? LIMIT 1", array($password, $info[0]['account']), false);
  74. $requested_password = substr(substr($update[0]['password'], 54), 0, -3);
  75. }
  76. ?>
  77.  
  78. <center>
  79. <table width="55%">
  80. <tr>
  81. <td style="color:red; font-weight: bold">Username</td>
  82. <td><?php echo $user->dName($user->getNameById($tracking[0]['account'])); ?></td>
  83. </tr>
  84. <tr>
  85. <td style="border-bottom:1px dotted white;">I.P</td>
  86. <td style="border-bottom:1px dotted white;"><?php echo $tracking[0]['ip']; ?></td>
  87. </tr>
  88.  
  89. <!-- QUESTION ONE -->
  90.  
  91. <tr>
  92. <td>Question #1</td>
  93. <td>What is your favorite meal? - broken</td>
  94. </tr>
  95. <tr>
  96. <td>Actual Answer</td>
  97. <td><?php echo $recovery[0]['cancel']; ?></td>
  98. </tr>
  99. <tr>
  100. <td style="border-bottom:2px yellow dotted;">Supplied Answer</td>
  101. <td style="border-bottom:2px yellow dotted;"><?php echo $tracking[0]['a1']; ?></td>
  102. </tr>
  103.  
  104. <!-- QUESTION TWO -->
  105.  
  106. <tr>
  107. <td>Question #2</td>
  108. <td>Who was your best friend growing up?</td>
  109. </tr>
  110. <tr>
  111. <td>Actual Answer</td>
  112. <td><?php echo $recovery[0]['a1']; ?></td>
  113. </tr>
  114. <tr>
  115. <td style="border-bottom:2px yellow dotted;">Supplied Answer</td>
  116. <td style="border-bottom:2px yellow dotted;"><?php echo $tracking[0]['a2']; ?></td>
  117. </tr>
  118.  
  119. <!-- QUESTION THREE -->
  120.  
  121. <tr>
  122. <td>Question #3</td>
  123. <td>What is your mothers maiden name?</td>
  124. </tr>
  125. <tr>
  126. <td>Actual Answer</td>
  127. <td><?php echo $recovery[0]['a2']; ?></td>
  128. </tr>
  129. <tr>
  130. <td style="border-bottom:2px yellow dotted;">Supplied Answer</td>
  131. <td style="border-bottom:2px yellow dotted;"><?php echo $tracking[0]['a3']; ?></td>
  132. </tr>
  133.  
  134. <!-- QUESTION FOUR -->
  135.  
  136. <tr>
  137. <td>Question #4</td>
  138. <td>Where were you born?</td>
  139. </tr>
  140. <tr>
  141. <td>Actual Answer</td>
  142. <td><?php echo $recovery[0]['a3']; ?></td>
  143. </tr>
  144. <tr>
  145. <td style="border-bottom:2px yellow dotted;">Supplied Answer</td>
  146. <td style="border-bottom:2px yellow dotted;"><?php echo $tracking[0]['a4']; ?></td>
  147. </tr>
  148.  
  149. <!-- QUESTION FIVE -->
  150.  
  151. <tr>
  152. <td>Question #5</td>
  153. <td>What color was your first bedroom?</td>
  154. </tr>
  155. <tr>
  156. <td>Actual Answer</td>
  157. <td><?php echo $recovery[0]['a4']; ?></td>
  158. </tr>
  159. <tr>
  160. <td style="border-bottom:2px yellow dotted;">Supplied Answer</td>
  161. <td style="border-bottom:2px yellow dotted;"><?php echo $tracking[0]['a5']; ?></td>
  162. </tr>
  163.  
  164. <!-- DETAILS -->
  165.  
  166. <tr>
  167. <td>Date Registered</b></td>
  168. </tr>
  169. <tr>
  170. <td>Actual Answer</td>
  171. <td><?php echo $users[0]['reg_date']; ?></td>
  172. </tr>
  173. <tr>
  174. <td style="border-bottom:2px yellow dotted;">Supplied Answer</td>
  175. <td style="border-bottom:2px yellow dotted;"><?php echo $tracking[0]['reg_date']; ?></td>
  176. </tr>
  177.  
  178. <!-- DETAILS -->
  179.  
  180. <tr>
  181. <td>Message Contents</td>
  182. </tr>
  183. <tr>
  184. <td style="border-bottom:2px yellow dotted;">Explanation</td>
  185. <td style="border-bottom:2px yellow dotted;"><?php echo $tracking[0]['message_content']; ?></td>
  186. </tr>
  187.  
  188. <tr>
  189. <td>
  190. <form action="recovery_takeaction.php?action=1&id=<?php echo $tracking[0]['id']; ?>" method="POST">
  191. <input type="Submit" value="Accept"></td>
  192. </form>
  193. <td>
  194. <form action="recovery_takeaction.php?action=2&id=<?php echo $tracking[0]['id']; ?>" method="POST">
  195. <input type="submit" value="Deny"></td>
  196. </form>
  197. </tr>
  198. </table>
  199. </center>
  200.  
  201. <?php
  202. }
  203. ?>
  204. </div>
  205. </div>
  206.  
  207. <div class="tandc"><?php echo $data['wb_foot']; ?></div>
  208. </body>
  209. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement