Merge ../../BizApps/BusinessAppTemplate
This commit is contained in:
commit
0d67ae85ad
14
app.php
14
app.php
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
@ -14,7 +13,7 @@ if ($_SESSION['loggedin'] != true) {
|
|||||||
require_once __DIR__ . "/pages.php";
|
require_once __DIR__ . "/pages.php";
|
||||||
|
|
||||||
$pageid = "home";
|
$pageid = "home";
|
||||||
if (isset($_GET['page']) && !is_empty($_GET['page'])) {
|
if (!empty($_GET['page'])) {
|
||||||
$pg = strtolower($_GET['page']);
|
$pg = strtolower($_GET['page']);
|
||||||
$pg = preg_replace('/[^0-9a-z_]/', "", $pg);
|
$pg = preg_replace('/[^0-9a-z_]/', "", $pg);
|
||||||
if (array_key_exists($pg, PAGES) && file_exists(__DIR__ . "/pages/" . $pg . ".php")) {
|
if (array_key_exists($pg, PAGES) && file_exists(__DIR__ . "/pages/" . $pg . ".php")) {
|
||||||
@ -66,9 +65,10 @@ header("Link: <static/js/bootstrap.bundle.min.js>; rel=preload; as=script", fals
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Alert messages
|
// Alert messages
|
||||||
if (isset($_GET['msg']) && !is_empty($_GET['msg']) && array_key_exists($_GET['msg'], MESSAGES)) {
|
if (!empty($_GET['msg'])) {
|
||||||
|
if (array_key_exists($_GET['msg'], MESSAGES)) {
|
||||||
// optional string generation argument
|
// optional string generation argument
|
||||||
if (!isset($_GET['arg']) || is_empty($_GET['arg'])) {
|
if (empty($_GET['arg'])) {
|
||||||
$alertmsg = $Strings->get(MESSAGES[$_GET['msg']]['string'], false);
|
$alertmsg = $Strings->get(MESSAGES[$_GET['msg']]['string'], false);
|
||||||
} else {
|
} else {
|
||||||
$alertmsg = $Strings->build(MESSAGES[$_GET['msg']]['string'], ["arg" => strip_tags($_GET['arg'])], false);
|
$alertmsg = $Strings->build(MESSAGES[$_GET['msg']]['string'], ["arg" => strip_tags($_GET['arg'])], false);
|
||||||
@ -89,6 +89,12 @@ header("Link: <static/js/bootstrap.bundle.min.js>; rel=preload; as=script", fals
|
|||||||
$alerticon = "check";
|
$alerticon = "check";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// We don't have a message for this, so just assume an error and escape stuff.
|
||||||
|
$alertmsg = htmlentities($Strings->get($_GET['msg'], false));
|
||||||
|
$alerticon = "times";
|
||||||
|
$alerttype = "danger";
|
||||||
|
}
|
||||||
echo <<<END
|
echo <<<END
|
||||||
<div class="row justify-content-center" id="msg-alert-box">
|
<div class="row justify-content-center" id="msg-alert-box">
|
||||||
<div class="col-11 col-sm-6 col-md-5 col-lg-4 col-xl-4">
|
<div class="col-11 col-sm-6 col-md-5 col-lg-4 col-xl-4">
|
||||||
|
@ -47,7 +47,7 @@ if (Login::checkLoginServer()) {
|
|||||||
$username_ok = true;
|
$username_ok = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!is_empty($error)) {
|
if (!empty($error)) {
|
||||||
$alert = $error;
|
$alert = $error;
|
||||||
} else {
|
} else {
|
||||||
$alert = $Strings->get("login error", false);
|
$alert = $Strings->get("login error", false);
|
||||||
|
@ -21,6 +21,10 @@ class Strings {
|
|||||||
|
|
||||||
$this->load("en");
|
$this->load("en");
|
||||||
|
|
||||||
|
if ($language == "en") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (file_exists(__DIR__ . "/../langs/$language/")) {
|
if (file_exists(__DIR__ . "/../langs/$language/")) {
|
||||||
$this->language = $language;
|
$this->language = $language;
|
||||||
$this->load($language);
|
$this->load($language);
|
||||||
|
@ -75,7 +75,7 @@ if (mobile_enabled() !== TRUE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we have a username and access key
|
// Make sure we have a username and access key
|
||||||
if (is_empty($VARS['username']) || is_empty($VARS['key'])) {
|
if (empty($VARS['username']) || empty($VARS['key'])) {
|
||||||
http_response_code(401);
|
http_response_code(401);
|
||||||
die(json_encode(["status" => "ERROR", "msg" => "Missing username and/or access key."]));
|
die(json_encode(["status" => "ERROR", "msg" => "Missing username and/or access key."]));
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
* Checks if a string or whatever is empty.
|
* Checks if a string or whatever is empty.
|
||||||
* @param $str The thingy to check
|
* @param $str The thingy to check
|
||||||
* @return boolean True if it's empty or whatever.
|
* @return boolean True if it's empty or whatever.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user