pages/admin/AdminFunctionsHandler.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('site.Version');
00018 import('site.VersionDAO');
00019 import('site.VersionCheck');
00020 import('pages.admin.AdminHandler');
00021 
00022 class AdminFunctionsHandler extends AdminHandler {
00026    function AdminFunctionsHandler() {
00027       parent::AdminHandler();
00028    }
00029 
00033    function systemInfo() {
00034       $this->validate();
00035       $this->setupTemplate(true);
00036 
00037       $configData =& Config::getData();
00038 
00039       $dbconn =& DBConnection::getConn();
00040       $dbServerInfo = $dbconn->ServerInfo();
00041 
00042       $versionDao =& DAORegistry::getDAO('VersionDAO');
00043       $currentVersion =& $versionDao->getCurrentVersion();
00044       $versionHistory =& $versionDao->getVersionHistory();
00045 
00046       $serverInfo = array(
00047          'admin.server.platform' => Core::serverPHPOS(),
00048          'admin.server.phpVersion' => Core::serverPHPVersion(),
00049          'admin.server.apacheVersion' => (function_exists('apache_get_version') ? apache_get_version() : __('common.notAvailable')),
00050          'admin.server.dbDriver' => Config::getVar('database', 'driver'),
00051          'admin.server.dbVersion' => (empty($dbServerInfo['description']) ? $dbServerInfo['version'] : $dbServerInfo['description'])
00052       );
00053 
00054       $templateMgr =& TemplateManager::getManager();
00055       $templateMgr->assign_by_ref('currentVersion', $currentVersion);
00056       $templateMgr->assign_by_ref('versionHistory', $versionHistory);
00057       $templateMgr->assign_by_ref('configData', $configData);
00058       $templateMgr->assign_by_ref('serverInfo', $serverInfo);
00059       if (Request::getUserVar('versionCheck')) {
00060          $latestVersionInfo =& VersionCheck::getLatestVersion();
00061          $latestVersionInfo['patch'] = VersionCheck::getPatch($latestVersionInfo);
00062          $templateMgr->assign_by_ref('latestVersionInfo', $latestVersionInfo);
00063       }
00064       $templateMgr->assign('helpTopicId', 'site.administrativeFunctions');
00065       $templateMgr->display('admin/systemInfo.tpl');
00066    }
00067 
00071    function phpinfo() {
00072       $this->validate();
00073       phpinfo();
00074    }
00075 
00079    function expireSessions() {
00080       $this->validate();
00081       $sessionDao =& DAORegistry::getDAO('SessionDAO');
00082       $sessionDao->deleteAllSessions();
00083       Request::redirect(null, null, ROLE_PATH_SITE_ADMIN);
00084    }
00085 
00089    function clearTemplateCache() {
00090       $this->validate();
00091       $templateMgr =& TemplateManager::getManager();
00092       $templateMgr->clearTemplateCache();
00093       Request::redirect(null, null, ROLE_PATH_SITE_ADMIN);
00094    }
00095 
00099    function clearDataCache() {
00100       $this->validate();
00101 
00102       // Clear the CacheManager's caches
00103       $cacheManager =& CacheManager::getManager();
00104       $cacheManager->flush();
00105 
00106       // Clear ADODB's cache
00107       $userDao =& DAORegistry::getDAO('UserDAO'); // As good as any
00108       $userDao->flushCache();
00109 
00110       Request::redirect(null, null, ROLE_PATH_SITE_ADMIN);
00111    }
00112 }
00113 
00114 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7