Advertisement
Guest User

Untitled

a guest
Nov 10th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.73 KB | None | 0 0
  1. <?php
  2.  
  3. include 'config.php';
  4.  
  5. if (isset($_POST['delete2'])) {
  6.  
  7. $new_settings = '<?php
  8. // Can be made/found at the Dasboard then in the "API" tab on the left.
  9. // https://cp-sg.cloud.z.com/API/
  10. $apiUser = "";
  11. $apiPassword = "";
  12. $tenantID = "";
  13. // Image Name. Make sure there is only 1 image with this name.
  14. $imageName = "";
  15. ';
  16.  
  17.  
  18. file_put_contents("config.php", $new_settings);
  19.  
  20. header("Refresh:0");
  21. exit;
  22. }
  23.  
  24. if (isset($_POST['create2']))
  25. {
  26. $image = htmlspecialchars($_POST['imageid']);
  27. $tenant = htmlspecialchars($_POST['tenant']);
  28. $apipass = htmlspecialchars($_POST['apipass']);
  29. $apiuser = htmlspecialchars($_POST['apiuser']);
  30.  
  31. $new_settings = '<?php
  32. // Can be made/found at the Dasboard then in the "API" tab on the left.
  33. // https://cp-sg.cloud.z.com/API/
  34. $apiUser = "' . $apiuser . '";
  35. $apiPassword = "' . $apipass . '";
  36. $tenantID = "' . $tenant . '";
  37. // Image Name. Make sure there is only 1 image with this name.
  38. $imageName = "' . $image . '";
  39. ';
  40.  
  41. file_put_contents("config.php", $new_settings);
  42.  
  43. header("Refresh:0");
  44. exit;
  45. }
  46.  
  47. $ph_a = (empty($apiUser)) ? 'API User' : $apiUser;
  48. $ph_b = (empty($apiPassword)) ? 'API Password' : $apiPassword;
  49. $ph_c = (empty($tenantID)) ? 'TENANT ID' : $tenantID;
  50. $ph_d = (empty($imageName)) ? 'IMAGE NAME' : $imageName;
  51.  
  52. $v_a = (empty($apiUser)) ? '' : $apiUser;
  53. $v_b = (empty($apiPassword)) ? '' : $apiPassword;
  54. $v_c = (empty($tenantID)) ? '' : $tenantID;
  55. $v_d = (empty($imageName)) ? '' : $imageName;
  56.  
  57. ?>
  58.  
  59. <!DOCTYPE html>
  60. <html lang="en">
  61. <head>
  62. <meta charset="utf-8">
  63. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  64. <meta name="viewport" content="width=device-width, initial-scale=1">
  65. <meta name="robots" content="none">
  66. <title>TheProxyGuru - API Manager (Z.Com Cloud)</title>
  67. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  68. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/cyborg/bootstrap.min.css">
  69. <!--[if lt IE 9]>
  70. <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
  71. <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
  72. <![endif]-->
  73. <style>
  74. * {
  75.  
  76. }
  77. html {
  78.  
  79. }
  80. body {
  81. padding-top: 50px;
  82. }
  83. a, a:link, a:active, a:hover {
  84. text-decoration: none;
  85. }
  86. .alert {
  87. display: none;
  88. }
  89. </style>
  90. </head>
  91. <body>
  92. <!-- -->
  93. <div class="container-fluid">
  94. <div class="row">
  95. <div class="col-lg-3 text-center">
  96. <h6><a href="">ZCLOUD</a></h6>
  97. <hr>
  98. </div>
  99. </div>
  100. </div>
  101. <!-- -->
  102. <div class="container-fluid">
  103. <div class="row">
  104. <div class="col-lg-3">
  105. <div class="alert alert-success"></div>
  106. </div>
  107. </div>
  108. </div>
  109. <!-- -->
  110. <div class="container-fluid">
  111. <div class="row">
  112. <div class="col-lg-3">
  113. <div class="alert alert-danger"></div>
  114. </div>
  115. </div>
  116. </div>
  117. <!-- -->
  118. <div class="container-fluid">
  119. <div class="row">
  120. <div class="col-lg-3">
  121. <div class="well"></div>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- -->
  126. <div class="container-fluid">
  127. <div class="row">
  128. <div class="col-lg-3">
  129. <div class="panel panel-default">
  130. <div class="panel-heading">List</div>
  131. <div class="panel-body">
  132. <form class="form z-list" method="post">
  133. <div class="form-group">
  134. <input class="form-control" id="z-prefix" type="text" name="prefix" placeholder=":port:user:pass">
  135. </div>
  136. <button class="btn btn-info btn-lg btn-block" id="list" type="submit" name="list">LIST PROXIES <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span></button>
  137. </form>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <!-- -->
  144. <div class="container-fluid">
  145. <div class="row">
  146. <div class="col-lg-3">
  147. <div class="panel panel-default">
  148. <div class="panel-heading">Create</div>
  149. <div class="panel-body">
  150. <form class="form z-create" method="post">
  151. <div class="form-group">
  152. <input class="form-control" id="Z-quantity" type="text" name="quantity" placeholder="Quantity ..." required>
  153. </div>
  154. <div class="form-group">
  155. <select class="form-control" id="location" name="location">
  156. <option value="toronto">United States of America</option>
  157. </select>
  158. </div>
  159. <button class="btn btn-success btn-lg btn-block" id="create" type="submit" name="create">CREATE <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span></button>
  160. </form>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="container-fluid">
  167. <div class="row">
  168. <div class="col-lg-3">
  169. <div class="panel panel-default">
  170. <div class="panel-heading">API Settings
  171. <button data-toggle="collapse" data-target="#apiContent" type="button" class="btn btn-default" aria-label="Left Align">
  172. <span class="glyphicon glyphicon glyphicon-cog" aria-hidden="true"></span>
  173. </button>
  174. </div>
  175. <div class="panel-body collapse" id="apiContent">
  176. <form class="form" method="post">
  177. <div class="form-group">
  178. <input class="form-control" id="apiuser" type="text" name="apiuser" value="<?php echo $v_a;?>" placeholder="<?php echo $ph_a;?>" required>
  179. </div>
  180. <div class="form-group">
  181. <input class="form-control" id="apipass" type="text" name="apipass" value="<?php echo $v_b?>" placeholder="<?php echo $ph_b;?>" required>
  182. </div>
  183. <div class="form-group">
  184. <input class="form-control" id="tenant" type="text" name="tenant" value="<?php echo $v_c?>" placeholder="<?php echo $ph_c;?>" required>
  185. </div>
  186. <div class="form-group">
  187. <input class="form-control" id="imageid" type="text" name="imageid" value="<?php echo $v_d?>" placeholder="<?php echo $ph_d;?>" required>
  188. </div>
  189. <button class="btn btn-warning btn-lg btn-block" id="create" type="submit" name="create2">SAVE <span class="glyphicon glyphicon-save" aria-hidden="true"></span></button>
  190. </form>
  191.  
  192. <hr/>
  193.  
  194. <form class="form" method="post">
  195. <button class="btn btn-danger btn-lg btn-block" id="delete2" type="submit" name="delete2">CLEAR API INFO <span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
  196. </form>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202.  
  203. <!-- -->
  204. <div class="container-fluid">
  205. <div class="row">
  206. <div class="col-lg-3">
  207. <div class="panel panel-default">
  208. <div class="panel-heading">Delete Proxies</div>
  209. <div class="panel-body">
  210. <form class="form" method="post">
  211. <button class="btn btn-danger btn-lg btn-block" id="z-delete" type="submit" name="delete">DESTROY PROXIES <span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
  212. </form>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. <!-- -->
  219. <div class="container-fluid">
  220. <div class="row">
  221. <div class="col-lg-3">
  222. <div class="panel panel-default">
  223. <div class="panel-heading">Generate Token</div>
  224. <div class="panel-body">
  225. <button class="btn btn-danger btn-lg btn-block" id="z-generate" type="submit" name="generate">GENERATE TOKEN <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. <!-- -->
  232. <div class="container-fluid">
  233. <div class="row">
  234. <div class="col-lg-3 text-center">
  235. <hr>
  236. <p><small>&copy; <a href="https://TheProxyGuru.com" target="_blank">TheProxyGuru</a></small></p>
  237. </div>
  238. </div>
  239. </div>
  240. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  241. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  242. <script>
  243. $('.z-list').submit(function(e) {
  244. e.preventDefault();
  245. $('.alert').hide();
  246. var prefix = $('#z-prefix').val();
  247. $.get('list.php', function(res) {
  248. if(!Array.isArray(res)) {
  249. $('.alert-danger').text('Error listing');
  250. } else {
  251. if(res.length == 0) {
  252. $('.alert-danger').show();
  253. $('.alert-danger').text('No results found.');
  254. } else {
  255. $('.alert-success').show();
  256. $('.alert-success').text('Done.');
  257. $('.well').text('');
  258. res.forEach(function(e) {
  259. $('.well').append(e + prefix + '<br>');
  260. });
  261. }
  262. }
  263. });
  264. });
  265.  
  266. $('.z-create').submit(function(e) {
  267. e.preventDefault();
  268. $('.alert').hide();
  269. var q = $('#Z-quantity').val();
  270. $.get('create.php?q=' + q, function(res) {
  271. if(res == 'true') {
  272. $('.alert-success').show();
  273. $('.alert-success').text('Done.');
  274. } else {
  275. $('.alert-danger').show();
  276. $('.alert-danger').text('Error creating.');
  277. }
  278. });
  279. });
  280.  
  281. $('#z-delete').click(function(e) {
  282. e.preventDefault();
  283. $('.alert').hide();
  284. $.get('delete.php', function(res) {
  285. if(res == 'true') {
  286. $('.alert-success').show();
  287. $('.alert-success').text('Done.');
  288. } else if(res == 'false') {
  289. $('.alert-danger').show();
  290. $('.alert-danger').text('Error deleting.');
  291. }
  292. });
  293. });
  294.  
  295. $('#z-generate').click(function(e) {
  296. e.preventDefault();
  297. $('.alert').hide();
  298. $.get('generate.php', function(res) {
  299. if(res == 'true') {
  300. $('.alert-success').show();
  301. $('.alert-success').text('Done.');
  302. } else if(res == 'false') {
  303. $('.alert-danger').show();
  304. $('.alert-danger').text('Error generating.');
  305. }
  306. });
  307. });
  308. </script>
  309. </body>
  310. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement