Merge pull request #175 from pi-hole/devel

[Staging] Next release
This commit is contained in:
Adam Warner
2016-10-30 01:11:25 +01:00
committed by GitHub
2 changed files with 28 additions and 4 deletions
+23 -4
View File
@@ -1,4 +1,13 @@
<?php
if (isset($_GET['enable'])) {
exec('sudo pihole enable');
$refer = $_SERVER['HTTP_REFERER'];
header("location:$refer");
} elseif (isset($_GET['disable'])) {
exec('sudo pihole disable');
$refer = $_SERVER['HTTP_REFERER'];
header("location:$refer");
}
$cmd = "echo $((`cat /sys/class/thermal/thermal_zone0/temp | cut -c1-2`))";
$output = shell_exec($cmd);
$output = str_replace(array("\r\n","\r","\n"),"", $output);
@@ -8,7 +17,7 @@
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://api.github.com; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://api.github.com; script-src 'self'; style-src 'self' 'unsafe-inline'">
<title>Pi-hole Admin Console</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
@@ -129,11 +138,13 @@
<div class="pull-left info">
<p>Status</p>
<?php
$pistatus = exec('pgrep dnsmasq | wc -l');
if ($pistatus > "0") {
$pistatus = exec('sudo pihole status web');
if ($pistatus == "1") {
echo '<a href="#"><i class="fa fa-circle" style="color:#7FFF00"></i> Active</a>';
} else {
} elseif ($pistatus == "0") {
echo '<a href="#"><i class="fa fa-circle" style="color:#FF0000"></i> Offline</a>';
} else {
echo '<a href="#"><i class="fa fa-circle" style="color:#ff9900"></i> Starting</a>';
}
// CPU Temp
@@ -172,6 +183,14 @@
<i class="fa fa-ban"></i> <span>Blacklist</span>
</a>
</li>
<!-- Toggle -->
<?php
if ($pistatus == "1") {
echo ' <li><a href="?disable"><i class="fa fa-stop"></i> <span>Disable</span></a></li>';
} else {
echo ' <li><a href="?enable"><i class="fa fa-play"></i> <span>Enable</span></a></li>';
}
?>
<!-- Donate -->
<li>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3J2L3Z4DHW9UY">
+5
View File
@@ -4,6 +4,11 @@ require "header.php";
$list = $_GET['l'];
if($list !== "white" && $list !== "black")
echo "Invalid list parameter";
require "footer.php";
die();
function getFullName() {
global $list;
if($list == "white")