php-mpos/public/include/pages/statistics/uptime.inc.php
Sebastian Grewe fa8406b172 [FIX] No uptime status on empty result
Fixes #910 once merged
2013-12-07 14:15:10 +01:00

28 lines
878 B
PHP

<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3);
if ($setting->getValue('monitoring_uptimerobot_api_keys') && $aStatus = $monitoring->getUptimeRobotStatus()) {
$smarty->assign("STATUS", $aStatus);
$smarty->assign("UPDATED", $setting->getValue('monitoring_uptimerobot_lastcheck'));
$smarty->assign("CODES", array(
0 => 'Paused',
1 => 'Unchecked',
2 => 'Up',
8 => 'Down',
9 => 'Down'
));
$smarty->assign("CONTENT", "default.tpl");
} else {
$_SESSION['POPUP'][] = array('CONTENT' => 'UptimeRobot API Key not configured.', 'TYPE' => 'info');
$smarty->assign("CONTENT", "");
}
} else {
$debug->append('Using cached page', 3);
}
?>