0
1
Fork 0
hedera-web-mindshore/usr/share/hedera-web/ajax.php

55 lines
1.1 KiB
PHP
Executable File

<?php
require_once ('php/web/hedera.php');
require_once ('php/web/json.php');
Hedera::init ();
JsonLib::init ();
if (Hedera::login ())
{
// Checking the client version
if (isset ($_COOKIE['hedera_version']))
{
$clientVersion = $_COOKIE['hedera_version'];
set_type ($clientVersion, TYPE_DOUBLE);
if ($clientVersion < $_SESSION['version'])
{
$row = Hedera::$sysConn->getRow ('SELECT critical, changelog FROM version LIMIT 1');
if (!$row || $row['critical'])
Error::trigger ('Version', 'criticalVersion', $row['changelog']);
else
Error::trigger ('Version', 'newVersion', $row['changelog']);
}
}
// Getting the action
$action = NULL;
if (isset ($_REQUEST['action']))
$action = $_REQUEST['action'];
if ($action && checkToken ($action))
{
$actionFile = 'ajax/'. $action .'.php';
if (file_exists ($actionFile))
{
Vn\Locale::loadFile ('ajax/'. $action);
require_once ($actionFile);
actionActivate (Hedera::$conn);
}
else
Error::trigger ('Ajax', 'invalidAction', s('InvalidAction'));
}
}
JsonLib::sendReply ();
Hedera::deinit ();
?>