mirror of
https://github.com/transatoshi-mw/grin-web-wallet.git
synced 2025-10-07 00:02:47 +00:00
contents of zip
This commit is contained in:
36
errors/401.html
Executable file
36
errors/401.html
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Get path
|
||||
$path = $_SERVER["REQUEST_URI"];
|
||||
|
||||
// Check if accessing 401 error page directly
|
||||
if($path === "/errors/401.html" || startsWith($path, "/errors/401.html?") === TRUE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
|
||||
// Set error header
|
||||
header($_SERVER["SERVER_PROTOCOL"] . " 401 Unauthorized");
|
||||
header("Status: 401 Unauthorized");
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Error %1$s');
|
||||
$titleArgument = 401;
|
||||
$error = getDefaultTranslation('Error %1$s');
|
||||
$errorArgument = 401;
|
||||
$message = getDefaultTranslation('Unauthorized');
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
36
errors/403.html
Executable file
36
errors/403.html
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Get path
|
||||
$path = $_SERVER["REQUEST_URI"];
|
||||
|
||||
// Check if accessing 403 error page directly
|
||||
if($path === "/errors/403.html" || startsWith($path, "/errors/403.html?") === TRUE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
|
||||
// Set error header
|
||||
header($_SERVER["SERVER_PROTOCOL"] . " 403 Forbidden");
|
||||
header("Status: 403 Forbidden");
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Error %1$s');
|
||||
$titleArgument = 403;
|
||||
$error = getDefaultTranslation('Error %1$s');
|
||||
$errorArgument = 403;
|
||||
$message = getDefaultTranslation('Forbidden');
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
23
errors/404.html
Executable file
23
errors/404.html
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Set error header
|
||||
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
|
||||
header("Status: 404 Not Found");
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Error %1$s');
|
||||
$titleArgument = 404;
|
||||
$error = getDefaultTranslation('Error %1$s');
|
||||
$errorArgument = 404;
|
||||
$message = getDefaultTranslation('Not Found');
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
36
errors/500.html
Executable file
36
errors/500.html
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Get path
|
||||
$path = $_SERVER["REQUEST_URI"];
|
||||
|
||||
// Check if accessing 500 error page directly
|
||||
if($path === "/errors/500.html" || startsWith($path, "/errors/500.html?") === TRUE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
|
||||
// Set error header
|
||||
header($_SERVER["SERVER_PROTOCOL"] . " 500 Internal Server Error");
|
||||
header("Status: 500 Internal Server Error");
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Error %1$s');
|
||||
$titleArgument = 500;
|
||||
$error = getDefaultTranslation('Error %1$s');
|
||||
$errorArgument = 500;
|
||||
$message = getDefaultTranslation('Internal Server Error');
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
36
errors/502.html
Executable file
36
errors/502.html
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Get path
|
||||
$path = $_SERVER["REQUEST_URI"];
|
||||
|
||||
// Check if accessing 502 error page directly
|
||||
if($path === "/errors/502.html" || startsWith($path, "/errors/502.html?") === TRUE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
|
||||
// Set error header
|
||||
header($_SERVER["SERVER_PROTOCOL"] . " 502 Bad Gateway");
|
||||
header("Status: 502 Bad Gateway");
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Error %1$s');
|
||||
$titleArgument = 502;
|
||||
$error = getDefaultTranslation('Error %1$s');
|
||||
$errorArgument = 502;
|
||||
$message = getDefaultTranslation('Bad Gateway');
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
90
errors/503.html
Executable file
90
errors/503.html
Executable file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Constants
|
||||
|
||||
// Retry after seconds
|
||||
const RETRY_AFTER_SECONDS = 10 * SECONDS_IN_A_MINUTE;
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Get path
|
||||
$path = $_SERVER["REQUEST_URI"];
|
||||
|
||||
// Check if referrer does exists
|
||||
if(array_key_exists("HTTP_REFERER", $_SERVER) === TRUE && is_string($_SERVER["HTTP_REFERER"]) === TRUE) {
|
||||
|
||||
// Parse referrer as a URL
|
||||
$url = parse_url($_SERVER["HTTP_REFERER"]);
|
||||
|
||||
// Check if referrer is invalid or from a different origin
|
||||
if($url === FALSE || array_key_exists("host", $url) === FALSE || $url["host"] !== $_SERVER["SERVER_NAME"]) {
|
||||
|
||||
// Check if accessing 503 error page directly
|
||||
if($path === "/errors/503.html" || startsWith($path, "/errors/503.html?") === TRUE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise
|
||||
else {
|
||||
|
||||
// Set hide URL
|
||||
$hideUrl = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise
|
||||
else {
|
||||
|
||||
// Check if accessing 503 error page directly
|
||||
if($path === "/errors/503.html" || startsWith($path, "/errors/503.html?") === TRUE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
// Check if referrer is the service worker
|
||||
if(array_key_exists("HTTP_REFERER", $_SERVER) === TRUE && $_SERVER["HTTP_REFERER"] === "http" . ((array_key_exists("HTTPS", $_SERVER) === TRUE && $_SERVER["HTTPS"] === "on") ? "s" : "") . "://" . $_SERVER["SERVER_NAME"] . "/scripts/service_worker.js") {
|
||||
|
||||
// Set referrer to the initial page
|
||||
$_SERVER["HTTP_REFERER"] = "http" . ((array_key_exists("HTTPS", $_SERVER) === TRUE && $_SERVER["HTTPS"] === "on") ? "s" : "") . "://" . $_SERVER["SERVER_NAME"] . "/";
|
||||
}
|
||||
|
||||
// Set error header
|
||||
header($_SERVER["SERVER_PROTOCOL"] . " 503 Service Temporarily Unavailable");
|
||||
header("Status: 503 Service Temporarily Unavailable");
|
||||
|
||||
// Set retry after header
|
||||
header("Retry-After: " . gmdate("D, d M Y H:i:s T", time() + RETRY_AFTER_SECONDS));
|
||||
|
||||
// Set refresh header
|
||||
header("Refresh: " . sprintf("%.0F", RETRY_AFTER_SECONDS) . "; URL=" . ((isset($hideUrl) === TRUE) ? $_SERVER["HTTP_REFERER"] : ("http" . ((array_key_exists("HTTPS", $_SERVER) === TRUE && $_SERVER["HTTPS"] === "on") ? "s" : "") . "://" . rawurlencode($_SERVER["SERVER_NAME"]) . $_SERVER["REQUEST_URI"])));
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Maintenance');
|
||||
$titleArgument = "";
|
||||
$error = getDefaultTranslation('Maintenance');
|
||||
$errorArgument = "";
|
||||
$message = getDefaultTranslation('This site is currently down for maintenance.');
|
||||
|
||||
// Set is maintenance error
|
||||
$isMaintenanceError = TRUE;
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
36
errors/504.html
Executable file
36
errors/504.html
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Get path
|
||||
$path = $_SERVER["REQUEST_URI"];
|
||||
|
||||
// Check if accessing 504 error page directly
|
||||
if($path === "/errors/504.html" || startsWith($path, "/errors/504.html?") === TRUE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
|
||||
// Set error header
|
||||
header($_SERVER["SERVER_PROTOCOL"] . " 504 Gateway Timeout");
|
||||
header("Status: 504 Gateway Timeout");
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Error %1$s');
|
||||
$titleArgument = 504;
|
||||
$error = getDefaultTranslation('Error %1$s');
|
||||
$errorArgument = 504;
|
||||
$message = getDefaultTranslation('Gateway Timeout');
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
64
errors/error.html
Executable file
64
errors/error.html
Executable file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
// Included files
|
||||
require_once __DIR__ . "/../backend/common.php";
|
||||
require_once __DIR__ . "/../backend/language.php";
|
||||
|
||||
|
||||
// Constants
|
||||
|
||||
// Seconds before refresh
|
||||
const SECONDS_BEFORE_REFRESH = 5;
|
||||
|
||||
// Check if referrer doesn't exist
|
||||
if(array_key_exists("HTTP_REFERER", $_SERVER) === FALSE || is_string($_SERVER["HTTP_REFERER"]) === FALSE) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Parse referrer as a URL
|
||||
$url = parse_url($_SERVER["HTTP_REFERER"]);
|
||||
|
||||
// Check if referrer is invalid or from a different origin
|
||||
if($url === FALSE || array_key_exists("host", $url) === FALSE || $url["host"] !== $_SERVER["SERVER_NAME"]) {
|
||||
|
||||
// Require 404 error page
|
||||
require __DIR__ . "/404.html";
|
||||
|
||||
// Exit
|
||||
exit();
|
||||
}
|
||||
|
||||
// Check if referrer is the service worker
|
||||
if($_SERVER["HTTP_REFERER"] === "http" . ((array_key_exists("HTTPS", $_SERVER) === TRUE && $_SERVER["HTTPS"] === "on") ? "s" : "") . "://" . $_SERVER["SERVER_NAME"] . "/scripts/service_worker.js") {
|
||||
|
||||
// Set referrer to the initial page
|
||||
$_SERVER["HTTP_REFERER"] = "http" . ((array_key_exists("HTTPS", $_SERVER) === TRUE && $_SERVER["HTTPS"] === "on") ? "s" : "") . "://" . $_SERVER["SERVER_NAME"] . "/";
|
||||
}
|
||||
|
||||
// Set refresh header
|
||||
header("Refresh: " . sprintf("%.0F", SECONDS_BEFORE_REFRESH) . "; URL=" . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
// Set title, title argument, error, error argument, and message
|
||||
$title = getDefaultTranslation('MWC Wallet — Error');
|
||||
$titleArgument = "";
|
||||
$error = getDefaultTranslation('Error');
|
||||
$errorArgument = "";
|
||||
$message = getDefaultTranslation('An error has occurred. This site will automatically reload in a few seconds.');
|
||||
|
||||
// Set hide URL
|
||||
$hideUrl = TRUE;
|
||||
|
||||
// Set is generic error
|
||||
$isGenericError = TRUE;
|
||||
|
||||
// Require template
|
||||
require __DIR__ . "/template.php";
|
||||
?>
|
0
errors/proxy_error_cors_disabled.html
Executable file
0
errors/proxy_error_cors_disabled.html
Executable file
0
errors/proxy_error_cors_enabled.html
Executable file
0
errors/proxy_error_cors_enabled.html
Executable file
1493
errors/template.php
Executable file
1493
errors/template.php
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user