예제 #1
0
function onBrowserLoad()
{
    manageCookies::cookieUnset('slowDownAjaxCallFrom');
    installFolderAlert();
    cronNotRunAlert();
}
예제 #2
0
 public static function getSendNextAjaxCallAfter()
 {
     $time = time();
     $isTaskActive = DB::getExists("?:history H", "H.historyID", "(H.status IN('writingRequest','pending','multiCallWaiting','initiated','running','processingResponse') OR (H.status = 'scheduled' AND H.timescheduled <= " . ($time - 120) . " AND H.timescheduled > 0)) LIMIT 1");
     $slowDownAjaxCallFrom = manageCookies::cookieGet('slowDownAjaxCallFrom');
     if ($isTaskActive) {
         manageCookies::cookieUnset('slowDownAjaxCallFrom');
         return 0;
     } elseif (!empty($slowDownAjaxCallFrom)) {
         if ($slowDownAjaxCallFrom['sec60'] < $time) {
             return 60;
         } elseif ($slowDownAjaxCallFrom['sec30'] < $time) {
             return 30;
         } elseif ($slowDownAjaxCallFrom['sec10'] < $time) {
             return 10;
         }
     } else {
         $slowDownAjaxCallFrom = array();
         $slowDownAjaxCallFrom['sec10'] = $time + 12;
         //two calls of 10 sec
         $slowDownAjaxCallFrom['sec30'] = $time + 35;
         //two calls of 30 sec
         $slowDownAjaxCallFrom['sec60'] = $time + 105;
         //from there 60 sec each call
         manageCookies::cookieSet('slowDownAjaxCallFrom', $slowDownAjaxCallFrom, array('expire' => 0));
         return 0;
     }
     return 0;
     //safe
 }