. * * Copyright 2008 Aart-Jan Boor * Wemag Advisering */ require_once(KT_LIB_DIR . '/dispatcher.inc.php'); /** * Dispatches the reset dashboards page */ class ResetDashboardsDispatcher extends KTAdminDispatcher { /** * Ask for confirmation * * @return template HTML */ function do_main(){ if($_POST['doReset']){ //form submission $this->form_submit(); return " "; } //set breadcrumbs $this->oPage->setBreadcrumbDetails(_kt('Reset dashboards')); //render template $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("resetDashboards"); return $oTemplate->render(array()); } /** * Handles the form submission. * Logs out all users, and then deletes all customised dashboards. * Users will be given a new default dashboard when the log in again. */ function form_submit(){ DBUtil::runQuery("DELETE FROM `active_sessions`"); DBUtil::runQuery("DELETE FROM `system_settings` WHERE `name` LIKE 'dashboard-state-%'"); $this->addInfoMessage(_kt("All dashboards reset to default dashboard")); } } ?>