0
1
Fork 0

Cambios varios

This commit is contained in:
Juan Ferrer Toribio 2016-10-17 08:52:14 +02:00
parent 1d65501db9
commit 757467e5ec
6 changed files with 5 additions and 137 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.356-deb8) stable; urgency=low hedera-web (1.357-deb8) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -1,6 +1,6 @@
<?php <?php
require_once (__DIR__.'/../php-vn-lib/environ.php'); require_once __DIR__.'/../php-vn-lib/environ.php';
set_include_path (__DIR__.PATH_SEPARATOR.get_include_path ()); set_include_path (__DIR__.PATH_SEPARATOR.get_include_path ());

View File

@ -7,7 +7,7 @@ Hedera.Address = new Class
{ {
this.$('model').setInfo ('a', 'address_view', 'hedera', ['id'], 'id'); this.$('model').setInfo ('a', 'address_view', 'hedera', ['id'], 'id');
this.$('model').setDefault ('customer_id', 'a', this.$('model').setDefault ('customer_id', 'a',
new Sql.Function ({schema: 'account', name: 'user_get_id'})); new Sql.Function ({schema: 'account', name: 'userGetId'}));
} }
,onStatusChange: function (form) ,onStatusChange: function (form)

View File

@ -1,132 +0,0 @@
<?php
openlog ('hedera-web', LOG_ODELAY, LOG_LOCAL0);
require_once ('vn/hedera/web.php');
require_once ('vn/hedera/js.php');
require_once ('vn/hedera/util.php');
use Vn\Hedera\Web;
use Vn\Lib\Locale;
function myExitHandler ()
{
Web::deinit ();
closelog ();
}
function myGlobalErrorHandler ()
{
header ('Location: unavailable.html');
myExitHandler ();
exit (0);
}
function myErrorHandler ($errno, $message, $file, $line, $context)
{
error_log ("Error: $file($line): $message");
switch ($errno)
{
case E_USER_ERROR:
myGlobalErrorHandler ();
}
return TRUE;
}
function myExceptionHandler ($e)
{
error_log (sprintf ('Exception: %s(%d): %s. Trace: %s'
,$e->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 ();
?>

View File

@ -2,7 +2,7 @@
namespace Vn\Web; namespace Vn\Web;
use \Exception; use Exception;
/** /**
* Basic class to encode, decode and verify JWT tokens. It implements the HS256 * Basic class to encode, decode and verify JWT tokens. It implements the HS256

View File

@ -2,7 +2,7 @@
namespace Vn\Web; namespace Vn\Web;
require_once ('libphp-phpmailer/PHPMailerAutoload.php'); require_once 'libphp-phpmailer/PHPMailerAutoload.php';
use Vn\Lib\UserException; use Vn\Lib\UserException;