forked from frootmig/esgobweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_master.php
95 lines (75 loc) · 2.79 KB
/
update_master.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
<link href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet">
<?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');
$domain = '';
$masterip = '';
if (isset($_GET['domain'])) {
$domain = $_GET['domain'];
}
if (isset($_GET['masterip'])) {
$masterip = $_GET['masterip'];
}
if (isset($_GET['submitBtn']) && $domain != '' && $masterip != '') {
$data = simple_get('domains.slaves.updatemasterip', $domain, $masterip);
mysqli_query($Conn, "UPDATE `dnsentries` SET `masterip` = '$masterip' WHERE `dnsentries`.`domain` = '$domain'");
if (!is_object($data)) {
echo('<div class="alert alert-danger" role="alert">Webservice call did not return response</div>');
} else {
echo('<h1>');
echo(htmlentities($domain));
echo('</h1>');
echo('<div class="well">');
echo(htmlentities($data->action));
echo('</div>');
}
} else {
?>
<form class="form-horizontal">
<fieldset>
<!-- Form Name -->
<legend>Update slave zone</legend>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="domain">Domain name</label>
<div class="col-md-4">
<input id="ddomain" name="ddomain" placeholder="Enter domain name" class="form-control input-md" required="" type="text" value="<?php echo(htmlentities($domain)); ?>" disabled>
<input type="hidden" name="domain" type="text" value="<?php echo(htmlentities($domain)); ?>">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="masterip">Master IP</label>
<div class="col-md-4">
<input id="masterip" name="masterip" placeholder="Enter IP address" class="form-control input-md" required="" type="text" value="<?php echo(htmlentities($masterip)); ?>">
<span class="help-block">Enter the IP address of the master DNS server (IPv4 or IPv6)</span>
</div>
</div>
<!-- Button (Double) -->
<div class="form-group">
<label class="col-md-4 control-label" for="submitBtn"></label>
<div class="col-md-8">
<button id="submitBtn" name="submitBtn" class="btn btn-success">Update</button>
</div>
</div>
</fieldset>
</form>
<?php
}
//include('footer.inc.php');
?>