Your IP : 216.73.216.176
<?php /*windu.org core*/ class check { public static $allCheckMethods = array('cacheOn','update','widgetUpdate','winduLink','activation','backup','systemsRun'); public static function activation() { if (!license::check()) { return false; } return true; } public static function cacheOn() { if (config::get('cache')==0) { notifyDB::add('admin.notify.cache', notifyDB::STATUS_LIGHT,'admin/system/config/'); } if (config::get('cacheResources')==0) { notifyDB::add('admin.notify.cache.resources', notifyDB::STATUS_LIGHT,'admin/system/config/'); } return true; } public static function systemsRun(){ $systemsArray = array('firewall','log','statistic','monitoring','requestLog'); foreach ($systemsArray as $system){ $name = 'SystemRun-'.$system; if (config::get($name)!=1) { notifyDB::add('admin.notify.nosystemrun.'.$name, notifyDB::STATUS_LIGHT,'admin/system/config/'); } else{ notifyDB::closeByName('admin.notify.nosystemrun.'.$name); } } } public static function winduLink() { if (!license::hasPro()) { if (license::checkWinduLink()) { notifyDB::closeByName('admin.notify.nowindulink'); return true; } else{ license::noWinduLinkNotify(); notifyDB::add('admin.notify.nowindulink', notifyDB::STATUS_DANGER,'admin/themes/themes/'); config::set('winduLink', 0); } }else{ notifyDB::closeByName('admin.notify.nowindulink'); return true; } } public static function all() { foreach (self::$allCheckMethods as $method) { self::$method(); }; return true; } /*TODO zapis pobranych wiadomosci do tabeli oraz ich wyseitlanie na stornie glownej czy cos...*/ public static function getUpdateServerMessages() { $messages = license::getUpdateServerMessage(); if ($messages!='') { $messagesArray = unserialize($messages); } return false; } public static function update($cache = false,$force = true) { if (!$force and !$cache) { $cookieVal = cookie::readCookie('update'); if ($cookieVal==1 or $cookieVal==2) { if ($cookieVal==1) { return TRUE; } return FALSE; } } $localRev = config::get('revision'); if ($cache == true and cache::isCached('actualRevision')){ $serverRev = cache::read('actualRevision'); if ($serverRev > $localRev) { return true; } return false; } $updateObject = new updateManager(); $serverRev = $updateObject->getServerRevisionNo(); cache::write('actualRevision', $serverRev, ''); if ($serverRev > $localRev) { notifyDB::add('admin.notify.update', notifyDB::STATUS_WORNING,'admin/update/'); cookie::setCookie('update',1,3600*3); return true; } notifyDB::closeByName('admin.notify.update'); cookie::setCookie('update',2,3600*3); return false; } public static function widgetUpdate() { if (cache::isCached('widgetsToUpdate',3600*3)) { $widgetsToUpdate = cache::read('widgetsToUpdate'); }else{ $widgetsToUpdate = widgetsDB::getUpdateList(); cache::write('widgetsToUpdate', $widgetsToUpdate); if (count($widgetsToUpdate)>0) { notifyDB::add('admin.notify.widgetupdate', notifyDB::STATUS_WORNING,'admin/themes/widgets/'); } else{ notifyDB::closeByName('admin.notify.widgetupdate'); } } if (count($widgetsToUpdate)>0) return true; else return false; } public static function backup($noNotify = false) { $timeCounter = 3600*24*32; $now = strtotime("now"); $dateCondition = $now - $timeCounter; $backupsList = scandir(BACKUPS_PATH); foreach ($backupsList as $backup){ $backup = explode('_', $backup); $backupTime = $backup[1]; if ($backupTime > $dateCondition) { return true; } } if(!$noNotify) notifyDB::add('admin.notify.backup', notifyDB::STATUS_LIGHT,'admin/system/backup/'); return false; } } ?>