forked from frootmig/esgobweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
del_slave.php
96 lines (67 loc) · 2.62 KB
/
del_slave.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<link href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet">
<div class="container-fluid">
<h3>Enter Domain name to delete</h3>
<form action="del_slave.php" method="post">
Domain Name<input type="text" name="inputDomain" value="" /><br />
<input type="submit" name="submit" value="Submit"/>
<br><br>
</form>
<div>
<?php
/*
Copyright (C) 2015 Volker Janzen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
//require_once('config.inc.php');
require_once('proxy.inc.php');
include ('connection.php');
//include('header.inc.php');
//include_once('del_slave.php');
$domain = '';
$force = 0;
if(isset($_POST['submit'])) {
$domain = $_POST['inputDomain'];
}
if (isset($_GET['domain'])) {
$domain = $_GET['domain'];
}
if (isset($_GET['force'])) {
$force = intval($_GET['force']);
}
if ($domain == '') {
echo('<div class="alert alert-danger" role="alert">No domain name set</div>');
} else if ($force) {
$data = simple_get('domains.slaves.delete', $domain);
if (!is_object($data)) {
echo('<div class="alert alert-danger" role="alert">Webservice call did not return response</div>');
} else {
echo('<div class="well">');
mysqli_query($Conn, "DELETE FROM `dnsentries` WHERE `dnsentries`.`domain` = '$domain'");
echo(htmlentities($data->action)); //domain deleted
//header ("Location: del_slave.php"); //Refresh page here
echo('</div>');
}
} else {
?>
<div class="jumbotron">
<h1>Delete <?php echo(htmlentities($domain)); ?>?</h1>
<p>Do you really want to delete slave zone <?php echo(htmlentities($domain)); ?>? This cannot be revoked!</p>
<a href="del_slave.php?domain=<?php echo(urlencode($domain)); ?>&force=1" class="btn btn-danger btn-lg" role="button">Delete</a>
<a href="list_slaves.php" class="btn btn-primary btn-lg" role="button">Abort</a>
</div>
<?php
}
include ('list_slaves.php');
//include('footer.inc.php');
?>