/** * Check action called in Maintenance template */ public function maintenanceAction($h) { $maintenance = new Maintenance(); $maintenance->getSiteAnnouncement($h); // check if we're viewing a debug file $debug_file = $h->cage->get->noPath('debug'); if ($debug_file) { // skip the opening die() statement and echo debug file $debug_contents = file_get_contents(CACHE . 'debug_logs/' . $debug_file, NULL, NULL, 16); echo nl2br($debug_contents); exit; } // check if we're performing an action $action = $h->cage->get->testAlnumLines('action'); if ($action == 'announcement') { $maintenance->addSiteAnnouncement($h); } if ($action == 'open') { $h->openCloseSite('open'); } if ($action == 'close') { $h->openCloseSite('close'); } if ($action == 'clear_all_cache') { $h->clearCache('db_cache', false); $h->clearCache('css_js_cache', false); $h->clearCache('rss_cache', false); $h->clearCache('html_cache', false); $h->clearCache('lang_cache', false); @unlink(BASE . 'cache/smartloader_cache.php'); $h->pluginHook('maintenance_clear_all_cache'); $h->messages[$h->lang('admin_maintenance_clear_all_cache_success')] = 'green'; } if ($action == 'clear_db_cache') { $h->clearCache('db_cache'); } if ($action == 'clear_css_js_cache') { $h->clearCache('css_js_cache'); } if ($action == 'clear_rss_cache') { $h->clearCache('rss_cache'); } if ($action == 'clear_html_cache') { $h->clearCache('html_cache'); } if ($action == 'clear_lang_cache') { $h->clearCache('lang_cache'); } if ($action == 'optimize') { $h->optimizeTables(); } if ($action == 'export') { $h->exportDatabase(); } if ($action == 'empty') { $h->emptyTable($h->cage->get->testAlnumLines('table')); } if ($action == 'drop') { $h->dropTable($h->cage->get->testAlnumLines('table')); } if ($action == 'remove_settings') { $h->removeSettings($h->cage->get->testAlnumLines('settings')); } if ($action == 'system_report') { $h->generateReport(); } if ($action == 'delete_debugs') { $h->clearCache('debug_logs'); $h->vars['debug_files'] = $h->getFiles(CACHE . 'debug_logs'); } // get list of debug logs $h->vars['debug_files'] = $h->getFiles(CACHE . 'debug_logs'); }