webui: Allow billing to use un-auth graphs (#5449)

This commit is contained in:
Neil Lathwood
2017-01-19 22:56:56 +00:00
committed by GitHub
parent 01e4ac3d58
commit 5ffb320997
2 changed files with 8 additions and 4 deletions

View File

@@ -34,8 +34,10 @@ if (strpos($_SERVER['REQUEST_URI'], 'debug')) {
$init_modules = array('web', 'auth');
require realpath(__DIR__ . '/..') . '/includes/init.php';
$auth = is_client_authorized($_SERVER['REMOTE_ADDR']);
if (get_client_ip() != $_SERVER['SERVER_ADDR']) {
if (!$_SESSION['authenticated']) {
if ($auth === false && !$_SESSION['authenticated']) {
echo 'unauthenticated';
exit;
}
@@ -43,7 +45,7 @@ if (get_client_ip() != $_SERVER['SERVER_ADDR']) {
if (is_numeric($_GET['bill_id'])) {
if (get_client_ip() != $_SERVER['SERVER_ADDR']) {
if (bill_permitted($_GET['bill_id'])) {
if ($auth === true || bill_permitted($_GET['bill_id'])) {
$bill_id = $_GET['bill_id'];
} else {
echo 'Unauthorised Access Prohibited.';

View File

@@ -31,8 +31,10 @@ if (strpos($_SERVER['REQUEST_URI'], 'debug')) {
$init_modules = array('web', 'auth');
require realpath(__DIR__ . '/..') . '/includes/init.php';
$auth = is_client_authorized($_SERVER['REMOTE_ADDR']);
if (get_client_ip() != $_SERVER['SERVER_ADDR']) {
if (!$_SESSION['authenticated']) {
if ($auth === false && !$_SESSION['authenticated']) {
echo 'unauthenticated';
exit;
}
@@ -40,7 +42,7 @@ if (get_client_ip() != $_SERVER['SERVER_ADDR']) {
if (is_numeric($_GET['bill_id'])) {
if (get_client_ip() != $_SERVER['SERVER_ADDR']) {
if (bill_permitted($_GET['bill_id'])) {
if ($auth === true || bill_permitted($_GET['bill_id'])) {
$bill_id = $_GET['bill_id'];
} else {
echo 'Unauthorised Access Prohibited.';