From 757467e5ec56fa9e8f4e05273512103e5a7d2e20 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 17 Oct 2016 08:52:14 +0200 Subject: [PATCH] Cambios varios --- debian/changelog | 2 +- environ.php | 2 +- forms/account/address/address.js | 2 +- web/index.php | 132 ------------------------------- web/jwt.php | 2 +- web/mailer.php | 2 +- 6 files changed, 5 insertions(+), 137 deletions(-) delete mode 100755 web/index.php diff --git a/debian/changelog b/debian/changelog index 3a765895..25b85fbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.356-deb8) stable; urgency=low +hedera-web (1.357-deb8) stable; urgency=low * Initial Release. diff --git a/environ.php b/environ.php index 7d9b0127..d6a81f0f 100644 --- a/environ.php +++ b/environ.php @@ -1,6 +1,6 @@ getFile () - ,$e->getLine () - ,$e->getMessage () - ,$e->getTraceAsString () - )); - myGlobalErrorHandler (); -} - -set_error_handler ('myErrorHandler', E_ALL); -set_exception_handler ('myExceptionHandler'); - -Web::sysInit (); - -if (!Web::isHttps () && Web::$sysConn->getValue ('SELECT https FROM config')) -{ - header ("Location: https://${_SERVER['SERVER_NAME']}${_SERVER['REQUEST_URI']}"); - exit (0); -} - -Web::init (); - -// Getting the requested page - -if (isset ($_GET['page']) && Vn\Hedera\checkToken ($_GET['page'])) - $page = $_GET['page']; -else - $page = 'main'; - -// Checking the browser version - -if (!isset ($_SESSION['skipBrowser']) && $page != 'update-browser') -{ - $updateBrowser = FALSE; - - if (!isset ($_GET['skipBrowser']) - && ($browser = get_browser ($_SERVER['HTTP_USER_AGENT']))) - { - $browserVersion = $browser->version; - set_type ($browserVersion, TYPE_DOUBLE); - - $minVersion = Web::$sysConn->getValue ( - 'SELECT version FROM browser WHERE name = #', [$browser->browser]); - - $updateBrowser = $browserVersion > 0 - && isset ($minVersion) && $browserVersion < $minVersion; - } - - if ($updateBrowser) - { - header ('Location: ?page=update-browser'); - exit (0); - } - else - $_SESSION['skipBrowser'] = TRUE; -} - -// If enabled, requests the user to choose between two web versions - -if (FALSE && !isset ($_SESSION['skipVersionMenu']) && $page != 'version-menu') -{ - $_SESSION['skipVersionMenu'] = TRUE; - header ('Location: ?page=version-menu'); -} - -// Setting the version - -setcookie ('hedera_version', Web::getVersion ()); - -// Loading the requested page - -$basePath = 'pages/'. $page; - -header ("Content-Security-Policy: default-src 'self'; img-src *"); -header ('Content-Type: text/html; charset=utf-8'); - -if (file_exists ($basePath)) -{ - Locale::addPath ($basePath); - - $phpFile = $basePath .'/'. $page .'.php'; - - if (file_exists ($phpFile)) - require ($phpFile); - - require ($basePath .'/html.php'); -} -else - header ('Location: ./'); - -myExitHandler (); - -?> diff --git a/web/jwt.php b/web/jwt.php index 9b4805fe..74b530fa 100755 --- a/web/jwt.php +++ b/web/jwt.php @@ -2,7 +2,7 @@ namespace Vn\Web; -use \Exception; +use Exception; /** * Basic class to encode, decode and verify JWT tokens. It implements the HS256 diff --git a/web/mailer.php b/web/mailer.php index 8a6df0c7..0b9db29b 100755 --- a/web/mailer.php +++ b/web/mailer.php @@ -2,7 +2,7 @@ namespace Vn\Web; -require_once ('libphp-phpmailer/PHPMailerAutoload.php'); +require_once 'libphp-phpmailer/PHPMailerAutoload.php'; use Vn\Lib\UserException;