00001 <?php
00002
00015 import('lib.pkp.classes.controllers.grid.GridHandler');
00016 import('controllers.grid.admin.systemInfo.InfoGridCellProvider');
00017
00018
00019 class ServerInfoGridHandler extends GridHandler {
00023 function ServerInfoGridHandler() {
00024 parent::GridHandler();
00025 $this->addRoleAssignment(array(
00026 ROLE_ID_SITE_ADMIN),
00027 array('fetchGrid', 'fetchRow')
00028 );
00029 }
00030
00031
00032
00033
00034
00038 function authorize(&$request, $args, $roleAssignments) {
00039 import('lib.pkp.classes.security.authorization.PolicySet');
00040 $rolePolicy = new PolicySet(COMBINING_PERMIT_OVERRIDES);
00041
00042 import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy');
00043 foreach($roleAssignments as $role => $operations) {
00044 $rolePolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, $role, $operations));
00045 }
00046 $this->addPolicy($rolePolicy);
00047
00048 return parent::authorize($request, $args, $roleAssignments);
00049 }
00050
00054 function initialize(&$request) {
00055 parent::initialize($request);
00056
00057
00058 AppLocale::requireComponents(
00059 LOCALE_COMPONENT_PKP_USER,
00060 LOCALE_COMPONENT_PKP_ADMIN,
00061 LOCALE_COMPONENT_OMP_ADMIN,
00062 LOCALE_COMPONENT_OMP_MANAGER,
00063 LOCALE_COMPONENT_APPLICATION_COMMON
00064 );
00065
00066
00067 $this->setTitle('admin.serverInformation');
00068 $this->setInstructions('admin.serverInformationDescription');
00069
00070
00071
00072
00073 import('controllers.grid.admin.systemInfo.InfoGridCellProvider');
00074 $infoGridCellProvider = new InfoGridCellProvider(true);
00075
00076
00077 $this->addColumn(
00078 new GridColumn(
00079 'name',
00080 'admin.systemInfo.settingName',
00081 null,
00082 'controllers/grid/gridCell.tpl',
00083 $infoGridCellProvider,
00084 array('width' => 20, 'alignment' => COLUMN_ALIGNMENT_LEFT)
00085 )
00086 );
00087
00088
00089 $this->addColumn(
00090 new GridColumn(
00091 'value',
00092 'admin.systemInfo.settingValue',
00093 null,
00094 'controllers/grid/gridCell.tpl',
00095 $infoGridCellProvider
00096 )
00097 );
00098 }
00099
00100
00101
00102
00103
00104
00108 function loadData(&$request, $filter) {
00109
00110 $dbconn =& DBConnection::getConn();
00111 $dbServerInfo = $dbconn->ServerInfo();
00112
00113 $serverInfo = array(
00114 'admin.server.platform' => Core::serverPHPOS(),
00115 'admin.server.phpVersion' => Core::serverPHPVersion(),
00116 'admin.server.apacheVersion' => (function_exists('apache_get_version') ? apache_get_version() : __('common.notAvailable')),
00117 'admin.server.dbDriver' => Config::getVar('database', 'driver'),
00118 'admin.server.dbVersion' => (empty($dbServerInfo['description']) ? $dbServerInfo['version'] : $dbServerInfo['description'])
00119 );
00120
00121 return $serverInfo;
00122 }
00123 }
00124 ?>