Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'config.php';
- if (isset($_POST['delete2'])) {
- $new_settings = '<?php
- // Can be made/found at the Dasboard then in the "API" tab on the left.
- // https://cp-sg.cloud.z.com/API/
- $apiUser = "";
- $apiPassword = "";
- $tenantID = "";
- // Image Name. Make sure there is only 1 image with this name.
- $imageName = "";
- ';
- file_put_contents("config.php", $new_settings);
- header("Refresh:0");
- exit;
- }
- if (isset($_POST['create2']))
- {
- $image = htmlspecialchars($_POST['imageid']);
- $tenant = htmlspecialchars($_POST['tenant']);
- $apipass = htmlspecialchars($_POST['apipass']);
- $apiuser = htmlspecialchars($_POST['apiuser']);
- $new_settings = '<?php
- // Can be made/found at the Dasboard then in the "API" tab on the left.
- // https://cp-sg.cloud.z.com/API/
- $apiUser = "' . $apiuser . '";
- $apiPassword = "' . $apipass . '";
- $tenantID = "' . $tenant . '";
- // Image Name. Make sure there is only 1 image with this name.
- $imageName = "' . $image . '";
- ';
- file_put_contents("config.php", $new_settings);
- header("Refresh:0");
- exit;
- }
- $ph_a = (empty($apiUser)) ? 'API User' : $apiUser;
- $ph_b = (empty($apiPassword)) ? 'API Password' : $apiPassword;
- $ph_c = (empty($tenantID)) ? 'TENANT ID' : $tenantID;
- $ph_d = (empty($imageName)) ? 'IMAGE NAME' : $imageName;
- $v_a = (empty($apiUser)) ? '' : $apiUser;
- $v_b = (empty($apiPassword)) ? '' : $apiPassword;
- $v_c = (empty($tenantID)) ? '' : $tenantID;
- $v_d = (empty($imageName)) ? '' : $imageName;
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="robots" content="none">
- <title>TheProxyGuru - API Manager (Z.Com Cloud)</title>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/cyborg/bootstrap.min.css">
- <!--[if lt IE 9]>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
- <![endif]-->
- <style>
- * {
- }
- html {
- }
- body {
- padding-top: 50px;
- }
- a, a:link, a:active, a:hover {
- text-decoration: none;
- }
- .alert {
- display: none;
- }
- </style>
- </head>
- <body>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3 text-center">
- <h6><a href="">ZCLOUD</a></h6>
- <hr>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="alert alert-success"></div>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="alert alert-danger"></div>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="well"></div>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="panel panel-default">
- <div class="panel-heading">List</div>
- <div class="panel-body">
- <form class="form z-list" method="post">
- <div class="form-group">
- <input class="form-control" id="z-prefix" type="text" name="prefix" placeholder=":port:user:pass">
- </div>
- <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>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="panel panel-default">
- <div class="panel-heading">Create</div>
- <div class="panel-body">
- <form class="form z-create" method="post">
- <div class="form-group">
- <input class="form-control" id="Z-quantity" type="text" name="quantity" placeholder="Quantity ..." required>
- </div>
- <div class="form-group">
- <select class="form-control" id="location" name="location">
- <option value="toronto">United States of America</option>
- </select>
- </div>
- <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>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="panel panel-default">
- <div class="panel-heading">API Settings
- <button data-toggle="collapse" data-target="#apiContent" type="button" class="btn btn-default" aria-label="Left Align">
- <span class="glyphicon glyphicon glyphicon-cog" aria-hidden="true"></span>
- </button>
- </div>
- <div class="panel-body collapse" id="apiContent">
- <form class="form" method="post">
- <div class="form-group">
- <input class="form-control" id="apiuser" type="text" name="apiuser" value="<?php echo $v_a;?>" placeholder="<?php echo $ph_a;?>" required>
- </div>
- <div class="form-group">
- <input class="form-control" id="apipass" type="text" name="apipass" value="<?php echo $v_b?>" placeholder="<?php echo $ph_b;?>" required>
- </div>
- <div class="form-group">
- <input class="form-control" id="tenant" type="text" name="tenant" value="<?php echo $v_c?>" placeholder="<?php echo $ph_c;?>" required>
- </div>
- <div class="form-group">
- <input class="form-control" id="imageid" type="text" name="imageid" value="<?php echo $v_d?>" placeholder="<?php echo $ph_d;?>" required>
- </div>
- <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>
- </form>
- <hr/>
- <form class="form" method="post">
- <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>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="panel panel-default">
- <div class="panel-heading">Delete Proxies</div>
- <div class="panel-body">
- <form class="form" method="post">
- <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>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3">
- <div class="panel panel-default">
- <div class="panel-heading">Generate Token</div>
- <div class="panel-body">
- <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>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- -->
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-3 text-center">
- <hr>
- <p><small>© <a href="https://TheProxyGuru.com" target="_blank">TheProxyGuru</a></small></p>
- </div>
- </div>
- </div>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script>
- $('.z-list').submit(function(e) {
- e.preventDefault();
- $('.alert').hide();
- var prefix = $('#z-prefix').val();
- $.get('list.php', function(res) {
- if(!Array.isArray(res)) {
- $('.alert-danger').text('Error listing');
- } else {
- if(res.length == 0) {
- $('.alert-danger').show();
- $('.alert-danger').text('No results found.');
- } else {
- $('.alert-success').show();
- $('.alert-success').text('Done.');
- $('.well').text('');
- res.forEach(function(e) {
- $('.well').append(e + prefix + '<br>');
- });
- }
- }
- });
- });
- $('.z-create').submit(function(e) {
- e.preventDefault();
- $('.alert').hide();
- var q = $('#Z-quantity').val();
- $.get('create.php?q=' + q, function(res) {
- if(res == 'true') {
- $('.alert-success').show();
- $('.alert-success').text('Done.');
- } else {
- $('.alert-danger').show();
- $('.alert-danger').text('Error creating.');
- }
- });
- });
- $('#z-delete').click(function(e) {
- e.preventDefault();
- $('.alert').hide();
- $.get('delete.php', function(res) {
- if(res == 'true') {
- $('.alert-success').show();
- $('.alert-success').text('Done.');
- } else if(res == 'false') {
- $('.alert-danger').show();
- $('.alert-danger').text('Error deleting.');
- }
- });
- });
- $('#z-generate').click(function(e) {
- e.preventDefault();
- $('.alert').hide();
- $.get('generate.php', function(res) {
- if(res == 'true') {
- $('.alert-success').show();
- $('.alert-success').text('Done.');
- } else if(res == 'false') {
- $('.alert-danger').show();
- $('.alert-danger').text('Error generating.');
- }
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement