@@ -27,62 +27,62 @@ |
||
27 | 27 | |
28 | 28 | # for edit check old details |
29 | 29 | if ($_POST['action']=="edit" || $_POST['action']=="delete") { |
30 | - # old |
|
31 | - $agent_old = $Admin->fetch_object ("scanAgents", "id", $_POST['id']); |
|
32 | - // invalid id |
|
33 | - if($agent_old===false) { $error[] = "Invalid agent Id"; } |
|
34 | - // remove type and code if direct |
|
35 | - if (@$agent_old->type=="direct") { |
|
36 | - unset($_POST['type'], $_POST['code']); |
|
37 | - } |
|
30 | + # old |
|
31 | + $agent_old = $Admin->fetch_object ("scanAgents", "id", $_POST['id']); |
|
32 | + // invalid id |
|
33 | + if($agent_old===false) { $error[] = "Invalid agent Id"; } |
|
34 | + // remove type and code if direct |
|
35 | + if (@$agent_old->type=="direct") { |
|
36 | + unset($_POST['type'], $_POST['code']); |
|
37 | + } |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | # die if direct and delete |
41 | 41 | if (@$agent_old->type=="direct" && $_POST['action']=="delete") { |
42 | - $Result->show("danger", _("Cannot remove localhost scan agent"),true); |
|
42 | + $Result->show("danger", _("Cannot remove localhost scan agent"),true); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | # checks for edit / add |
46 | 46 | if($_POST['action']!="delete") { |
47 | - # code must be exactly 32 chars long and alfanumeric if app_security = crypt |
|
48 | - if(@$agent_old->type!="direct") { |
|
49 | - if(strlen($_POST['code'])!=32 || !ctype_alnum($_POST['code'])) { $error[] = "Invalid agent code"; } |
|
50 | - } |
|
51 | - # name must be more than 2 and alphanumberic |
|
52 | - if(strlen($_POST['name'])==0) { $error[] = "Invalid agent name"; } |
|
47 | + # code must be exactly 32 chars long and alfanumeric if app_security = crypt |
|
48 | + if(@$agent_old->type!="direct") { |
|
49 | + if(strlen($_POST['code'])!=32 || !ctype_alnum($_POST['code'])) { $error[] = "Invalid agent code"; } |
|
50 | + } |
|
51 | + # name must be more than 2 and alphanumberic |
|
52 | + if(strlen($_POST['name'])==0) { $error[] = "Invalid agent name"; } |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | # die if errors |
56 | 56 | if(sizeof($error) > 0) { |
57 | - $Result->show("danger", $error, true); |
|
57 | + $Result->show("danger", $error, true); |
|
58 | 58 | } |
59 | 59 | else { |
60 | - # create array of values for modification |
|
61 | - $values = array("id"=>@$_POST['id'], |
|
62 | - "name"=>$_POST['name'], |
|
63 | - "description"=>@$_POST['description'], |
|
64 | - "code"=>@$_POST['code'], |
|
65 | - "type"=>@$_POST['type'] |
|
66 | - ); |
|
67 | - # null |
|
68 | - $values = $Admin->remove_empty_array_fields ($values); |
|
60 | + # create array of values for modification |
|
61 | + $values = array("id"=>@$_POST['id'], |
|
62 | + "name"=>$_POST['name'], |
|
63 | + "description"=>@$_POST['description'], |
|
64 | + "code"=>@$_POST['code'], |
|
65 | + "type"=>@$_POST['type'] |
|
66 | + ); |
|
67 | + # null |
|
68 | + $values = $Admin->remove_empty_array_fields ($values); |
|
69 | 69 | |
70 | - # execute |
|
71 | - if(!$Admin->object_modify("scanAgents", $_POST['action'], "id", $values)) { $Result->show("danger", _("Agent $_POST[action] error"), true); } |
|
72 | - else { $Result->show("success", _("Agent $_POST[action] success"), false); } |
|
70 | + # execute |
|
71 | + if(!$Admin->object_modify("scanAgents", $_POST['action'], "id", $values)) { $Result->show("danger", _("Agent $_POST[action] error"), true); } |
|
72 | + else { $Result->show("success", _("Agent $_POST[action] success"), false); } |
|
73 | 73 | |
74 | - # delete - unset scanning in all subnets |
|
75 | - if ($_POST['action']=="delete") { |
|
76 | - $query = "update `subnets` set `scanAgent`=0, `pingSubnet`=0, `discoverSubnet`=0 where `scanAgent` = ?;"; |
|
74 | + # delete - unset scanning in all subnets |
|
75 | + if ($_POST['action']=="delete") { |
|
76 | + $query = "update `subnets` set `scanAgent`=0, `pingSubnet`=0, `discoverSubnet`=0 where `scanAgent` = ?;"; |
|
77 | 77 | |
78 | - try { $Database->runQuery($query, array($_POST['id'])); } |
|
79 | - catch (Exception $e) { |
|
80 | - $this->Result->show("danger", _("Error: ").$e->getMessage()); |
|
81 | - return false; |
|
82 | - } |
|
83 | - // references removed |
|
84 | - $this->Result->show("info", _("Scan agent references removed")); |
|
85 | - } |
|
78 | + try { $Database->runQuery($query, array($_POST['id'])); } |
|
79 | + catch (Exception $e) { |
|
80 | + $this->Result->show("danger", _("Error: ").$e->getMessage()); |
|
81 | + return false; |
|
82 | + } |
|
83 | + // references removed |
|
84 | + $this->Result->show("info", _("Scan agent references removed")); |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | ?> |
89 | 89 | \ No newline at end of file |
@@ -24,23 +24,23 @@ discard block |
||
24 | 24 | |
25 | 25 | # fetch api for edit / add |
26 | 26 | if($_POST['action']!="add") { |
27 | - # fetch api details |
|
28 | - $agent = $Admin->fetch_object ("scanAgents", "id", $_POST['id']); |
|
29 | - # null ? |
|
30 | - $agent===false ? $Result->show("danger", _("Invalid ID"), true) : null; |
|
31 | - # title |
|
32 | - $title = ucwords($_POST['action']) .' '._('agent').' '.$agent->name; |
|
27 | + # fetch api details |
|
28 | + $agent = $Admin->fetch_object ("scanAgents", "id", $_POST['id']); |
|
29 | + # null ? |
|
30 | + $agent===false ? $Result->show("danger", _("Invalid ID"), true) : null; |
|
31 | + # title |
|
32 | + $title = ucwords($_POST['action']) .' '._('agent').' '.$agent->name; |
|
33 | 33 | } else { |
34 | - # generate new code |
|
35 | - $agent = new StdClass; |
|
36 | - $agent->code = str_shuffle(md5(microtime())); |
|
37 | - # title |
|
38 | - $title = _('Create new scan agent'); |
|
34 | + # generate new code |
|
35 | + $agent = new StdClass; |
|
36 | + $agent->code = str_shuffle(md5(microtime())); |
|
37 | + # title |
|
38 | + $title = _('Create new scan agent'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | # die if direct and delete |
42 | 42 | if (@$agent->type=="direct" && $_POST['action']=="delete") { |
43 | - $Result->show("danger", _("Cannot remove localhost scan agent"),true, true); |
|
43 | + $Result->show("danger", _("Cannot remove localhost scan agent"),true, true); |
|
44 | 44 | } |
45 | 45 | ?> |
46 | 46 | |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | <td> |
88 | 88 | <select name="type" class="form-control input-sm input-w-auto" <?php if(@$agent->type=="direct"||$_POST['action'] == "delete") print "readonly"; ?>> |
89 | 89 | <?php |
90 | - //$types = array("mysql"=>"MySQL", "api"=>"Api"); |
|
91 | - $types = array("mysql"=>"MySQL"); |
|
92 | - |
|
93 | - foreach($types as $k=>$p) { |
|
94 | - if($k==$agent->type) { print "<option value='$k' selected='selected'>"._($p)."</option>"; } |
|
95 | - else { print "<option value='$k' >"._($p)."</option>"; } |
|
96 | - } |
|
97 | - ?> |
|
90 | + //$types = array("mysql"=>"MySQL", "api"=>"Api"); |
|
91 | + $types = array("mysql"=>"MySQL"); |
|
92 | + |
|
93 | + foreach($types as $k=>$p) { |
|
94 | + if($k==$agent->type) { print "<option value='$k' selected='selected'>"._($p)."</option>"; } |
|
95 | + else { print "<option value='$k' >"._($p)."</option>"; } |
|
96 | + } |
|
97 | + ?> |
|
98 | 98 | </select> |
99 | 99 | <td class="info2"><?php print _('Agent type'); ?></td> |
100 | 100 | </tr> |
@@ -12,25 +12,25 @@ discard block |
||
12 | 12 | |
13 | 13 | // fetch required domains |
14 | 14 | switch ($type) { |
15 | - // fetch forward domains |
|
16 | - case 'domains': |
|
17 | - $title = _("Domains"); |
|
18 | - $domains = $PowerDNS->fetch_all_forward_domains (); |
|
19 | - break; |
|
20 | - // fetch v4 reverse domains |
|
21 | - case 'reverse_v4': |
|
22 | - $title = _("IPv4 reverse domains"); |
|
23 | - $domains = $PowerDNS->fetch_reverse_v4_domains (); |
|
24 | - break; |
|
25 | - // fetch v6 reverse domains |
|
26 | - case 'reverse_v6': |
|
27 | - $title = _("IPv6 reverse domains"); |
|
28 | - $domains = $PowerDNS->fetch_reverse_v6_domains (); |
|
29 | - break; |
|
30 | - // error |
|
31 | - default: |
|
32 | - $Result->show("danger", "Invalid request", true); |
|
33 | - break; |
|
15 | + // fetch forward domains |
|
16 | + case 'domains': |
|
17 | + $title = _("Domains"); |
|
18 | + $domains = $PowerDNS->fetch_all_forward_domains (); |
|
19 | + break; |
|
20 | + // fetch v4 reverse domains |
|
21 | + case 'reverse_v4': |
|
22 | + $title = _("IPv4 reverse domains"); |
|
23 | + $domains = $PowerDNS->fetch_reverse_v4_domains (); |
|
24 | + break; |
|
25 | + // fetch v6 reverse domains |
|
26 | + case 'reverse_v6': |
|
27 | + $title = _("IPv6 reverse domains"); |
|
28 | + $domains = $PowerDNS->fetch_reverse_v6_domains (); |
|
29 | + break; |
|
30 | + // error |
|
31 | + default: |
|
32 | + $Result->show("danger", "Invalid request", true); |
|
33 | + break; |
|
34 | 34 | } |
35 | 35 | ?> |
36 | 36 | |
@@ -71,34 +71,34 @@ discard block |
||
71 | 71 | <?php |
72 | 72 | /* prints domain records */ |
73 | 73 | foreach ($domains as $d) { |
74 | - // nulls |
|
75 | - foreach($d as $k=>$v) { |
|
76 | - if (strlen($v)==0) $d->$k = "<span class='muted'>/</span>"; |
|
77 | - } |
|
78 | - // cont records |
|
79 | - $cnt = $PowerDNS->count_domain_records ($d->id); |
|
80 | - // get SOA record |
|
81 | - $soa = $PowerDNS->fetch_domain_records_by_type ($d->id, "SOA"); |
|
82 | - $serial = explode(" ", $soa[0]->content); |
|
83 | - $serial = $serial[2]; |
|
74 | + // nulls |
|
75 | + foreach($d as $k=>$v) { |
|
76 | + if (strlen($v)==0) $d->$k = "<span class='muted'>/</span>"; |
|
77 | + } |
|
78 | + // cont records |
|
79 | + $cnt = $PowerDNS->count_domain_records ($d->id); |
|
80 | + // get SOA record |
|
81 | + $soa = $PowerDNS->fetch_domain_records_by_type ($d->id, "SOA"); |
|
82 | + $serial = explode(" ", $soa[0]->content); |
|
83 | + $serial = $serial[2]; |
|
84 | 84 | |
85 | - print "<tr>"; |
|
86 | - // actions |
|
87 | - print " <td>"; |
|
88 | - print " <div class='btn-group'>"; |
|
89 | - print " <button class='btn btn-default btn-xs editDomain' data-action='edit' data-id='$d->id'><i class='fa fa-pencil'></i></button>"; |
|
90 | - print " <button class='btn btn-default btn-xs editDomain' data-action='delete' data-id='$d->id'><i class='fa fa-remove'></i></button>"; |
|
91 | - print " </div>"; |
|
92 | - print " </td>"; |
|
85 | + print "<tr>"; |
|
86 | + // actions |
|
87 | + print " <td>"; |
|
88 | + print " <div class='btn-group'>"; |
|
89 | + print " <button class='btn btn-default btn-xs editDomain' data-action='edit' data-id='$d->id'><i class='fa fa-pencil'></i></button>"; |
|
90 | + print " <button class='btn btn-default btn-xs editDomain' data-action='delete' data-id='$d->id'><i class='fa fa-remove'></i></button>"; |
|
91 | + print " </div>"; |
|
92 | + print " </td>"; |
|
93 | 93 | |
94 | - // content |
|
95 | - print " <td><a href='".create_link("administration", "powerDNS", $_GET['subnetId'], "records", $d->name)."'>$d->name</a></td>"; |
|
96 | - print " <td><span class='badge badge1'>$d->type</span></td>"; |
|
97 | - print " <td>$d->master</td>"; |
|
98 | - print " <td><span class='badge'>$cnt</span></td>"; |
|
99 | - print " <td>$serial</td>"; |
|
94 | + // content |
|
95 | + print " <td><a href='".create_link("administration", "powerDNS", $_GET['subnetId'], "records", $d->name)."'>$d->name</a></td>"; |
|
96 | + print " <td><span class='badge badge1'>$d->type</span></td>"; |
|
97 | + print " <td>$d->master</td>"; |
|
98 | + print " <td><span class='badge'>$cnt</span></td>"; |
|
99 | + print " <td>$serial</td>"; |
|
100 | 100 | |
101 | - print "</tr>"; |
|
101 | + print "</tr>"; |
|
102 | 102 | } |
103 | 103 | ?> |
104 | 104 | </tbody> |
@@ -44,8 +44,8 @@ |
||
44 | 44 | |
45 | 45 | # set update values |
46 | 46 | $values_new = array("id"=>1, |
47 | - "powerDNS"=>json_encode($values), |
|
48 | - ); |
|
47 | + "powerDNS"=>json_encode($values), |
|
48 | + ); |
|
49 | 49 | if(!$Admin->object_modify("settings", "edit", "id", $values_new)) { $Result->show("danger", _("Cannot update settings"), false); } |
50 | 50 | else { $Result->show("success", _("Settings updated successfully"), false); } |
51 | 51 |
@@ -26,61 +26,61 @@ |
||
26 | 26 | |
27 | 27 | # checks / validation |
28 | 28 | if ($_POST['action']!="delete") { |
29 | - // fqdn |
|
30 | - if ($_POST['action']=="add") |
|
31 | - if($Result->validate_hostname($_POST['name'])===false) { $Result->show("danger", "Invalid domain name", true); } |
|
32 | - // master |
|
33 | - if (strlen($_POST['master'])>0) { |
|
34 | - // if multilpe masters |
|
35 | - if (strpos($_POST['master'], ",")!==false) { |
|
36 | - // to array and trim, check each |
|
37 | - $masters = array_filter(explode(",", $_POST['master'])); |
|
38 | - foreach ($masters as $m) { |
|
39 | - if(!filter_var($m, FILTER_VALIDATE_IP)) { $Result->show("danger", "Master must be an IP address". " - ". $m, true); } |
|
40 | - } |
|
41 | - } |
|
42 | - else { |
|
29 | + // fqdn |
|
30 | + if ($_POST['action']=="add") |
|
31 | + if($Result->validate_hostname($_POST['name'])===false) { $Result->show("danger", "Invalid domain name", true); } |
|
32 | + // master |
|
33 | + if (strlen($_POST['master'])>0) { |
|
34 | + // if multilpe masters |
|
35 | + if (strpos($_POST['master'], ",")!==false) { |
|
36 | + // to array and trim, check each |
|
37 | + $masters = array_filter(explode(",", $_POST['master'])); |
|
38 | + foreach ($masters as $m) { |
|
39 | + if(!filter_var($m, FILTER_VALIDATE_IP)) { $Result->show("danger", "Master must be an IP address". " - ". $m, true); } |
|
40 | + } |
|
41 | + } |
|
42 | + else { |
|
43 | 43 | if(!filter_var($_POST['master'], FILTER_VALIDATE_IP)) { $Result->show("danger", "Master must be an IP address". " - ". $_POST['master'], true); } |
44 | - } |
|
45 | - } |
|
46 | - // type |
|
47 | - if(!in_array($_POST['type'], (array )$PowerDNS->domain_types)) { $Result->show("danger", "Invalid domain type", true); } |
|
48 | - |
|
49 | - # new domain |
|
50 | - if ($_POST['action']=="add" && !isset($_POST['manual'])) { |
|
51 | - // admin |
|
52 | - if ($Result->validate_email($_POST['hostmaster'])===false) { $Result->show("danger", "Invalid domain admin", true); } |
|
53 | - } |
|
54 | - |
|
55 | - // if slave master must be present |
|
56 | - if ($_POST['type']=="SLAVE") { |
|
57 | - if (strlen($_POST['master'])==0) { $Result->show("danger", "Please set master server(s) if domain type is SLAVE", true); } |
|
44 | + } |
|
45 | + } |
|
46 | + // type |
|
47 | + if(!in_array($_POST['type'], (array )$PowerDNS->domain_types)) { $Result->show("danger", "Invalid domain type", true); } |
|
48 | + |
|
49 | + # new domain |
|
50 | + if ($_POST['action']=="add" && !isset($_POST['manual'])) { |
|
51 | + // admin |
|
52 | + if ($Result->validate_email($_POST['hostmaster'])===false) { $Result->show("danger", "Invalid domain admin", true); } |
|
53 | + } |
|
54 | + |
|
55 | + // if slave master must be present |
|
56 | + if ($_POST['type']=="SLAVE") { |
|
57 | + if (strlen($_POST['master'])==0) { $Result->show("danger", "Please set master server(s) if domain type is SLAVE", true); } |
|
58 | 58 | else { |
59 | - if (strpos($_POST['master'], ",")!==false) { |
|
60 | - // to array and trim, check each |
|
61 | - $masters = array_filter(explode(",", $_POST['master'])); |
|
62 | - foreach ($masters as $m) { |
|
63 | - if(!filter_var($m, FILTER_VALIDATE_IP)) { $Result->show("danger", "Master must be an IP address". " - ". $m, true); } |
|
64 | - } |
|
65 | - } |
|
66 | - else { |
|
59 | + if (strpos($_POST['master'], ",")!==false) { |
|
60 | + // to array and trim, check each |
|
61 | + $masters = array_filter(explode(",", $_POST['master'])); |
|
62 | + foreach ($masters as $m) { |
|
63 | + if(!filter_var($m, FILTER_VALIDATE_IP)) { $Result->show("danger", "Master must be an IP address". " - ". $m, true); } |
|
64 | + } |
|
65 | + } |
|
66 | + else { |
|
67 | 67 | if(!filter_var($_POST['master'], FILTER_VALIDATE_IP)) { $Result->show("danger", "Master must be an IP address". " - ". $_POST['master'], true); } |
68 | - } |
|
69 | - } |
|
70 | - } |
|
68 | + } |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | 72 | |
73 | - # if update sve old domain ! |
|
74 | - if ($_POST['action']=="edit") { |
|
75 | - $old_domain = $PowerDNS->fetch_domain ($_POST['id']); |
|
76 | - } |
|
73 | + # if update sve old domain ! |
|
74 | + if ($_POST['action']=="edit") { |
|
75 | + $old_domain = $PowerDNS->fetch_domain ($_POST['id']); |
|
76 | + } |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | # set update array |
80 | 80 | $values = array("id"=>@$_POST['id'], |
81 | - "master"=>@$_POST['master'], |
|
82 | - "type"=>@$_POST['type'] |
|
83 | - ); |
|
81 | + "master"=>@$_POST['master'], |
|
82 | + "type"=>@$_POST['type'] |
|
83 | + ); |
|
84 | 84 | # name only on add |
85 | 85 | if ($_POST['action']=="add") |
86 | 86 | $values['name'] = $_POST['name']; |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | # get VRF |
28 | 28 | if($_POST['action']!="add") { |
29 | - $domain = $PowerDNS->fetch_domain ($_POST['id']); |
|
30 | - $domain!==false ? : $Result->show("danger", _("Invalid ID"), true, true); |
|
29 | + $domain = $PowerDNS->fetch_domain ($_POST['id']); |
|
30 | + $domain!==false ? : $Result->show("danger", _("Invalid ID"), true, true); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | # disable edit on delete |
@@ -69,23 +69,23 @@ discard block |
||
69 | 69 | <td> |
70 | 70 | <select name="type" class="form-control input-w-auto" <?php print $readonly; ?>> |
71 | 71 | <?php |
72 | - // loop |
|
73 | - foreach($PowerDNS->domain_types as $type) { |
|
74 | - // active |
|
75 | - if ($type == @$domain->type) { $selected = "selected"; } |
|
76 | - else { $selected = ""; } |
|
77 | ||
78 | - print "<option value='$type' $selected>$type</option>"; |
|
79 | - } |
|
80 | - ?> |
|
72 | + // loop |
|
73 | + foreach($PowerDNS->domain_types as $type) { |
|
74 | + // active |
|
75 | + if ($type == @$domain->type) { $selected = "selected"; } |
|
76 | + else { $selected = ""; } |
|
77 | ||
78 | + print "<option value='$type' $selected>$type</option>"; |
|
79 | + } |
|
80 | + ?> |
|
81 | 81 | </select> |
82 | 82 | </td> |
83 | 83 | </tr> |
84 | 84 | |
85 | 85 | <?php |
86 | - // we need default parameters only if we create new domain ! |
|
87 | - if($_POST['action']=="add") { |
|
88 | - ?> |
|
86 | + // we need default parameters only if we create new domain ! |
|
87 | + if($_POST['action']=="add") { |
|
88 | + ?> |
|
89 | 89 | |
90 | 90 | <tbody class="defaults"> |
91 | 91 | |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | <td> |
117 | 117 | <select name="ttl" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
118 | 118 | <?php |
119 | - // loop |
|
120 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
121 | - // active |
|
122 | - if ($k == @$pdns->ttl) { $selected = "selected"; } |
|
123 | - else { $selected = ""; } |
|
124 | ||
125 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
126 | - } |
|
127 | - ?> |
|
119 | + // loop |
|
120 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
121 | + // active |
|
122 | + if ($k == @$pdns->ttl) { $selected = "selected"; } |
|
123 | + else { $selected = ""; } |
|
124 | ||
125 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
126 | + } |
|
127 | + ?> |
|
128 | 128 | </select> |
129 | 129 | </td> |
130 | 130 | </tr> |
@@ -134,15 +134,15 @@ discard block |
||
134 | 134 | <td> |
135 | 135 | <select name="refresh" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
136 | 136 | <?php |
137 | - // loop |
|
138 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
139 | - // active |
|
140 | - if ($k == @$pdns->refresh) { $selected = "selected"; } |
|
141 | - else { $selected = ""; } |
|
142 | ||
143 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
144 | - } |
|
145 | - ?> |
|
137 | + // loop |
|
138 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
139 | + // active |
|
140 | + if ($k == @$pdns->refresh) { $selected = "selected"; } |
|
141 | + else { $selected = ""; } |
|
142 | ||
143 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
144 | + } |
|
145 | + ?> |
|
146 | 146 | </select> |
147 | 147 | </td> |
148 | 148 | </tr> |
@@ -152,15 +152,15 @@ discard block |
||
152 | 152 | <td> |
153 | 153 | <select name="retry" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
154 | 154 | <?php |
155 | - // loop |
|
156 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
157 | - // active |
|
158 | - if ($k == @$pdns->retry) { $selected = "selected"; } |
|
159 | - else { $selected = ""; } |
|
160 | ||
161 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
162 | - } |
|
163 | - ?> |
|
155 | + // loop |
|
156 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
157 | + // active |
|
158 | + if ($k == @$pdns->retry) { $selected = "selected"; } |
|
159 | + else { $selected = ""; } |
|
160 | ||
161 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
162 | + } |
|
163 | + ?> |
|
164 | 164 | </select> </td> |
165 | 165 | </tr> |
166 | 166 | <!-- ttl --> |
@@ -169,15 +169,15 @@ discard block |
||
169 | 169 | <td> |
170 | 170 | <select name="nxdomain_ttl" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
171 | 171 | <?php |
172 | - // loop |
|
173 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
174 | - // active |
|
175 | - if ($k == @$pdns->nxdomain_ttl) { $selected = "selected"; } |
|
176 | - else { $selected = ""; } |
|
177 | ||
178 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
179 | - } |
|
180 | - ?> |
|
172 | + // loop |
|
173 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
174 | + // active |
|
175 | + if ($k == @$pdns->nxdomain_ttl) { $selected = "selected"; } |
|
176 | + else { $selected = ""; } |
|
177 | ||
178 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
179 | + } |
|
180 | + ?> |
|
181 | 181 | </select> |
182 | 182 | </td> |
183 | 183 | </tr> |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | </form> |
196 | 196 | |
197 | 197 | <?php |
198 | - //print delete warning |
|
199 | - if($_POST['action'] == "delete") { $Result->show("warning", "<strong>"._('Warning').":</strong> "._("removing Domain will also remove all referenced entries!"), false);} |
|
200 | - ?> |
|
198 | + //print delete warning |
|
199 | + if($_POST['action'] == "delete") { $Result->show("warning", "<strong>"._('Warning').":</strong> "._("removing Domain will also remove all referenced entries!"), false);} |
|
200 | + ?> |
|
201 | 201 | </div> |
202 | 202 | |
203 | 203 |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | <td> |
50 | 50 | <select name="refresh" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
51 | 51 | <?php |
52 | - // loop |
|
53 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
54 | - // active |
|
55 | - if ($k == @$pdns->refresh) { $selected = "selected"; } |
|
56 | - else { $selected = ""; } |
|
57 | ||
58 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
59 | - } |
|
60 | - ?> |
|
52 | + // loop |
|
53 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
54 | + // active |
|
55 | + if ($k == @$pdns->refresh) { $selected = "selected"; } |
|
56 | + else { $selected = ""; } |
|
57 | ||
58 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
59 | + } |
|
60 | + ?> |
|
61 | 61 | </select> |
62 | 62 | </td> |
63 | 63 | <td> |
@@ -70,15 +70,15 @@ discard block |
||
70 | 70 | <td> |
71 | 71 | <select name="retry" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
72 | 72 | <?php |
73 | - // loop |
|
74 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
75 | - // active |
|
76 | - if ($k == @$pdns->retry) { $selected = "selected"; } |
|
77 | - else { $selected = ""; } |
|
78 | ||
79 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
80 | - } |
|
81 | - ?> |
|
73 | + // loop |
|
74 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
75 | + // active |
|
76 | + if ($k == @$pdns->retry) { $selected = "selected"; } |
|
77 | + else { $selected = ""; } |
|
78 | ||
79 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
80 | + } |
|
81 | + ?> |
|
82 | 82 | </select> |
83 | 83 | </td> |
84 | 84 | <td> |
@@ -91,15 +91,15 @@ discard block |
||
91 | 91 | <td> |
92 | 92 | <select name="expire" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
93 | 93 | <?php |
94 | - // loop |
|
95 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
96 | - // active |
|
97 | - if ($k == @$pdns->expire) { $selected = "selected"; } |
|
98 | - else { $selected = ""; } |
|
99 | ||
100 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
101 | - } |
|
102 | - ?> |
|
94 | + // loop |
|
95 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
96 | + // active |
|
97 | + if ($k == @$pdns->expire) { $selected = "selected"; } |
|
98 | + else { $selected = ""; } |
|
99 | ||
100 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
101 | + } |
|
102 | + ?> |
|
103 | 103 | </select> |
104 | 104 | </td> |
105 | 105 | <td> |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | <td> |
113 | 113 | <select name="nxdomain_ttl" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
114 | 114 | <?php |
115 | - // loop |
|
116 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
117 | - // active |
|
118 | - if ($k == @$pdns->nxdomain_ttl) { $selected = "selected"; } |
|
119 | - else { $selected = ""; } |
|
120 | ||
121 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
122 | - } |
|
123 | - ?> |
|
115 | + // loop |
|
116 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
117 | + // active |
|
118 | + if ($k == @$pdns->nxdomain_ttl) { $selected = "selected"; } |
|
119 | + else { $selected = ""; } |
|
120 | ||
121 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
122 | + } |
|
123 | + ?> |
|
124 | 124 | </select> |
125 | 125 | </td> |
126 | 126 | <td> |
@@ -133,15 +133,15 @@ discard block |
||
133 | 133 | <td> |
134 | 134 | <select name="ttl" class="form-control input-w-auto input-sm" <?php print $readonly; ?>> |
135 | 135 | <?php |
136 | - // loop |
|
137 | - foreach($PowerDNS->ttl as $k=>$ttl) { |
|
138 | - // active |
|
139 | - if ($k == @$pdns->ttl) { $selected = "selected"; } |
|
140 | - else { $selected = ""; } |
|
141 | ||
142 | - print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
143 | - } |
|
144 | - ?> |
|
136 | + // loop |
|
137 | + foreach($PowerDNS->ttl as $k=>$ttl) { |
|
138 | + // active |
|
139 | + if ($k == @$pdns->ttl) { $selected = "selected"; } |
|
140 | + else { $selected = ""; } |
|
141 | ||
142 | + print "<option value='$k' $selected>$ttl ($k)</option>"; |
|
143 | + } |
|
144 | + ?> |
|
145 | 145 | </select> </td> |
146 | 146 | <td> |
147 | 147 | <span class="text-muted"><?php print _("Default TTL for domain records"); ?></span> |
@@ -36,25 +36,25 @@ discard block |
||
36 | 36 | <!-- tabs --> |
37 | 37 | <ul class="nav nav-tabs"> |
38 | 38 | <?php |
39 | - // tabs |
|
40 | - $tabs = array("domains", "host_records", "reverse_v4", "reverse_v6", "settings", "defaults"); |
|
39 | + // tabs |
|
40 | + $tabs = array("domains", "host_records", "reverse_v4", "reverse_v6", "settings", "defaults"); |
|
41 | 41 | |
42 | - // default tab |
|
43 | - if(!isset($_GET['subnetId'])) { |
|
44 | - if(!$test) { $_GET['subnetId'] = "settings"; } |
|
45 | - else { $_GET['subnetId'] = "domains"; } |
|
46 | - } |
|
42 | + // default tab |
|
43 | + if(!isset($_GET['subnetId'])) { |
|
44 | + if(!$test) { $_GET['subnetId'] = "settings"; } |
|
45 | + else { $_GET['subnetId'] = "domains"; } |
|
46 | + } |
|
47 | 47 | |
48 | - // check |
|
49 | - if(!in_array($_GET['subnetId'], $tabs)) { $Result->show("danger", "Invalid request", true); } |
|
48 | + // check |
|
49 | + if(!in_array($_GET['subnetId'], $tabs)) { $Result->show("danger", "Invalid request", true); } |
|
50 | 50 | |
51 | ||
52 | - foreach($tabs as $t) { |
|
53 | - $title = str_replace('_', ' ', $t); |
|
54 | - $class = $_GET['subnetId']==$t ? "class='active'" : ""; |
|
55 | - print "<li role='presentation' $class><a href=".create_link("administration", "powerDNS", "$t").">". _(ucwords($title))."</a></li>"; |
|
56 | - } |
|
57 | - ?> |
|
51 | ||
52 | + foreach($tabs as $t) { |
|
53 | + $title = str_replace('_', ' ', $t); |
|
54 | + $class = $_GET['subnetId']==$t ? "class='active'" : ""; |
|
55 | + print "<li role='presentation' $class><a href=".create_link("administration", "powerDNS", "$t").">". _(ucwords($title))."</a></li>"; |
|
56 | + } |
|
57 | + ?> |
|
58 | 58 | </ul> |
59 | 59 | |
60 | 60 | <div> |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | // include content |
63 | 63 | $pdns_section = $_GET['subnetId']; |
64 | 64 | if (preg_match("/reverse_/", $pdns_section)) { |
65 | - $filename = 'domains.php'; |
|
65 | + $filename = 'domains.php'; |
|
66 | 66 | } else { |
67 | - $filename = "$_GET[subnetId].php"; |
|
67 | + $filename = "$_GET[subnetId].php"; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // include file |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | <?php |
77 | 77 | } else { |
78 | - $Result->show("info", _('Please enable powerDNS module under server management'), false); |
|
78 | + $Result->show("info", _('Please enable powerDNS module under server management'), false); |
|
79 | 79 | } |
80 | 80 | ?> |
81 | 81 | </div> |
82 | 82 | \ No newline at end of file |
@@ -90,7 +90,7 @@ |
||
90 | 90 | <!-- check --> |
91 | 91 | <div class="check" style="height:60px;"> |
92 | 92 | <?php |
93 | - if ($test==false) { $Result->show("danger alert-absolute", "Failed to connect to database:<hr> ".$PowerDNS->error); } |
|
94 | - else { $Result->show("success alert-absolute", "Database connection ok"); } |
|
95 | - ?> |
|
93 | + if ($test==false) { $Result->show("danger alert-absolute", "Failed to connect to database:<hr> ".$PowerDNS->error); } |
|
94 | + else { $Result->show("success alert-absolute", "Database connection ok"); } |
|
95 | + ?> |
|
96 | 96 | </div> |
97 | 97 | \ No newline at end of file |