public function indexAction() { $this->view->stats = $this->_helper->service('stat')->getAll(); // saving them here to retrieve later, because these are not available when run in cli SystemPref::set('support_stats_server', $this->view->stats['server']); SystemPref::set('support_stats_ip_address', $this->view->stats['ipAddress']); SystemPref::set('support_stats_ram_total', $this->view->stats['ramTotal']); if ($this->getRequest()->isPost() && $this->_getParam('support_send') !== null) { $values = $this->getRequest()->getPost(); try { $askTime = new DateTime($values['stat_ask_time']); } catch (Exception $e) { $askTime = new DateTime('7 days'); } SystemPref::set('stat_ask_time', $askTime->getTimestamp()); SystemPref::set('support_send', $values['support_send']); $this->_helper->flashMessenger(getGS('Support settings saved.')); if ($this->_getParam('action') === 'popup') { $this->_helper->redirector('index', ''); } else { $this->_helper->redirector('index'); } } $this->view->support_send = SystemPref::get('support_send'); }
require_once dirname(dirname(__FILE__)) . '/classes/Extension/WidgetManager.php'; camp_load_translation_strings('home'); camp_load_translation_strings('articles'); camp_load_translation_strings('api'); camp_load_translation_strings('extensions'); camp_load_translation_strings('globals'); // install default widgets for admin WidgetManager::SetDefaultWidgetsAll(); // add title echo camp_html_breadcrumbs(array(array(getGS('Dashboard'), ''))); if (!SystemPref::get('stat_ask_time')) { SystemPref::set('stat_ask_time', 0); } if (!SystemPref::get('installation_id')) { $installationId = sha1($_SERVER['SERVER_ADDR'] . $_SERVER['SERVER_NAME'] . mt_rand()); SystemPref::set('installation_id', $installationId); } $request_only = false; if (!SystemPref::get('support_send') && SystemPref::get('stat_ask_time') <= time() && empty($_SESSION['statDisplayed'])) { $statUrl = $Campsite['WEBSITE_URL'] . '/admin/support/popup'; $request_only = true; ?> <a style="display: none;" id="dummy_stat_link" href="<?php echo $statUrl; ?> "></a><?php } // clear cache $clearCache = Input::Get('clear_cache', 'string', 'no', true); if ((CampCache::IsEnabled() || CampTemplateCache::factory()) && $clearCache == 'yes' && $g_user->hasPermission('ClearCache')) { // Clear cache engine's cache