Permission syntax fix, adding regex replacements for routing, color fix

This commit is contained in:
Roman Hergenreder 2020-07-13 17:57:03 +02:00
parent 7fa02a1f39
commit 35637ddc37
5 changed files with 23 additions and 9 deletions

@ -1,6 +1,6 @@
<?php <?php
define("WEBBASE_VERSION", "1.0.0"); define("WEBBASE_VERSION", "1.0.1");
function getProtocol() { function getProtocol() {
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http"; return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http";

@ -111,6 +111,20 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) {
$response = (new Document404($user))->getCode(); $response = (new Document404($user))->getCode();
} else { } else {
$target = trim(explode("\n", $route["target"])[0]); $target = trim(explode("\n", $route["target"])[0]);
$pattern = str_replace("/","\\/", $route["request"]);
$pattern = "/$pattern/";
if (!startsWith($requestedUri, '/')) {
$requestedUri = "/$requestedUri";
}
@preg_match("$pattern", $requestedUri, $match);
if (is_array($match) && !empty($match)) {
foreach($match as $index => $value) {
$target = str_replace("$$index", $value, $target);
}
}
switch ($route["action"]) { switch ($route["action"]) {
case "redirect_temporary": case "redirect_temporary":
http_response_code(307); http_response_code(307);

2
js/admin.min.js vendored

File diff suppressed because one or more lines are too long

@ -5,7 +5,7 @@ export default function Footer() {
return ( return (
<footer className={"main-footer"}> <footer className={"main-footer"}>
Theme: <strong>Copyright © 2014-2019 <a href={"http://adminlte.io"}>AdminLTE.io</a>. <b>Version</b> 3.0.3</strong>&nbsp; Theme: <strong>Copyright © 2014-2019 <a href={"http://adminlte.io"}>AdminLTE.io</a>. <b>Version</b> 3.0.3</strong>&nbsp;
CMS: <strong><a href={"http://git.romanh.de/Projekte/webbase.io"}>WebBase</a></strong>. <b>Version</b> 1.0.0 CMS: <strong><a href={"https://git.romanh.de/Projekte/web-base"}>WebBase</a></strong>. <b>Version</b> 1.0.1
</footer> </footer>
) )
} }

@ -56,13 +56,13 @@ export default class Overview extends React.Component {
render() { render() {
const colors = [
'#ff4444', '#ffbb33', '#00C851', '#33b5e5',
'#ff4444', '#ffbb33', '#00C851', '#33b5e5',
'#ff4444', '#ffbb33', '#00C851', '#33b5e5'
];
const numDays = moment().daysInMonth(); const numDays = moment().daysInMonth();
let colors = [ '#ff4444', '#ffbb33', '#00C851', '#33b5e5' ];
while (colors.length < numDays) {
colors = colors.concat(colors);
}
let data = new Array(numDays).fill(0); let data = new Array(numDays).fill(0);
let visitorCount = 0; let visitorCount = 0;
for (let date in this.state.visitors) { for (let date in this.state.visitors) {