forked from pi-hole/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
724 lines (697 loc) · 23.8 KB
/
settings.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
<?php
require "scripts/pi-hole/php/header.php";
require "scripts/pi-hole/php/savesettings.php";
// Reread ini file as things might have been changed
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
?>
<style type="text/css">
.tooltip-inner {
max-width: none;
white-space: nowrap;
}
@-webkit-keyframes Pulse{
from {color:#630030;-webkit-text-shadow:0 0 9px #333;}
50% {color:#e33100;-webkit-text-shadow:0 0 18px #e33100;}
to {color:#630030;-webkit-text-shadow:0 0 9px #333;}
}
p.lookatme {
-webkit-animation-name: Pulse;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
}
</style>
<?php if(isset($debug)){ ?>
<div id="alDebug" class="alert alert-warning alert-dismissible fade in" role="alert">
<button type="button" class="close" data-hide="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4><i class="icon fa fa-warning"></i> Debug</h4>
<?php print_r($_POST); ?>
</div>
<?php } ?>
<?php if(strlen($success) > 0){ ?>
<div id="alInfo" class="alert alert-info alert-dismissible fade in" role="alert">
<button type="button" class="close" data-hide="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4><i class="icon fa fa-info"></i> Info</h4>
<?php echo $success; ?>
</div>
<?php } ?>
<?php if(strlen($error) > 0){ ?>
<div id="alError" class="alert alert-danger alert-dismissible fade in" role="alert">
<button type="button" class="close" data-hide="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4><i class="icon fa fa-ban"></i> Error</h4>
<?php echo $error; ?>
</div>
<?php } ?>
<div class="row">
<div class="col-md-6">
<?php
// Networking
if(isset($setupVars["PIHOLE_INTERFACE"])){
$piHoleInterface = $setupVars["PIHOLE_INTERFACE"];
} else {
$piHoleInterface = "unknown";
}
if(isset($setupVars["IPV4_ADDRESS"])){
$piHoleIPv4 = $setupVars["IPV4_ADDRESS"];
} else {
$piHoleIPv4 = "unknown";
}
if(isset($setupVars["IPV6_ADDRESS"])){
$piHoleIPv6 = $setupVars["IPV6_ADDRESS"];
} else {
$piHoleIPv6 = "unknown";
}
$hostname = trim(file_get_contents("/etc/hostname"), "\x00..\x1F");
?>
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">Networking</h3>
</div>
<div class="box-body">
<div class="form-group">
<label>Pi-Hole Ethernet Interface</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-plug"></i></div>
<input type="text" class="form-control" disabled value="<?php echo $piHoleInterface; ?>">
</div>
</div>
<div class="form-group">
<label>Pi-Hole IPv4 address</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-plug"></i></div>
<input type="text" class="form-control" disabled value="<?php echo $piHoleIPv4; ?>">
</div>
</div>
<div class="form-group">
<label>Pi-Hole IPv6 address</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-plug"></i></div>
<input type="text" class="form-control" disabled value="<?php echo $piHoleIPv6; ?>">
</div>
<?php if (!defined('AF_INET6')){ ?><p style="color: #F00;">Warning: PHP has been compiled without IPv6 support.</p><?php } ?>
</div>
<div class="form-group">
<label>Pi-Hole hostname</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-laptop"></i></div>
<input type="text" class="form-control" disabled value="<?php echo $hostname; ?>">
</div>
</div>
</div>
</div>
<?php
// Pi-Hole DHCP server
// Detect IPv6
$usingipv6 = false;
if(strlen($piHoleIPv6) > 0 && $piHoleIPv6 != "unknown")
{
if(substr($piHoleIPv6, 0, 4) != "fe80")
{
$usingipv6 = true;
}
}
if(isset($setupVars["DHCP_ACTIVE"]))
{
if($setupVars["DHCP_ACTIVE"] == 1)
{
$DHCP = true;
}
else
{
$DHCP = false;
}
// Read setings from config file
$DHCPstart = $setupVars["DHCP_START"];
$DHCPend = $setupVars["DHCP_END"];
$DHCProuter = $setupVars["DHCP_ROUTER"];
// This setting has been added later, we have to check if it exists
if(isset($setupVars["DHCP_LEASETIME"]))
{
$DHCPleasetime = $setupVars["DHCP_LEASETIME"];
if(strlen($DHCPleasetime) < 1)
{
// Fallback if empty string
$DHCPleasetime = 24;
}
}
else
{
$DHCPleasetime = 24;
}
if(isset($setupVars["DHCP_IPv6"]))
{
$DHCPIPv6 = $setupVars["DHCP_IPv6"];
}
else
{
$DHCPIPv6 = $usingipv6;
}
}
else
{
$DHCP = false;
// Try to guess initial settings
if($piHoleIPv4 !== "unknown") {
$DHCPdomain = explode(".",$piHoleIPv4);
$DHCPstart = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".201";
$DHCPend = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".251";
$DHCProuter = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".1";
}
else {
$DHCPstart = "";
$DHCPend = "";
$DHCProuter = "";
}
$DHCPleasetime = 24;
$DHCPIPv6 = $usingipv6;
}
if(isset($setupVars["PIHOLE_DOMAIN"])){
$piHoleDomain = $setupVars["PIHOLE_DOMAIN"];
} else {
$piHoleDomain = "local";
}
?>
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">Pi-Hole DHCP Server</h3>
</div>
<div class="box-body">
<form role="form" method="post">
<div class="col-md-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="active" <?php if($DHCP){ ?>checked<?php } ?> id="DHCPchk"> DHCP server enabled</label></div>
</div>
</div>
<div class="col-md-6">
<p id="dhcpnotice" <?php if(!$DHCP){ ?>hidden<?php } ?>>Make sure your router's DHCP server is disabled when using the Pi-hole DHCP server!</p>
</div>
<div class="col-md-12">
<label>Range of IP addresses to hand out</label>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">From</div>
<input type="text" class="form-control DHCPgroup" name="from" value="<?php echo $DHCPstart; ?>" data-inputmask="'alias': 'ip'" data-mask <?php if(!$DHCP){ ?>disabled<?php } ?>>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">To</div>
<input type="text" class="form-control DHCPgroup" name="to" value="<?php echo $DHCPend; ?>" data-inputmask="'alias': 'ip'" data-mask <?php if(!$DHCP){ ?>disabled<?php } ?>>
</div>
</div>
</div>
<div class="col-md-12">
<label>Router (gateway) IP address</label>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Router</div>
<input type="text" class="form-control DHCPgroup" name="router" value="<?php echo $DHCProuter; ?>" data-inputmask="'alias': 'ip'" data-mask <?php if(!$DHCP){ ?>disabled<?php } ?>>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box box-warning collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">Advanced DHCP settings</h3>
<div class="box-tools pull-right"><button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button></div>
</div>
<div class="box-body">
<div class="col-md-12">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="useIPv6" <?php if($DHCPIPv6){ ?>checked<?php } ?> class="DHCPgroup" <?php if(!$DHCP){ ?>disabled<?php } ?>> Enable IPv6 support (SLAAC + RA)</label></div>
</div>
</div>
<div class="col-md-12">
<label>Pi-Hole domain name</label>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Domain</div>
<input type="text" class="form-control DHCPgroup" name="domain" value="<?php echo $piHoleDomain; ?>" <?php if(!$DHCP){ ?>disabled<?php } ?>>
</div>
</div>
</div>
<div class="col-md-12">
<label>DHCP lease time</label>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Lease time in hours</div>
<input type="text" class="form-control DHCPgroup" name="leasetime" id="leasetime" value="<?php echo $DHCPleasetime; ?>" data-inputmask="'mask': '9', 'repeat': 7, 'greedy' : false" data-mask <?php if(!$DHCP){ ?>disabled<?php } ?>>
</div>
</div>
<p>Hint: 0 = infinite, 24 = one day, 168 = one week, 744 = one month, 8760 = one year</p>
</div>
</div>
</div>
</div>
<?php if($DHCP) {
// Read leases file
$leasesfile = true;
$dhcpleases = fopen('/etc/pihole/dhcp.leases', 'r') or $leasesfile = false;
$dhcp_leases = [];
function convertseconds($argument) {
$seconds = round($argument);
if($seconds < 60)
{
return sprintf('%ds', $seconds);
}
elseif($seconds < 3600)
{
return sprintf('%dm %ds', ($seconds/60), ($seconds%60));
}
elseif($seconds < 86400)
{
return sprintf('%dh %dm %ds', ($seconds/3600%24),($seconds/60%60), ($seconds%60));
}
else
{
return sprintf('%dd %dh %dm %ds', ($seconds/86400), ($seconds/3600%24),($seconds/60%60), ($seconds%60));
}
}
while(!feof($dhcpleases) && $leasesfile)
{
$line = explode(" ",trim(fgets($dhcpleases)));
if(count($line) == 5)
{
$counter = intval($line[0]);
if($counter == 0)
{
$time = "Infinite";
}
elseif($counter <= 315360000) // 10 years in seconds
{
$time = convertseconds($counter);
}
else // Assume time stamp
{
$time = convertseconds($counter-time());
}
if(strpos($line[2], ':') !== false)
{
// IPv6 address
$type = 6;
}
else
{
// IPv4 lease
$type = 4;
}
$host = $line[3];
if($host == "*")
{
$host = "<i>unknown</i>";
}
$clid = $line[4];
if($clid == "*")
{
$clid = "<i>unknown</i>";
}
array_push($dhcp_leases,["TIME"=>$time, "hwaddr"=>$line[1], "IP"=>$line[2], "host"=>$host, "clid"=>$clid, "type"=>$type]);
}
}
?>
<div class="col-md-12">
<div class="box box-warning collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">DHCP leases</h3>
<div class="box-tools pull-right"><button type="button" class="btn btn-box-tool" data-widget="collapse" id="leaseexpand"><i class="fa fa-plus"></i></button></div>
</div>
<div class="box-body">
<div class="col-md-12">
<table id="DHCPLeasesTable" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
<thead>
<tr>
<th>IP address</th>
<th>Hostname</th>
</tr>
</thead>
<tbody>
<?php foreach($dhcp_leases as $lease) { ?><tr data-placement="auto" data-container="body" data-toggle="tooltip" title="Lease type: IPv<?php echo $lease["type"]; ?><br/>Remaining lease time: <?php echo $lease["TIME"]; ?><br/>DHCP UID: <?php echo $lease["clid"]; ?>"><td><?php echo $lease["IP"]; ?></td><td><?php echo $lease["host"]; ?></td></tr><?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
<div class="box-footer">
<input type="hidden" name="field" value="DHCP">
<button type="submit" class="btn btn-primary pull-right">Save</button>
</div>
</form>
</div>
<?php
// DNS settings
if(isset($setupVars["PIHOLE_DNS_1"])){
if(isset($primaryDNSservers[$setupVars["PIHOLE_DNS_1"]]))
{
$piHoleDNS1 = $primaryDNSservers[$setupVars["PIHOLE_DNS_1"]];
}
else
{
$piHoleDNS1 = "Custom";
}
} else {
$piHoleDNS1 = "unknown";
}
if(isset($setupVars["PIHOLE_DNS_2"])){
if(isset($secondaryDNSservers[$setupVars["PIHOLE_DNS_2"]]))
{
$piHoleDNS2 = $secondaryDNSservers[$setupVars["PIHOLE_DNS_2"]];
}
else
{
$piHoleDNS2 = "Custom";
}
} else {
$piHoleDNS2 = "unknown";
}
if(isset($setupVars["DNS_FQDN_REQUIRED"])){
if($setupVars["DNS_FQDN_REQUIRED"])
{
$DNSrequiresFQDN = true;
}
else
{
$DNSrequiresFQDN = false;
}
} else {
$DNSrequiresFQDN = true;
}
if(isset($setupVars["DNS_BOGUS_PRIV"])){
if($setupVars["DNS_BOGUS_PRIV"])
{
$DNSbogusPriv = true;
}
else
{
$DNSbogusPriv = false;
}
} else {
$DNSbogusPriv = true;
}
?>
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">Upstream DNS Servers</h3>
</div>
<div class="box-body">
<form role="form" method="post">
<div class="col-lg-6">
<label>Primary DNS Server</label>
<div class="form-group">
<?php foreach ($primaryDNSservers as $key => $value) { ?> <div class="radio"><label><input type="radio" name="primaryDNS" value="<?php echo $value;?>" <?php if($piHoleDNS1 === $value){ ?>checked<?php } ?> ><?php echo $value;?> (<?php echo $key;?>)</label></div> <?php } ?>
<label>Custom</label>
<div class="input-group">
<div class="input-group-addon"><input type="radio" name="primaryDNS" value="Custom"
<?php if($piHoleDNS1 === "Custom"){ ?>checked<?php } ?>></div>
<input type="text" name="DNS1IP" class="form-control" data-inputmask="'alias': 'ip'" data-mask
<?php if($piHoleDNS1 === "Custom"){ ?>value="<?php echo $setupVars["PIHOLE_DNS_1"]; ?>"<?php } ?>>
</div>
</div>
</div>
<div class="col-lg-6">
<label>Secondary DNS Server</label>
<div class="form-group">
<?php foreach ($secondaryDNSservers as $key => $value) { ?> <div class="radio"><label><input type="radio" name="secondaryDNS" value="<?php echo $value;?>" <?php if($piHoleDNS2 === $value){ ?>checked<?php } ?> ><?php echo $value;?> (<?php echo $key;?>)</label></div> <?php } ?>
<label>Custom</label>
<div class="input-group">
<div class="input-group-addon"><input type="radio" name="secondaryDNS" value="Custom"
<?php if($piHoleDNS2 === "Custom"){ ?>checked<?php } ?>></div>
<input type="text" name="DNS2IP" class="form-control" data-inputmask="'alias': 'ip'" data-mask
<?php if($piHoleDNS2 === "Custom"){ ?>value="<?php echo $setupVars["PIHOLE_DNS_2"]; ?>"<?php } ?>>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="box box-warning collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">Advanced DNS settings</h3>
<div class="box-tools pull-right"><button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button></div>
</div>
<div class="box-body">
<div class="col-lg-12">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="DNSrequiresFQDN" <?php if($DNSrequiresFQDN){ ?>checked<?php } ?> title="domain-needed"> never forward non-FQDNs</label></div>
</div>
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="DNSbogusPriv" <?php if($DNSbogusPriv){ ?>checked<?php } ?> title="bogus-priv"> never forward reverse lookups for private IP ranges</label></div>
</div>
<p>Note that enabling these two options may increase your privacy slightly, but may also prevent you from being able to access local hostnames if the Pi-Hole is not used as DHCP server</p>
</div>
</div>
</div>
</div>
</div>
<div class="box-footer">
<input type="hidden" name="field" value="DNS">
<button type="submit" class="btn btn-primary pull-right">Save</button>
</div>
</form>
</div>
</div>
<div class="col-md-6">
<?php
// Query logging
if(isset($setupVars["QUERY_LOGGING"]))
{
if($setupVars["QUERY_LOGGING"] == 1)
{
$piHoleLogging = true;
}
else
{
$piHoleLogging = false;
}
} else {
$piHoleLogging = true;
}
?>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Query Logging<?php if($piHoleLogging) { ?> (size of log <?php echo formatSizeUnits(filesize("/var/log/pihole.log")); ?>)<?php } ?></h3>
</div>
<div class="box-body">
<p>Current status:
<?php if($piHoleLogging) { ?>
Enabled (recommended)
<?php }else{ ?>
Disabled
<?php } ?></p>
<?php if($piHoleLogging) { ?>
<p>Note that disabling will render graphs on the web user interface useless</p>
<?php } ?>
</div>
<div class="box-footer">
<form role="form" method="post">
<button type="button" class="btn btn-default confirm-flushlogs">Flush logs</button>
<input type="hidden" name="field" value="Logging">
<?php if($piHoleLogging) { ?>
<input type="hidden" name="action" value="Disable">
<button type="submit" class="btn btn-primary pull-right">Disable query logging</button>
<?php } else { ?>
<input type="hidden" name="action" value="Enable">
<button type="submit" class="btn btn-primary pull-right">Enable query logging</button>
<?php } ?>
</form>
</div>
</div>
<?php
// Excluded domains in API Query Log call
if(isset($setupVars["API_EXCLUDE_DOMAINS"]))
{
$excludedDomains = explode(",", $setupVars["API_EXCLUDE_DOMAINS"]);
} else {
$excludedDomains = [];
}
// Exluded clients in API Query Log call
if(isset($setupVars["API_EXCLUDE_CLIENTS"]))
{
$excludedClients = explode(",", $setupVars["API_EXCLUDE_CLIENTS"]);
} else {
$excludedClients = [];
}
// Exluded clients
if(isset($setupVars["API_QUERY_LOG_SHOW"]))
{
$queryLog = $setupVars["API_QUERY_LOG_SHOW"];
} else {
$queryLog = "all";
}
// Privacy Mode
if(isset($setupVars["API_PRIVACY_MODE"]))
{
$privacyMode = $setupVars["API_PRIVACY_MODE"];
} else {
$privacyMode = false;
}
if(istrue($setupVars["API_GET_UPSTREAM_DNS_HOSTNAME"]))
{
$resolveForward = true;
}
else
{
$resolveForward = false;
}
if(istrue($setupVars["API_GET_CLIENT_HOSTNAME"]))
{
$resolveClients = true;
}
else
{
$resolveClients = false;
}
?>
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">API</h3>
</div>
<form role="form" method="post">
<div class="box-body">
<h4>Top Lists</h4>
<p>Exclude the following domains from being shown in</p>
<div class="col-lg-6">
<div class="form-group">
<label>Top Domains / Top Advertisers</label>
<textarea name="domains" class="form-control" rows="4" placeholder="Enter one domain per line"><?php foreach ($excludedDomains as $domain) { echo $domain."\n"; } ?></textarea>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label>Top Clients</label>
<textarea name="clients" class="form-control" rows="4" placeholder="Enter one IP address per line"><?php foreach ($excludedClients as $client) { echo $client."\n"; } ?></textarea>
</div>
</div>
<h4>Reverse DNS lookup</h4>
<p>Try to determine the domain name via querying the Pi-hole for</p>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="resolve-forward" <?php if($resolveForward){ ?>checked<?php } ?>> Forward Destinations</label></div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="resolve-clients" <?php if($resolveClients){ ?>checked<?php } ?>> Top Clients</label></div>
</div>
</div>
<h4>Query Log</h4>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="querylog-permitted" <?php if($queryLog === "permittedonly" || $queryLog === "all"){ ?>checked<?php } ?>> Show permitted queries</label></div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="querylog-blocked" <?php if($queryLog === "blockedonly" || $queryLog === "all"){ ?>checked<?php } ?>> Show blocked queries</label></div>
</div>
</div>
<h4>Privacy mode</h4>
<div class="col-lg-12">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="privacyMode" <?php if($privacyMode){ ?>checked<?php } ?>> Don't show query results for permitted requests</label></div>
</div>
</div>
</div>
<div class="box-footer">
<input type="hidden" name="field" value="API">
<button type="submit" class="btn btn-primary pull-right">Save</button>
</div>
</form>
</div>
<?php
// CPU temperature unit
if(isset($setupVars["TEMPERATUREUNIT"]))
{
$temperatureunit = $setupVars["TEMPERATUREUNIT"];
}
else
{
$temperatureunit = "C";
}
// Use $boxedlayout value determined in header.php
?>
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">Web User Interface</h3>
</div>
<form role="form" method="post">
<div class="box-body">
<?php /*
<h4>Query Log Page</h4>
<div class="col-lg-6">
<div class="form-group">
<label>Default value for <em>Show XX entries</em></label>
<select class="form-control" disabled>
<option>10</option>
<option>25</option>
<option>50</option>
<option>100</option>
<option>All</option>
</select>
</div>
</div>
*/ ?>
<h4>Interface appearance</h4>
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="boxedlayout" value="yes" <?php if($boxedlayout){ ?>checked<?php } ?> >Use boxed layout (helpful when working on large screens)</label></div>
</div>
<h4>CPU Temperature Unit</h4>
<div class="form-group">
<div class="radio"><label><input type="radio" name="tempunit" value="C" <?php if($temperatureunit === "C"){ ?>checked<?php } ?> >Celsius</label></div>
<div class="radio"><label><input type="radio" name="tempunit" value="K" <?php if($temperatureunit === "K"){ ?>checked<?php } ?> >Kelvin</label></div>
<div class="radio"><label><input type="radio" name="tempunit" value="F" <?php if($temperatureunit === "F"){ ?>checked<?php } ?> >Fahrenheit</label></div>
</div>
</div>
<div class="box-footer">
<input type="hidden" name="field" value="webUI">
<button type="submit" class="btn btn-primary pull-right">Save</button>
</div>
</form>
</div>
<?php /*
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Blocking Page</h3>
</div>
<div class="box-body">
<p>Show page with details if a site is blocked</p>
<div class="form-group">
<div class="radio"><label><input type="radio" name="blockingPage" value="Yes" <?php if($pishowBlockPage){ ?>checked<?php } ?> disabled>Yes</label></div>
<div class="radio"><label><input type="radio" name="blockingPage" value="No" <?php if(!$pishowBlockPage){ ?>checked<?php } ?> disabled>No</label></div>
<p>If Yes: Hide content for in page ads?</p>
<div class="checkbox"><label><input type="checkbox" <?php if($pishowBlockPageInpage) { ?>checked<?php } ?> disabled>Enabled (recommended)</label></div>
</div>
</div>
</div>
*/ ?>
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">System Administration</h3>
</div>
<div class="box-body">
<button type="button" class="btn btn-default confirm-reboot">Restart system</button>
<button type="button" class="btn btn-default confirm-restartdns">Restart DNS server</button>
<button type="button" class="btn btn-default confirm-flushlogs">Flush logs</button>
<form role="form" method="post" id="rebootform">
<input type="hidden" name="field" value="reboot">
</form>
<form role="form" method="post" id="restartdnsform">
<input type="hidden" name="field" value="restartdns">
</form>
<form role="form" method="post" id="flushlogsform">
<input type="hidden" name="field" value="flushlogs">
</form>
</div>
</div>
</div>
</div>
<?php
require "scripts/pi-hole/php/footer.php";
?>
<script src="scripts/vendor/jquery.inputmask.js"></script>
<script src="scripts/vendor/jquery.inputmask.extensions.js"></script>
<script src="scripts/vendor/jquery.confirm.min.js"></script>
<script src="scripts/pi-hole/js/settings.js"></script>