Skip to content

Commit

Permalink
Merge branch 'devel' into clienthosts
Browse files Browse the repository at this point in the history
  • Loading branch information
DL6ER committed Dec 21, 2016
2 parents a0b4083 + fba3d10 commit 40edcf6
Show file tree
Hide file tree
Showing 83 changed files with 637 additions and 447 deletions.
22 changes: 11 additions & 11 deletions api.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
$api = true;
require "php/password.php";
require "php/auth.php";
require "scripts/pi-hole/php/password.php";
require "scripts/pi-hole/php/auth.php";

check_cors();

include('data.php');
include('scripts/pi-hole/php/data.php');
header('Content-type: application/json');

$data = array();
Expand Down Expand Up @@ -77,19 +77,19 @@
}

if (isset($_GET['getGravityDomains'])) {
$data = array_merge($data, getGravityDomains($gravity));
$data = array_merge($data, getGravity());
}

function filterArray(&$a) {
$sanArray = array();
foreach ($a as $k=>$v) {
if (is_array($v)) {
$sanArray[htmlspecialchars($k)] = filterArray($v);
function filterArray(&$inArray) {
$outArray = array();
foreach ($inArray as $key=>$value) {
if (is_array($value)) {
$outArray[htmlspecialchars($key)] = filterArray($value);
} else {
$sanArray[htmlspecialchars($k)] = htmlspecialchars($v);
$outArray[htmlspecialchars($key)] = htmlspecialchars($value);
}
}
return $sanArray;
return $outArray;
}

$data = filterArray($data);
Expand Down
6 changes: 0 additions & 6 deletions bootstrap/css/bootstrap.min.css

This file was deleted.

7 changes: 0 additions & 7 deletions css/AdminLTE.min.css

This file was deleted.

4 changes: 0 additions & 4 deletions css/font-awesome-4.5.0/css/font-awesome.min.css

This file was deleted.

11 changes: 0 additions & 11 deletions css/ionicons-2.0.1/css/ionicons.min.css

This file was deleted.

6 changes: 3 additions & 3 deletions gravity.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";
?>
<!-- Title -->
<div class="page-header">
Expand All @@ -20,8 +20,8 @@
<pre id="output" style="width: 100%; height: 100%;" hidden="true"></pre>

<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>


<script src="js/pihole/gravity.js"></script>
<script src="scripts/pi-hole/js/gravity.js"></script>
39 changes: 24 additions & 15 deletions help.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";

if(strlen($pwhash) > 0)
{
Expand Down Expand Up @@ -93,40 +93,51 @@
</div>
<div class="row">
<div class="col-md-12">
<h2>Setings</h2>
<h2>Settings</h2>
Change settings for the Pi-Hole
<h4>Networking</h4>
Displays information about the interfaces of the Pi-Hole. No changes possible
<h4>Pi-Hole DHCP Server</h4>
Using this setting you can enable/disable the DHCP server of the Pi-Hole. Note that you should disable any other DHCP server on your network to avoid IP addresses being used more than once. You have to give the range of IPs that DHCP will serve and the IP of the local router (gateway). If the DHCP server is active, the current leases are shown on the settings page.
<h4>Upstream DNS Servers</h4>
Customize used upstream DNS servers + advanced settings
<h4>Query Logging</h4>
Enabled/disable query logging on your Pi-hole
<h4>API</h4>
Change settings which apply to the API as well as the web UI<br>
Note that Top Clients have to be given as IP addresses
<h4>Web User Interface</h4>
Other settings whioch affect the webUI but not the API of Pi-hole
<h4>System Administration</h4>
Apply system-wide actions like restarting of the server
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Donate</h2>
Keep in mind that Pi-hole is free. If you like Pi-hole, please consider a small donation to help support its development
<h2>Authentication system (currently <?php if($authenticationsystem) { ?>enabled<?php } else { ?>disabled<?php } ?>)</h2>
<p>Using the command<pre>sudo pihole -a -p pa22w0rd</pre> where <em>pa22w0rd</em> is the password to be set in this example, one can enable the authentication system of this web interface. Thereafter, a login is required for most pages (the main page will show a limited amount of statistics). Note that the authentication system may be disabled again, by setting an empty password using the command shown above. The Help center will show more details concerning the authentication system only if it is enabled</p>
</div>
</div>
<?php if($authenticationsystem) { ?>
<div class="row">
<div class="col-md-12">
<h2>Help (this page)</h2>
Shows information about what is happening behind the scenes and what can be done with this web user interface (web UI). The Help center will show details concerning the authentication system only if it is enabled
<h2>Login / Logout</h2>
<p>Using the Login / Logout function, a user can initiate / terminate a login session. The login page will also always be shown if a user tries to access a protected page directly without having a valid login session</p>
</div>
</div>
<?php } ?>
<div class="row">
<div class="col-md-12">
<h2>Authentication system (currently <?php if($authenticationsystem) { ?>enabled<?php } else { ?>disabled<?php } ?>)</h2>
<p>Using the command<pre>sudo pihole -a -p pa22w0rd</pre> where <em>pa22w0rd</em> is the password to be set in this example, one can enable the authentication system of this web interface. Thereafter, a login is required for most pages (the main page will show a limited amount of statistics). Note that the authentication system may be disabled again, by setting an empty password using the command shown above. The Help center will show more details concerning the authentication system only if it is enabled</p>
<h2>Donate</h2>
Keep in mind that Pi-hole is free. If you like Pi-hole, please consider a small donation to help support its development
</div>
</div>
<?php if($authenticationsystem) { ?>
<div class="row">
<div class="col-md-12">
<h2>Login / Logout</h2>
<p>Using the Login / Logout function, a user can initiate / terminate a login session. The login page will also always be shown if a user tries to access a protected page directly without having a valid login session</p>
<h2>Help (this page)</h2>
Shows information about what is happening behind the scenes and what can be done with this web user interface (web UI). The Help center will show details concerning the authentication system only if it is enabled
</div>
</div>
<?php } ?>
<div class="row">
<div class="col-md-12">
<h2>Footer</h2>
Expand All @@ -135,7 +146,5 @@
</div>

<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>

<script src="js/pihole/help.js"></script>
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$indexpage = true;
require "header.php";
require "scripts/pi-hole/php/header.php";
?>
<!-- Small boxes (Stat box) -->
<div class="row">
Expand Down Expand Up @@ -213,7 +213,7 @@
<!-- /.row -->
<?php } ?>
<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>

<script src="js/pihole/index.js"></script>
<script src="scripts/pi-hole/js/index.js"></script>
7 changes: 0 additions & 7 deletions js/pihole/help.js

This file was deleted.

6 changes: 3 additions & 3 deletions list.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";

$list = $_GET['l'];

Expand Down Expand Up @@ -52,7 +52,7 @@ function getFullName() {
<ul class="list-group" id="list"></ul>

<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>

<script src="js/pihole/list.js"></script>
<script src="scripts/pi-hole/js/list.js"></script>
10 changes: 7 additions & 3 deletions queries.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";

// Generate CSRF token
if(empty($_SESSION['token'])) {
Expand All @@ -23,6 +23,10 @@
{
$showing = "(showing blocked queries only)";
}
elseif($setupVars["API_QUERY_LOG_SHOW"] === "nothing")
{
$showing = "(showing no queries at all)";
}
}

?>
Expand Down Expand Up @@ -93,7 +97,7 @@
<!-- /.row -->

<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>

<script src="js/pihole/queries.js"></script>
<script src="scripts/pi-hole/js/queries.js"></script>
6 changes: 3 additions & 3 deletions queryads.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";
?>
<!-- Title -->
<div class="page-header">
Expand All @@ -18,8 +18,8 @@
<pre id="output" style="width: 100%; height: 100%;" hidden="true"></pre>

<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>


<script src="js/pihole/queryads.js"></script>
<script src="scripts/pi-hole/js/queryads.js"></script>
4 changes: 2 additions & 2 deletions js/pihole/footer.js → scripts/pi-hole/js/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ function versionCompare(left, right) {
$.getJSON("https://api.github.com/repos/pi-hole/pi-hole/releases/latest", function(json) {
if(versionCompare(piholeVersion, json.tag_name.slice(1)) < 0) {
// Alert user
$("#piholeVersion").html($("#piholeVersion").text() + '<a class="alert-link" href="https://github.com/pi-hole/pi-hole/releases">(Update available!)</a>');
$("#piholeVersion").html($("#piholeVersion").text() + "<a class=\"alert-link\" href=\"https://github.com/pi-hole/pi-hole/releases\">(Update available!)</a>");
$("#alPiholeUpdate").show();
}
});
$.getJSON("https://api.github.com/repos/pi-hole/AdminLTE/releases/latest", function(json) {
if(versionCompare(webVersion, json.tag_name.slice(1)) < 0) {
// Alert user
$("#webVersion").html($("#webVersion").text() + '<a class="alert-link" href="https://github.com/pi-hole/adminLTE/releases">(Update available!)</a>');
$("#webVersion").html($("#webVersion").text() + "<a class=\"alert-link\" href=\"https://github.com/pi-hole/adminLTE/releases\">(Update available!)</a>");
$("#alWebUpdate").show();
}
});
Expand Down
2 changes: 1 addition & 1 deletion js/pihole/gravity.js → scripts/pi-hole/js/gravity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function eventsource() {
var alInfo = $("#alInfo");
var alSuccess = $("#alSuccess");
var ta = $("#output");
var source = new EventSource("php/gravity.sh.php");
var source = new EventSource("scripts/pi-hole/php/gravity.sh.php");

ta.html("");
ta.show();
Expand Down
File renamed without changes.
Loading

0 comments on commit 40edcf6

Please sign in to comment.