Merge pull request #4 from pi-hole/devel

sync my branch
This commit is contained in:
TheME
2017-08-27 21:16:37 +02:00
committed by GitHub
6 changed files with 37 additions and 8 deletions
+9 -1
View File
@@ -69,11 +69,19 @@
<!-- /.box -->
</div>
<div class="col-md-12">
<p><strong>Important:</strong> Note that black- and whitelisted domains are not automatically applied on this page to avoid restarting the DNS service too often. Instead, go to <a href="http://pi.hole/admin/gravity.php">Update Lists</a> and run the update, to have the new settings become effective.</p>
<p><strong>Important:</strong> Note that black- and whitelisted domains are not automatically applied on this page to avoid restarting the DNS service too often. Instead, click on this button, to have the new settings become effective:</p>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="container">
<div class="row justify-content-md-right">
<div class="col-2">
<button class="btn btn-lg btn-primary btn-block" id="gravityBtn" disabled="true">Update black-/whitelists</button>
</div>
</div>
</div>
<?php
require "scripts/pi-hole/php/footer.php";
?>
+2 -2
View File
@@ -1,4 +1,4 @@
<?php /*
<?php /*
* Pi-hole: A black hole for Internet advertisements
* (c) 2017 Pi-hole, LLC (https://pi-hole.net)
* Network-wide ad blocking via your own hardware.
@@ -9,7 +9,7 @@
?>
<!-- Title -->
<div class="page-header">
<h1>Update list of ad-serving domains</h1>
<h1>Update list of ad-serving domains / blacklist / whitelist</h1>
</div>
<!-- Alerts -->
+9 -2
View File
@@ -89,9 +89,10 @@ $(document).ready(function() {
$("#domain-frequency tbody").on( "click", "button", function () {
var url = ($(this).parents("tr"))[0].innerText.split(" ")[0];
if($(this).context.innerText === "Blacklist")
if($(this).context.innerText === " Blacklist")
{
add(url,"black");
$("#gravityBtn").prop("disabled", false);
}
else
{
@@ -101,9 +102,10 @@ $(document).ready(function() {
$("#ad-frequency tbody").on( "click", "button", function () {
var url = ($(this).parents("tr"))[0].innerText.split(" ")[0].split(" ")[0];
if($(this).context.innerText === "Whitelist")
if($(this).context.innerText === " Whitelist")
{
add(url,"white");
$("#gravityBtn").prop("disabled", false);
}
else
{
@@ -111,3 +113,8 @@ $(document).ready(function() {
}
});
});
$("#gravityBtn").on("click", function() {
window.location.replace("gravity.php?go");
});
+8
View File
@@ -39,6 +39,14 @@
</div>
</div>
</div>
<?php
// Flushes the system write buffers of PHP. This attempts to push everything we have so far all the way to the client's browser.
flush();
// Run update checker
// - determines local branch each time,
// - determines local and remote version every 30 minutes
require "scripts/pi-hole/php/update_checker.php";
?>
<!-- /.content-wrapper -->
<footer class="main-footer">
<!-- Version Infos -->
+4 -3
View File
@@ -9,7 +9,6 @@
<?php
require "scripts/pi-hole/php/auth.php";
require "scripts/pi-hole/php/password.php";
require "scripts/pi-hole/php/update_checker.php";
check_cors();
@@ -253,10 +252,10 @@ if($auth) {
<!-- Menu Body -->
<li class="user-body">
<div class="col-xs-4 text-center">
<a class="btn-link" href="https://github.com/pi-hole/pi-hole" target="_blank">GitHub</a>
<a class="btn-link" href="https://github.com/pi-hole" target="_blank">GitHub</a>
</div>
<div class="col-xs-4 text-center">
<a class="btn-link" href="http://jacobsalmela.com/block-millions-ads-network-wide-with-a-raspberry-pi-hole-2-0/" target="_blank">Details</a>
<a class="btn-link" href="https://pi-hole.net" target="_blank">Website</a>
</div>
<div class="col-xs-4 text-center">
<a class="btn-link" href="https://github.com/pi-hole/pi-hole/releases" target="_blank">Updates</a>
@@ -268,6 +267,7 @@ if($auth) {
<!-- Menu Footer -->
<li class="user-footer">
<!-- Version Infos -->
<?php /*
<div class="<?php if(!isset($core_commit) && !isset($web_commit)) { ?>hidden-md <?php } ?>hidden-lg">
<b>Pi-hole Version </b> <?php
echo $core_current;
@@ -281,6 +281,7 @@ if($auth) {
echo $FTL_current;
if($FTL_update){ ?> <a class="alert-link lookatme btn-link" href="https://github.com/pi-hole/FTL/releases" target="_blank" style="background:none">(Update available!)</a><?php } ?><br><br>
</div>
*/ ?>
<!-- PayPal -->
<div class="text-center">
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=3J2L3Z4DHW9UY" target="_blank" style="background:none">
+5
View File
@@ -20,6 +20,7 @@ function echoEvent($datatext) {
}
// Credit: http://stackoverflow.com/a/4694816/2087442
ini_set("pcre.recursion_limit", 1500);
function is_valid_domain_name($domain_name)
{
return (preg_match("/^((-|_)*[a-z\d]((-|_)*[a-z\d])*(-|_)*)(\.(-|_)*([a-z\d]((-|_)*[a-z\d])*))*$/i", $domain_name) // Valid chars check
@@ -48,6 +49,10 @@ if(isset($_GET["exact"]))
{
$exact = "-exact";
}
elseif(isset($_GET["bp"]))
{
$exact = "-bp";
}
else
{
$exact = "";