Anonymous 3D Imageboard http://cyberia.digital/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

241 lines
6.6KB

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <link href="CSS/bootstrap-hacker-theme/css/bootstrap4-neon-glow.min.css" rel="stylesheet">
  6. <link href="CSS/style.css" rel="stylesheet">
  7. <title>ADMIN OF THE BOARD</title>
  8. </head>
  9. <body>
  10. <div>===================</div>
  11. <div>ADMIN OF THE BOARD</div>
  12. <div>===================</div>
  13. <div>
  14. <div>Manage the database player+arts here.</div>
  15. <div style="font-size:xx-small">Map powered by LAZER&reg;</div>
  16. <br/>
  17. <div>Admin pswd:
  18. <br><input id="admin-password" type="password"/>
  19. </div>
  20. <button onClick="setPassword()">Set password</button>
  21. <button onClick="validPassword()">Test password</button>
  22. <br/>
  23. <div id="manage-interface">
  24. <div>------------------------</div>
  25. <div><b>List of the different WS</b></div>
  26. <div>
  27. <button onClick="initDb()">Init the Database</button>
  28. <button onClick="eraseDb()">Erase the Database</button><br/>
  29. <button onClick="initBans()">Init the Bans table</button>
  30. <button onClick="eraseBans()">Erase the Bans table</button><br/>
  31. <button onClick="initMapsAndPosts()">Init Maps snd Posts</button>
  32. <button onClick="eraseMapsAndPosts()">Erase Maps and Posts</button>
  33. </div>
  34. </div>
  35. <div>------------------------</div>
  36. <div><b>Web service response</b></div>
  37. <textarea id="admin-ws_response" type="" name="" rows="4" cols="60" placeholder="The WS response"></textarea>
  38. </div>
  39. <br/>
  40. </body>
  41. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
  42. <script>
  43. //Manage the DB
  44. function initDb(){
  45. $.ajax({
  46. type: "POST",
  47. url: "DatabaseWebService.php",
  48. data: {
  49. 'action':'initDB',
  50. 'password': $( '#admin-password' ).val()
  51. },
  52. success:function(data){
  53. $("#admin-ws_response").val(data);
  54. },
  55. error: function(xhr, textStatus, errorThrown){
  56. console("Some error happened");
  57. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  58. }
  59. });
  60. }
  61. function initMapsAndPosts(){
  62. $.ajax({
  63. type: "POST",
  64. url: "DatabaseWebService.php",
  65. data: {
  66. 'action':'initMapsAndPosts',
  67. 'password': $( '#admin-password' ).val()
  68. },
  69. success:function(data){
  70. $("#admin-ws_response").val(data);
  71. },
  72. error: function(xhr, textStatus, errorThrown){
  73. console("Some error happened");
  74. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  75. }
  76. });
  77. }
  78. function eraseDb(){
  79. $.ajax({
  80. type: "POST",
  81. url: "DatabaseWebService.php",
  82. data: {
  83. 'action':'destroyDB',
  84. 'password': $( '#admin-password' ).val()
  85. },
  86. success:function(data){
  87. $("#admin-ws_response").val(data);
  88. },
  89. error: function(xhr, textStatus, errorThrown){
  90. console("Some error happened");
  91. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  92. }
  93. });
  94. }
  95. function eraseMapsAndPosts(){
  96. $.ajax({
  97. type: "POST",
  98. url: "DatabaseWebService.php",
  99. data: {
  100. 'action':'destroyMapsAndPosts',
  101. 'password': $( '#admin-password' ).val()
  102. },
  103. success:function(data){
  104. $("#admin-ws_response").val(data);
  105. },
  106. error: function(xhr, textStatus, errorThrown){
  107. console("Some error happened");
  108. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  109. }
  110. });
  111. }
  112. //erase bans
  113. function eraseBans(){
  114. $.ajax({
  115. type: "POST",
  116. url: "DatabaseWebService.php",
  117. data: {
  118. 'action':'destroyBans',
  119. 'password': $( '#admin-password' ).val()
  120. },
  121. success:function(data){
  122. $("#admin-ws_response").val(data);
  123. },
  124. error: function(xhr, textStatus, errorThrown){
  125. console("Some error happened");
  126. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  127. }
  128. });
  129. }
  130. //erase bans
  131. function initBans(){
  132. $.ajax({
  133. type: "POST",
  134. url: "DatabaseWebService.php",
  135. data: {
  136. 'action':'initBans',
  137. 'password': $( '#admin-password' ).val()
  138. },
  139. success:function(data){
  140. $("#admin-ws_response").val(data);
  141. },
  142. error: function(xhr, textStatus, errorThrown){
  143. console("Some error happened");
  144. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  145. }
  146. });
  147. }
  148. //Password SET
  149. function setPassword(){
  150. $.ajax({
  151. type: "POST",
  152. url: "ChanWebService.php",
  153. data: {
  154. 'action':'setAdminPassword',
  155. 'password': $( '#admin-password' ).val()
  156. },
  157. success:function(data){
  158. $("#admin-ws_response").val("password settings is "+data.result+"; if false it's mean there's probabably already a password");
  159. },
  160. error: function(xhr, textStatus, errorThrown){
  161. console("Some error happened");
  162. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  163. }
  164. });
  165. }
  166. function validPassword(){
  167. $.ajax({
  168. type: "POST",
  169. url: "ChanWebService.php",
  170. data: {
  171. 'action':'validAdmin',
  172. 'password': $( '#admin-password' ).val()
  173. },
  174. success:function(data){
  175. $("#admin-ws_response").val("password test is "+data.result);
  176. },
  177. error: function(xhr, textStatus, errorThrown){
  178. console("Some error happened");
  179. $("#admin-ws_response").val("xhr ="+xhr+"; textStatus= "+textStatus+"; errorThrown="+errorThrown);
  180. }
  181. });
  182. }
  183. </script>
  184. </html>