1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
<?php
MainFactory::load_class('AdminHttpViewController');
class DynamicShopMessagesController extends AdminHttpViewController
{
public function actionDefault()
{
try
{
include DIR_FS_CATALOG . 'release_info.php';
$params = array(
'shop_version' => rawurlencode($gx_version),
'news_type' => 'DOM'
);
if (gm_get_conf('SHOP_KEY_VALID') === '1')
{
$params['shop_url'] = rawurlencode(HTTP_SERVER . DIR_WS_CATALOG);
$params['shop_key'] = rawurlencode(GAMBIO_SHOP_KEY);
$params['language'] = rawurlencode($_SESSION['language_code']);
}
$url = 'https://www.gambio-support.de/updateinfo/?' . implode('&', $params);
$loadUrl = MainFactory::create('LoadUrl');
$jsonString = $loadUrl->load_url($url, array('Accept: application/json'), '', false, false);
$response = json_decode($jsonString, true);
}
catch(Exception $ex)
{
$response = AjaxException::response($ex);
}
if ($response === null)
{
$response = array(
'SOURCES' => array(),
'MESSAGES' => array()
);
}
return MainFactory::create('JsonHttpControllerResponse', $response);
}
}