Merge branch 'devel' into clienthosts

This commit is contained in:
DL6ER
2016-12-21 13:16:46 +01:00
83 changed files with 639 additions and 449 deletions
+11 -11
View File
@@ -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();
@@ -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);
File diff suppressed because one or more lines are too long
-7
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";
?>
<!-- Title -->
<div class="page-header">
@@ -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>
+26 -17
View File
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";
if(strlen($pwhash) > 0)
{
@@ -93,24 +93,23 @@
</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.
</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
</div>
</div>
<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
<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">
@@ -127,6 +126,18 @@
</div>
</div>
<?php } ?>
<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
</div>
</div>
<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
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Footer</h2>
@@ -135,7 +146,5 @@
</div>
<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>
<script src="js/pihole/help.js"></script>
+3 -3
View File
@@ -1,6 +1,6 @@
<?php
$indexpage = true;
require "header.php";
require "scripts/pi-hole/php/header.php";
?>
<!-- Small boxes (Stat box) -->
<div class="row">
@@ -213,7 +213,7 @@ else
<!-- /.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
View File
@@ -1,7 +0,0 @@
$( "#flush" ).click(function() {
if (confirm("Are you sure you want to flush the Pi-hole log file?")) {
document.location.href="help.php?flush";
} else {
// Do nothing!
}
});
+3 -3
View File
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";
$list = $_GET['l'];
@@ -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>
+7 -3
View File
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";
// Generate CSRF token
if(empty($_SESSION['token'])) {
@@ -23,6 +23,10 @@ if(isset($setupVars["API_QUERY_LOG_SHOW"]))
{
$showing = "(showing blocked queries only)";
}
elseif($setupVars["API_QUERY_LOG_SHOW"] === "nothing")
{
$showing = "(showing no queries at all)";
}
}
?>
@@ -93,7 +97,7 @@ if(isset($setupVars["API_QUERY_LOG_SHOW"]))
<!-- /.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>
+3 -3
View File
@@ -1,5 +1,5 @@
<?php
require "header.php";
require "scripts/pi-hole/php/header.php";
?>
<!-- Title -->
<div class="page-header">
@@ -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>
@@ -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();
}
});
@@ -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();
@@ -25,36 +25,32 @@ function objectToArray(p){
function updateSummaryData(runOnce) {
var setTimer = function(timeInSeconds) {
if (!runOnce) {
setTimeout(updateSummaryData, timeInSeconds * 1000);
}
};
$.getJSON("api.php?summary", function LoadSummaryData(data) {
//$("h3.statistic").addClass("glow");
if ($("h3#ads_blocked_today").text() != data.ads_blocked_today) {
$("h3#ads_blocked_today").addClass("glow");
}
if ($("h3#dns_queries_today").text() != data.dns_queries_today) {
$("h3#dns_queries_today").addClass("glow");
}
if ($("h3#ads_percentage_today").text() != data.ads_percentage_today) {
$("h3#ads_percentage_today").addClass("glow");
}
window.setTimeout(function(){
$("h3#ads_blocked_today").text(data.ads_blocked_today);
$("h3#dns_queries_today").text(data.dns_queries_today);
$("h3#domains_being_blocked").text(data.domains_being_blocked);
$("h3#ads_percentage_today").text(data.ads_percentage_today + "%");
$("h3.statistic.glow").removeClass("glow")
["ads_blocked_today", "dns_queries_today", "ads_percentage_today"].forEach(function(today) {
var todayElement = $("h3#" + today);
todayElement.text() !== data[today] && todayElement.addClass("glow");
});
window.setTimeout(function() {
["ads_blocked_today", "dns_queries_today", "domains_being_blocked", "ads_percentage_today"].forEach(function(header, idx) {
var textData = idx === 3 ? data[header] + "%" : data[header];
$("h3#" + header).text(textData);
});
$("h3.statistic.glow").removeClass("glow");
}, 500);
updateSessionTimer();
}).done(function() {
if (runOnce !== true) {
setTimeout(updateSummaryData, 10000);
}
setTimer(10);
}).fail(function() {
if (runOnce !== true) {
setTimeout(updateSummaryData, (1000 * 60 * 5));
}
});;
setTimer(300);
});
}
var failures = 0;
@@ -80,7 +76,7 @@ function updateQueriesOverTime() {
timeLineChart.data.datasets[1].data.push(data.ads_over_time[1][hour]);
}
}
$('#queries-over-time .overlay').remove();
$("#queries-over-time .overlay").remove();
timeLineChart.update();
}).done(function() {
// Reload graph after 10 minutes
@@ -113,7 +109,7 @@ function updateQueryTypes() {
var dd = {data: v, backgroundColor: c};
// and push it at once
queryTypeChart.data.datasets.push(dd);
$('#query-types .overlay').remove();
$("#query-types .overlay").remove();
queryTypeChart.update();
queryTypeChart.chart.config.options.cutoutPercentage=30;
queryTypeChart.update();
@@ -135,20 +131,24 @@ function escapeHtml(text) {
function updateTopClientsChart() {
$.getJSON("api.php?summaryRaw&getQuerySources", function(data) {
var clienttable = $('#client-frequency').find('tbody:last');
var clienttable = $("#client-frequency").find("tbody:last");
var domain, percentage;
for (domain in data.top_sources) {
// Sanitize domain
domain = escapeHtml(domain);
var url = "<a href=\"queries.php?client="+domain+"\">"+domain+"</a>";
percentage = data.top_sources[domain] / data.dns_queries_today * 100;
clienttable.append("<tr> <td>" + url +
"</td> <td>" + data.top_sources[domain] + "</td> <td> <div class=\"progress progress-sm\" title=\""+percentage.toFixed(1)+"%\"> <div class=\"progress-bar progress-bar-blue\" style=\"width: " +
percentage + "%\"></div> </div> </td> </tr> ");
if ({}.hasOwnProperty.call(data.top_sources, domain)){
// Sanitize domain
domain = escapeHtml(domain);
var url = "<a href=\"queries.php?client="+domain+"\">"+domain+"</a>";
percentage = data.top_sources[domain] / data.dns_queries_today * 100;
clienttable.append("<tr> <td>" + url +
"</td> <td>" + data.top_sources[domain] + "</td> <td> <div class=\"progress progress-sm\" title=\""+percentage.toFixed(1)+"%\"> <div class=\"progress-bar progress-bar-blue\" style=\"width: " +
percentage + "%\"></div> </div> </td> </tr> ");
}
}
$('#client-frequency .overlay').remove();
$("#client-frequency .overlay").remove();
});
}
@@ -168,7 +168,7 @@ function updateForwardDestinations() {
var dd = {data: v, backgroundColor: c};
// and push it at once
forwardDestinationChart.data.datasets.push(dd);
$('#forward-destinations .overlay').remove();
$("#forward-destinations .overlay").remove();
forwardDestinationChart.update();
forwardDestinationChart.chart.config.options.cutoutPercentage=30;
forwardDestinationChart.update();
@@ -177,34 +177,39 @@ function updateForwardDestinations() {
function updateTopLists() {
$.getJSON("api.php?summaryRaw&topItems", function(data) {
var domaintable = $('#domain-frequency').find('tbody:last');
var adtable = $('#ad-frequency').find('tbody:last');
var domaintable = $("#domain-frequency").find("tbody:last");
var adtable = $("#ad-frequency").find("tbody:last");
var url, domain, percentage;
for (domain in data.top_queries) {
// Sanitize domain
domain = escapeHtml(domain);
if(domain !== "pi.hole")
{
url = "<a href=\"queries.php?domain="+domain+"\">"+domain+"</a>";
if ({}.hasOwnProperty.call(data.top_queries,domain)){
// Sanitize domain
domain = escapeHtml(domain);
if(domain !== "pi.hole")
{
url = "<a href=\"queries.php?domain="+domain+"\">"+domain+"</a>";
}
else
{
url = domain;
}
percentage = data.top_queries[domain] / data.dns_queries_today * 100;
domaintable.append("<tr> <td>" + url +
"</td> <td>" + data.top_queries[domain] + "</td> <td> <div class=\"progress progress-sm\" title=\""+percentage.toFixed(1)+"%\"> <div class=\"progress-bar progress-bar-green\" style=\"width: " +
percentage + "%\"></div> </div> </td> </tr> ");
}
else
{
url = domain;
}
percentage = data.top_queries[domain] / data.dns_queries_today * 100;
domaintable.append("<tr> <td>" + url +
"</td> <td>" + data.top_queries[domain] + "</td> <td> <div class=\"progress progress-sm\" title=\""+percentage.toFixed(1)+"%\"> <div class=\"progress-bar progress-bar-green\" style=\"width: " +
percentage + "%\"></div> </div> </td> </tr> ");
}
for (domain in data.top_ads) {
// Sanitize domain
domain = escapeHtml(domain);
url = "<a href=\"queries.php?domain="+domain+"\">"+domain+"</a>";
percentage = data.top_ads[domain] / data.ads_blocked_today * 100;
adtable.append("<tr> <td>" + url +
"</td> <td>" + data.top_ads[domain] + "</td> <td> <div class=\"progress progress-sm\" title=\""+percentage.toFixed(1)+"%\"> <div class=\"progress-bar progress-bar-yellow\" style=\"width: " +
percentage + "%\"></div> </div> </td> </tr> ");
if ({}.hasOwnProperty.call(data.top_ads,domain)){
// Sanitize domain
domain = escapeHtml(domain);
url = "<a href=\"queries.php?domain="+domain+"\">"+domain+"</a>";
percentage = data.top_ads[domain] / data.ads_blocked_today * 100;
adtable.append("<tr> <td>" + url +
"</td> <td>" + data.top_ads[domain] + "</td> <td> <div class=\"progress progress-sm\" title=\""+percentage.toFixed(1)+"%\"> <div class=\"progress-bar progress-bar-yellow\" style=\"width: " +
percentage + "%\"></div> </div> </td> </tr> ");
}
}
$("#domain-frequency .overlay").remove();
@@ -277,6 +282,23 @@ $(document).ready(function() {
var from = padNumber(h)+":"+padNumber(m)+":00";
var to = padNumber(h)+":"+padNumber(m+9)+":59";
return "Queries from "+from+" to "+to;
},
label(tooltipItems, data) {
if(tooltipItems.datasetIndex === 1)
{
var percentage = 0.0;
var total = parseInt(data.datasets[0].data[tooltipItems.index]);
var blocked = parseInt(data.datasets[1].data[tooltipItems.index]);
if(total > 0)
{
percentage = 100.0*blocked/total;
}
return data.datasets[tooltipItems.datasetIndex].label + ": " + tooltipItems.yLabel + " (" + percentage.toFixed(1) + "%)";
}
else
{
return data.datasets[tooltipItems.datasetIndex].label + ": " + tooltipItems.yLabel;
}
}
}
},
@@ -1,35 +1,29 @@
// IE likes to cache too much :P
$.ajaxSetup({cache: false});
// Handle enter button for adding domains
$(document).keypress(function(e) {
if(e.which === 13 && $("#domain").is(":focus")) {
// Enter was pressed, and the input has focus
add();
}
});
// Handle buttons
$("#btnAdd").on("click", function() {
add();
});
$("#btnRefresh").on("click", function() {
refresh(true);
});
// Handle hiding of alerts
$(function(){
$("[data-hide]").on("click", function(){
$(this).closest("." + $(this).attr("data-hide")).hide();
});
});
// Get PHP info
var token = $("#token").html();
var list_type = $("#list-type").html();
var fullName = list_type === "white" ? "Whitelist" : "Blacklist";
var listType = $("#list-type").html();
var fullName = listType === "white" ? "Whitelist" : "Blacklist";
window.onload = refresh(false);
function sub(index, entry) {
var domain = $("#"+index);
domain.hide("highlight");
$.ajax({
url: "scripts/pi-hole/php/sub.php",
method: "post",
data: {"domain":entry, "list":listType, "token":token},
success: function(response) {
if(response.length !== 0){
return;
}
domain.remove();
},
error: function(jqXHR, exception) {
alert("Failed to remove the domain!");
}
});
}
function refresh(fade) {
var list = $("#list");
@@ -37,27 +31,27 @@ function refresh(fade) {
list.fadeOut(100);
}
$.ajax({
url: "php/get.php",
url: "scripts/pi-hole/php/get.php",
method: "get",
data: {"list":list_type},
data: {"list":listType},
success: function(response) {
list.html("");
var data = JSON.parse(response);
if(data.length === 0) {
list.html('<div class="alert alert-info" role="alert">Your ' + fullName + ' is empty!</div>');
list.html("<div class=\"alert alert-info\" role=\"alert\">Your " + fullName + " is empty!</div>");
}
else {
data.forEach(function (entry, index) {
list.append(
'<li id="' + index + '" class="list-group-item clearfix">' + entry +
'<button class="btn btn-danger btn-xs pull-right" type="button">' +
'<span class="glyphicon glyphicon-trash"></span></button></li>'
"<li id=\"" + index + "\" class=\"list-group-item clearfix\">" + entry +
"<button class=\"btn btn-danger btn-xs pull-right\" type=\"button\">" +
"<span class=\"glyphicon glyphicon-trash\"></span></button></li>"
);
// Handle button
$("#list #"+index+"").on("click", "button", function() {
sub(index, entry)
sub(index, entry);
});
});
}
@@ -69,10 +63,13 @@ function refresh(fade) {
});
}
window.onload = refresh(false);
function add() {
var domain = $("#domain");
if(domain.val().length === 0)
if(domain.val().length === 0){
return;
}
var alInfo = $("#alInfo");
var alSuccess = $("#alSuccess");
@@ -81,9 +78,9 @@ function add() {
alSuccess.hide();
alFailure.hide();
$.ajax({
url: "php/add.php",
url: "scripts/pi-hole/php/add.php",
method: "post",
data: {"domain":domain.val(), "list":list_type, "token":token},
data: {"domain":domain.val(), "list":listType, "token":token},
success: function(response) {
if (response.indexOf("not a valid argument") >= 0 ||
response.indexOf("is not a valid domain") >= 0) {
@@ -118,20 +115,27 @@ function add() {
});
}
function sub(index, entry) {
var domain = $("#"+index);
domain.hide("highlight");
$.ajax({
url: "php/sub.php",
method: "post",
data: {"domain":entry, "list":list_type, "token":token},
success: function(response) {
if(response.length !== 0)
return;
domain.remove();
},
error: function(jqXHR, exception) {
alert("Failed to remove the domain!");
}
// Handle enter button for adding domains
$(document).keypress(function(e) {
if(e.which === 13 && $("#domain").is(":focus")) {
// Enter was pressed, and the input has focus
add();
}
});
// Handle buttons
$("#btnAdd").on("click", function() {
add();
});
$("#btnRefresh").on("click", function() {
refresh(true);
});
// Handle hiding of alerts
$(function(){
$("[data-hide]").on("click", function(){
$(this).closest("." + $(this).attr("data-hide")).hide();
});
}
});
@@ -9,16 +9,77 @@ function escapeRegex(text) {
return text.replace(/[().]/g, function(m) { return map[m]; });
}
function refreshData() {
tableApi.ajax.url("api.php?getAllQueries").load();
// updateSessionTimer();
}
function add(domain,list) {
var token = $("#token").html();
var alInfo = $("#alInfo");
var alList = $("#alList");
var alDomain = $("#alDomain");
alDomain.html(domain);
var alSuccess = $("#alSuccess");
var alFailure = $("#alFailure");
if(list === "white")
{
alList.html("Whitelist");
}
else
{
alList.html("Blacklist");
}
alInfo.show();
alSuccess.hide();
alFailure.hide();
$.ajax({
url: "scripts/pi-hole/php/add.php",
method: "post",
data: {"domain":domain, "list":list, "token":token},
success: function(response) {
if (response.indexOf("not a valid argument") >= 0 || response.indexOf("is not a valid domain") >= 0)
{
alFailure.show();
alFailure.delay(1000).fadeOut(2000, function() { alFailure.hide(); });
}
else
{
alSuccess.show();
alSuccess.delay(1000).fadeOut(2000, function() { alSuccess.hide(); });
}
alInfo.delay(1000).fadeOut(2000, function() {
alInfo.hide();
alList.html("");
alDomain.html("");
});
},
error: function(jqXHR, exception) {
alFailure.show();
alFailure.delay(1000).fadeOut(2000, function() {
alFailure.hide();
});
alInfo.delay(1000).fadeOut(2000, function() {
alInfo.hide();
alList.html("");
alDomain.html("");
});
}
});
}
$(document).ready(function() {
tableApi = $('#all-queries').DataTable( {
tableApi = $("#all-queries").DataTable( {
"rowCallback": function( row, data, index ){
if (data[4] == "Pi-holed") {
$(row).css('color','red');
$('td:eq(5)', row).html( '<button style="color:green;"><i class="fa fa-pencil-square-o"></i> Whitelist</button>' );
if (data[4] === "Pi-holed") {
$(row).css("color","red");
$("td:eq(5)", row).html( "<button style=\"color:green;\"><i class=\"fa fa-pencil-square-o\"></i> Whitelist</button>" );
}
else{
$(row).css('color','green');
$('td:eq(5)', row).html( '<button style="color:red;"><i class="fa fa-ban"></i> Blacklist</button>' );
$(row).css("color","green");
$("td:eq(5)", row).html( "<button style=\"color:red;\"><i class=\"fa fa-ban\"></i> Blacklist</button>" );
}
},
@@ -41,12 +102,12 @@ $(document).ready(function() {
"columnDefs": [ {
"targets": -1,
"data": null,
"defaultContent": ''
"defaultContent": ""
} ]
});
$('#all-queries tbody').on( 'click', 'button', function () {
var data = tableApi.row( $(this).parents('tr') ).data();
if (data[4] == "Pi-holed")
$("#all-queries tbody").on( "click", "button", function () {
var data = tableApi.row( $(this).parents("tr") ).data();
if (data[4] === "Pi-holed")
{
add(data[2],"white");
}
@@ -74,63 +135,4 @@ $(document).ready(function() {
}
} );
function refreshData() {
tableApi.ajax.url("api.php?getAllQueries").load();
// updateSessionTimer();
}
function add(domain,list) {
var token = $("#token").html();
var alInfo = $("#alInfo");
var alList = $("#alList");
var alDomain = $("#alDomain");
alDomain.html(domain);
var alSuccess = $("#alSuccess");
var alFailure = $("#alFailure");
if(list == "white")
{
alList.html("Whitelist");
}
else
{
alList.html("Blacklist");
}
alInfo.show();
alSuccess.hide();
alFailure.hide();
$.ajax({
url: "php/add.php",
method: "post",
data: {"domain":domain, "list":list, "token":token},
success: function(response) {
if (response.indexOf("not a valid argument") >= 0 || response.indexOf("is not a valid domain") >= 0)
{
alFailure.show();
alFailure.delay(1000).fadeOut(2000, function() { alFailure.hide(); });
}
else
{
alSuccess.show();
alSuccess.delay(1000).fadeOut(2000, function() { alSuccess.hide(); });
}
alInfo.delay(1000).fadeOut(2000, function() {
alInfo.hide();
alList.html("");
alDomain.html("");
});
},
error: function(jqXHR, exception) {
alFailure.show();
alFailure.delay(1000).fadeOut(2000, function() {
alFailure.hide();
});
alInfo.delay(1000).fadeOut(2000, function() {
alInfo.hide();
alList.html("");
alDomain.html("");
});
}
});
}
@@ -16,7 +16,7 @@ function eventsource() {
}
var host = window.location.host;
var source = new EventSource("http://"+host+"/admin/php/queryads.php?domain="+domain.val()+"&"+exact);
var source = new EventSource("http://"+host+"/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val()+"&"+exact);
// Reset and show field
ta.empty();
@@ -18,6 +18,7 @@ function check_cors() {
// Check CORS
$AUTHORIZED_HOSTNAMES = array(
'http://' . $_SERVER['SERVER_ADDR'],
'http://' . $_SERVER['SERVER_NAME'],
'http://pi.hole',
'http://localhost'
);
+41 -11
View File
@@ -1,9 +1,12 @@
<?php
$log = array();
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
$hosts = file_exists("/etc/hosts") ? file("/etc/hosts") : array();
$log = new \SplFileObject('/var/log/pihole.log');
$gravity = new \SplFileObject('/etc/pihole/list.preEventHorizon');
$whitelist = new \SplFileObject('/etc/pihole/whitelist.txt');
$blacklist = new \SplFileObject('/etc/pihole/blacklist.txt');
/******* Public Members ********/
function getSummaryData() {
@@ -210,7 +213,7 @@
$showBlocked = true;
$showPermitted = false;
}
elseif($setupVars["API_QUERY_LOG_SHOW"] === "none")
elseif($setupVars["API_QUERY_LOG_SHOW"] === "nothing")
{
$showBlocked = false;
$showPermitted = false;
@@ -230,10 +233,12 @@
}
function getAllQueries($orderBy) {
global $log,$gravity,$showBlocked,$showPermitted;
global $log,$showBlocked,$showPermitted;
$allQueries = array("data" => array());
$dns_queries = getDnsQueriesAll($log);
$gravity_domains = getGravityDomains($gravity);
// Create empty array for gravity
$gravity_domains = getGravity();
foreach ($dns_queries as $query) {
$time = date_create(substr($query, 0, 16));
@@ -312,16 +317,41 @@
return $lines;
}
function getGravityDomains($gravity){
$gravity->rewind();
$lines=[];
foreach ($gravity as $line) {
// Strip newline (and possibly carriage return) from end of string
// using rtrim()
$lines[rtrim($line)] = true;
function getDomains($file, &$array, $action){
$file->rewind();
foreach ($file as $line) {
// Strip newline (and possibly carriage return) from end of key
$key = rtrim($line);
// if $action = true -> we want that domain to be ADDED to the list
// doesn't harm to do this if it has already been set before
// (e.g. once in gravity list, once in blacklist)
if($action && strlen($key) > 0)
{
// $action is true (we want to add) *and* key is not empty
$array[$key] = true;
}
elseif(!$action && isset($array[$key]))
{
// $action is false (we want to remove) *and* key is set
unset($array[$key]);
}
}
}
return $lines;
function getGravity() {
global $gravity,$whitelist,$blacklist;
$domains = [];
// ADD (true) preEventHorizon domains
getDomains($gravity, $domains, true);
// ADD (true) blacklist domains
getDomains($blacklist, $domains, true);
// REMOVE (false) whitelist domains
getDomains($whitelist, $domains, false);
return $domains;
}
function getBlockedQueries(\SplFileObject $log) {
+10 -10
View File
@@ -3,7 +3,6 @@
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<div class="pull-right hidden-xs">
<?php
// Check if on a dev branch
$piholeBranch = exec("cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD");
@@ -26,23 +25,24 @@
$webVersion = exec("git describe --tags --abbrev=0");
}
?>
<div class="pull-right hidden-xs <?php if(isset($piholeCommit) || isset($webCommit)) { ?>hidden-md<?php } ?>">
<b>Pi-hole Version </b> <span id="piholeVersion"><?php echo $piholeVersion; ?></span><?php if(isset($piholeCommit)) { echo " (".$piholeBranch.", ".$piholeCommit.")"; } ?>
<b>Web Interface Version </b> <span id="webVersion"><?php echo $webVersion; ?></span><?php if(isset($webCommit)) { echo " (".$webBranch.", ".$webCommit.")"; } ?>
</div>
<i class="fa fa-github"></i> <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=3J2L3Z4DHW9UY">Donate</a></strong> if you found this useful.
<div><i class="fa fa-github"></i> <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=3J2L3Z4DHW9UY">Donate</a></strong> if you found this useful.</div>
</footer>
</div>
<!-- ./wrapper -->
<script src="js/other/jquery.min.js"></script>
<script src="js/other/jquery-ui.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="js/other/app.min.js"></script>
<script src="scripts/vendor/jquery.min.js"></script>
<script src="scripts/vendor/jquery-ui.min.js"></script>
<script src="style/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="scripts/vendor/app.min.js"></script>
<script src="js/other/jquery.dataTables.min.js"></script>
<script src="js/other/dataTables.bootstrap.min.js"></script>
<script src="js/other/Chart.bundle.min.js"></script>
<script src="scripts/vendor/jquery.dataTables.min.js"></script>
<script src="scripts/vendor/dataTables.bootstrap.min.js"></script>
<script src="scripts/vendor/Chart.bundle.min.js"></script>
<script src="js/pihole/footer.js"></script>
<script src="scripts/pi-hole/js/footer.js"></script>
</body>
</html>
+7 -7
View File
@@ -16,16 +16,16 @@ for($i = sizeof($list)-1; $i >= 0; $i--) {
unset($list[$i]);
}
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;
}
// Protect against XSS attacks
+106 -53
View File
@@ -1,21 +1,49 @@
<?php
require "php/auth.php";
require "php/password.php";
require "scripts/pi-hole/php/auth.php";
require "scripts/pi-hole/php/password.php";
check_cors();
$cmd = "echo $((`cat /sys/class/thermal/thermal_zone0/temp | cut -c1-2`))";
$output = shell_exec($cmd);
$celsius = str_replace(array("\r\n","\r","\n"),"", $output);
$fahrenheit = round(str_replace(["\r\n","\r","\n"],"", $output*9./5)+32);
if(isset($setupVars['TEMPERATUREUNIT']))
// Try to get temperature value from different places (OS dependent)
if(file_exists("/sys/class/thermal/thermal_zone0/temp"))
{
$temperatureunit = $setupVars['TEMPERATUREUNIT'];
$output = rtrim(file_get_contents("/sys/class/thermal/thermal_zone0/temp"));
}
elseif (file_exists("/sys/class/hwmon/hwmon0/temp1_input"))
{
$output = rtrim(file_get_contents("/sys/class/hwmon/hwmon0/temp1_input"));
}
else
{
$temperatureunit = "C";
$output = "";
}
// Test if we succeeded in getting the temperature
if(is_numeric($output))
{
$celsius = intVal($output)*1e-3;
$kelvin = $celsius + 273.15;
$fahrenheit = ($celsius*9./5)+32.0;
if(isset($setupVars['TEMPERATUREUNIT']))
{
$temperatureunit = $setupVars['TEMPERATUREUNIT'];
}
else
{
$temperatureunit = "C";
}
// Override temperature unit setting if it is changed via Settings page
if(isset($_POST["tempunit"]))
{
$temperatureunit = $_POST["tempunit"];
}
}
else
{
// Nothing can be colder than -273.15 degree Celsius (= 0 Kelvin)
// This is the minimum temperature possible (AKA absolute zero)
$celsius = -273.16;
}
// Get load
@@ -25,15 +53,27 @@
$nproc = shell_exec('nproc');
// Get memory usage
$free = shell_exec('free');
$free = (string)trim($free);
$free_arr = explode("\n", $free);
$mem = explode(" ", $free_arr[1]);
$mem = array_filter($mem);
$mem = array_merge($mem);
$used = $mem[2] - $mem[5] - $mem[6];
$total = $mem[1];
$memory_usage = $used/$total*100;
$data = explode("\n", file_get_contents("/proc/meminfo"));
$meminfo = array();
if(count($data) > 0)
{
foreach ($data as $line) {
$expl = explode(":", trim($line));
if(count($expl) == 2)
{
// remove " kB" from the end of the string and make it an integer
$meminfo[$expl[0]] = intVal(substr($expl[1],0, -3));
}
}
$memory_used = $meminfo["MemTotal"]-$meminfo["MemFree"]-$meminfo["Buffers"]-$meminfo["Cached"];
$memory_total = $meminfo["MemTotal"];
$memory_usage = $memory_used/$memory_total;
}
else
{
$memory_usage = -1;
}
// For session timer
$maxlifetime = ini_get("session.gc_maxlifetime");
@@ -60,7 +100,7 @@
$boxedlayout = true;
}
// Override layout setting if layout is changed via Settings page3
// Override layout setting if layout is changed via Settings page
if(isset($_POST["field"]))
{
if($_POST["field"] === "webUI" && isset($_POST["boxedlayout"]))
@@ -80,6 +120,8 @@
<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'">
<title>Pi-hole Admin Console</title>
<!-- Usually browsers proactively perform domain name resolution on links that the user may choose to follow. We disable DNS prefetching here -->
<meta http-equiv="x-dns-prefetch-control" content="off">
<!-- 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">
<link rel="shortcut icon" href="img/favicon.png" type="image/x-icon" />
@@ -91,13 +133,13 @@
<meta name="msapplication-TileImage" content="img/logo.svg">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="css/font-awesome-4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="css/ionicons-2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
<link href="css/dataTables.bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="style/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="style/vendor/font-awesome-4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="style/vendor/ionicons-2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
<link href="style/vendor/dataTables.bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
<link href="css/skin-blue.min.css" rel="stylesheet" type="text/css" />
<link href="style/vendor/AdminLTE.min.css" rel="stylesheet" type="text/css" />
<link href="style/vendor/skin-blue.min.css" rel="stylesheet" type="text/css" />
<link rel="icon" type="image/png" sizes="160x160" href="img/logo.svg" />
<style type="text/css">
.glow { text-shadow: 0px 0px 5px #fff; }
@@ -105,20 +147,20 @@
</style>
<!--[if lt IE 9]>
<script src="js/other/html5shiv.min.js"></script>
<script src="js/other/respond.min.js"></script>
<script src="scripts/vendor/html5shiv.min.js"></script>
<script src="scripts/vendor/respond.min.js"></script>
<![endif]-->
</head>
<body class="skin-blue sidebar-mini <?php if($boxedlayout){ ?>layout-boxed<?php } ?>">
<!-- JS Warning -->
<div>
<link rel="stylesheet" type="text/css" href="css/js-warn.css">
<link rel="stylesheet" type="text/css" href="style/vendor/js-warn.css">
<input type="checkbox" id="js-hide" />
<div class="js-warn" id="js-warn-exit"><h1>Javascript Is Disabled</h1><p>Javascript seems to be disabled. This will break some site features.</p>
<p>To enable Javascript click <a href="http://www.enable-javascript.com/" target="_blank">here</a></p><label for="js-hide">Close</label></div>
</div>
<!-- /JS Warning -->
<script src="js/pihole/header.js"></script>
<script src="scripts/pi-hole/js/header.js"></script>
<!-- Send token to JS -->
<div id="token" hidden><?php echo $token ?></div>
<div class="wrapper">
@@ -213,20 +255,30 @@
}
// CPU Temp
echo '<a href="#" id="temperature"><i class="fa fa-fire" style="color:';
if ($celsius > "45") {
echo '#FF0000';
if ($celsius >= -273.15) {
echo "<a href=\"#\" id=\"temperature\"><i class=\"fa fa-fire\" style=\"color:";
if ($celsius > 45) {
echo "#FF0000";
}
else
{
echo "#3366FF";
}
echo "\"></i> Temp:&nbsp;";
if($temperatureunit === "F")
{
echo round($fahrenheit,1) . "&deg;F";
}
elseif($temperatureunit === "K")
{
echo round($kelvin,1) . "K";
}
else
{
echo round($celsius,1) . "&deg;C";
}
echo "</a>";
}
else
{
echo '#3366FF';
}
echo '"></i> Temp:&nbsp;';
if($temperatureunit != "F")
echo $celsius . '&deg;C';
else
echo $fahrenheit . '&deg;F';
echo '</a>';
?>
<br/>
<?php
@@ -243,14 +295,21 @@
<br/>
<?php
echo '<a href="#"><i class="fa fa-circle" style="color:';
if ($memory_usage > 75) {
if ($memory_usage > 0.75 || $memory_usage < 0.0) {
echo '#FF0000';
}
else
{
echo '#7FFF00';
}
echo '""></i> Memory usage:&nbsp;&nbsp;' . sprintf("%.1f",$memory_usage) . '%</a>';
if($memory_usage > 0.0)
{
echo '""></i> Memory usage:&nbsp;&nbsp;' . sprintf("%.1f",100.0*$memory_usage) . '%</a>';
}
else
{
echo '""></i> Memory usage:&nbsp;&nbsp; N/A</a>';
}
?>
</div>
</div>
@@ -361,14 +420,8 @@
//
// If auth is required and not set, i.e. no successfully logged in,
// we show the reduced version of the summary (index) page
if(!$auth && (!isset($indexpage) || isset($_GET['login']))){ ?>
<div class="page-header">
<h1>Login required!</h1>
</div>
<form action="" method="POST">
Password: <input type="password" name="pw">&nbsp;<input type="submit" value="Login">
</form>
<?php
if(!$auth && (!isset($indexpage) || isset($_GET['login']))){
require "scripts/pi-hole/php/loginpage.php";
require "footer.php";
exit();
}
+54
View File
@@ -0,0 +1,54 @@
<div class="mainbox col-md-6 col-md-offset-3 col-sm-6 col-sm-offset-3">
<div class="panel panel-default">
<div class="panel-heading">
<div style="text-align: center;"><img src="img/logo.svg" width="<?php if ($boxedlayout) { ?>50%<?php } else { ?>30%<?php } ?>"></div><br>
<div class="panel-title text-center"><span class="logo-lg" style="font-size: 25px;"><b>Pi</b>-hole</span></div>
<p class="login-box-msg">Sign in to start your session</p>
<?php if ($wrongpassword) { ?>
<div class="form-group has-error login-box-msg">
<label class="control-label"><i class="fa fa-times-circle-o"></i> Wrong password!</label>
</div>
<?php } ?>
</div>
<div class="panel-body">
<form action="" method="post">
<div class="form-group has-feedback <?php if ($wrongpassword) { ?>has-error<?php } ?> ">
<input type="password" name="pw" class="form-control" placeholder="Password">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-4 col-xs-offset-8">
<button type="submit" href="#" class="btn btn-primary pull-right"><i class="glyphicon glyphicon-log-in"></i>&nbsp;&nbsp;&nbsp;Log in</button>
</div>
</div>
<br>
<div class="row">
<div class="col-xs-12">
<div class="box box-<?php if (!$wrongpassword) { ?>info<?php } else { ?>danger<?php }
if (!$wrongpassword) { ?> collapsed-box<?php } ?> box-solid">
<div class="box-header with-border">
<h3 class="box-title">Forgot password</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i
class="fa <?php if ($wrongpassword) { ?>fa-minus<?php } else { ?>fa-plus<?php } ?>"></i>
</button>
</div>
</div>
<div class="box-body">
After installing Pi-Hole for the first time, a password is generated and displayed to the user. The
password cannot be retrived later on, but it is possible to set a new password (or explicitly disable
the
password by setting an empty password) using the command
<pre>sudo pihole -a -p newpassword</pre>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@@ -20,6 +20,8 @@
session_unset();
}
$wrongpassword = false;
// Test if password is set
if(strlen($pwhash) > 0)
{
@@ -32,6 +34,10 @@
$_SESSION["hash"] = $pwhash;
$auth = true;
}
else
{
$wrongpassword = true;
}
}
// Compare auth hash with saved hash
else if (isset($_SESSION["hash"]))
@@ -48,10 +48,11 @@ function validDomain($domain_name)
"8.20.247.20" => "Comodo"
];
$error = "";
$success = "";
if(isset($_POST["field"]))
{
$error = "";
$success = "";
// Process request
switch ($_POST["field"]) {
// Set DNS server
@@ -78,7 +79,14 @@ function validDomain($domain_name)
// Get secondary DNS server IP address
if($secondaryDNS === "Custom")
{
$secondaryIP = $_POST["DNS2IP"];
if(strlen($_POST["DNS2IP"]) > 0)
{
$secondaryIP = $_POST["DNS2IP"];
}
else
{
$secondaryIP = "none";
}
}
else
{
@@ -86,7 +94,7 @@ function validDomain($domain_name)
}
// Validate secondary IP
if (!validIP($secondaryIP) && strlen($secondaryIP) > 0)
if (!validIP($secondaryIP) && $secondaryIP != "none" && strlen($secondaryIP) > 0)
{
$error .= "Secondary IP (".$secondaryIP.") is invalid!<br>";
}
@@ -218,7 +226,7 @@ function validDomain($domain_name)
}
else
{
exec("sudo pihole -a setquerylog none");
exec("sudo pihole -a setquerylog nothing");
$success .= "No entries will be shown in Query Log";
}
@@ -246,12 +254,14 @@ function validDomain($domain_name)
if($_POST["tempunit"] == "F")
{
exec('sudo pihole -a -f');
$success .= "The webUI settings have been updated";
}
elseif($_POST["tempunit"] == "K")
{
exec('sudo pihole -a -k');
}
else
{
exec('sudo pihole -a -c');
$success .= "The webUI settings have been updated";
}
if(isset($_POST["boxedlayout"]))
{
@@ -261,6 +271,7 @@ function validDomain($domain_name)
{
exec('sudo pihole -a layout traditional');
}
$success .= "The webUI settings have been updated";
break;
case "reboot":
View File
+10 -9
View File
@@ -1,6 +1,6 @@
<?php
require "header.php";
require "php/savesettings.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");
?>
@@ -140,7 +140,7 @@
<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>
<label>Router IP address</label>
<label>Router (gateway) IP address</label>
<div class="col-md-12">
<div class="input-group">
<div class="input-group-addon">Router</div>
@@ -329,7 +329,7 @@
?>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Query Logging (size of log <?php echo formatSizeUnits(filesize("/var/log/pihole.log")); ?>)</h3>
<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:
@@ -489,6 +489,7 @@
<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>
@@ -538,10 +539,10 @@
</div>
<?php
require "footer.php";
require "scripts/pi-hole/php/footer.php";
?>
<script src="js/other/jquery.inputmask.js"></script>
<script src="js/other/jquery.inputmask.extensions.js"></script>
<script src="js/other/jquery.confirm.min.js"></script>
<script src="js/pihole/settings.js"></script>
<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>
+7
View File
File diff suppressed because one or more lines are too long
@@ -1,92 +1,92 @@
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 357 KiB

After

Width:  |  Height:  |  Size: 357 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 326 KiB

View File