Example #1
0
 * @copyright Copyright © 2014, Xoff Software GmbH
 * @license MIT
 * @version 2.0
 * @package epesi-notify
 * 
 */
define('CID', false);
define('READ_ONLY_SESSION', true);
require_once '../../../include.php';
ModuleManager::load_modules();
$token = Base_NotifyCommon::get_session_token();
// will check is user logged
if ($token === false) {
    exit;
}
if (Base_NotifyCommon::is_disabled()) {
    echo json_encode(array('disable' => 1));
    exit;
}
if (!Base_NotifyCommon::is_refresh_due($token)) {
    exit;
}
$ret = array();
$message_count = 0;
$notified_cache = array();
$group_similar = Base_NotifyCommon::group_similar();
$refresh_time = time();
$notifications = Base_NotifyCommon::get_notifications($token);
$all_notified = true;
foreach ($notifications as $module => $module_new_notifications) {
    $timeout = Base_NotifyCommon::get_module_setting($module);