File modules/cms/action/ConfigurationAction.class.php

Last commit: Sun Oct 1 02:58:08 2023 +0200	Jan Dankert	Refactoring: No it is possible to use 8 byte integers in the database
1 <?php 2 3 namespace cms\action; 4 5 // OpenRat Content Management System 6 // Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de 7 // 8 // This program is free software; you can redistribute it and/or 9 // modify it under the terms of the GNU General Public License 10 // as published by the Free Software Foundation; version 2. 11 // 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // You should have received a copy of the GNU General Public License 18 // along with this program; if not, write to the Free Software 19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 21 use cms\base\DefaultConfig; 22 use util\exception\SecurityException; 23 use util\Session; 24 25 /** 26 * Action-Klasse fuer die Bearbeitung eines Template-Elementes. 27 * 28 * @author Jan Dankert 29 * @package openrat.actions 30 */ 31 class ConfigurationAction extends BaseAction 32 { 33 /** 34 * Konstruktor 35 */ 36 function __construct() 37 { 38 parent::__construct(); 39 } 40 41 42 43 /** 44 * Reads system configuration. 45 * @return array 46 */ 47 protected function getSystemConfiguration() 48 { 49 $conf['server'] = [ 50 'time' => date('r'), 51 'name' => php_uname(), 52 'os' => php_uname('s'), 53 'host' => php_uname('n'), 54 'release' => php_uname('r'), 55 'machine' => php_uname('m'), 56 'owner' => get_current_user(), 57 'pid' => getmypid(), 58 ]; 59 60 61 $conf['interpreter'] = [ 62 'version' => phpversion(), 63 'SAPI' => php_sapi_name(), 64 'session-name' => session_name(), 65 'loaded_ini_file' => php_ini_loaded_file(), 66 ]; 67 68 $conf['interpreter']['server'] = $_SERVER; 69 $conf['interpreter']['64bit'] = PHP_INT_SIZE >= 8; 70 $conf['interpreter']['server' ] = $_SERVER; 71 $conf['interpreter']['environment'] = $_ENV; 72 $conf['interpreter']['temp_dir' ] = sys_get_temp_dir(); 73 74 $conf['interpreter']['configuration'] = ini_get_all(); 75 $conf['resources'] = getrusage(); 76 77 $extensions = get_loaded_extensions(); 78 asort($extensions); 79 80 foreach ($extensions as $id => $extensionName) 81 $conf['interpreter']['extension'][$extensionName] = 'loaded'; 82 83 return $conf; 84 } 85 86 87 /** 88 * User must be an administration. 89 */ 90 public function checkAccess() { 91 if ( ! $this->userIsAdmin() ) 92 throw new SecurityException(); 93 } 94 95 }
Download modules/cms/action/ConfigurationAction.class.php
History Sun, 1 Oct 2023 02:58:08 +0200 Jan Dankert Refactoring: No it is possible to use 8 byte integers in the database Sun, 4 Dec 2022 17:49:28 +0100 Jan Dankert Fix for PHP 8: Magic Quotes GPC were removed in PHP 5.4 Sun, 14 Mar 2021 22:29:56 +0100 Jan Dankert Refactoring: Clearer access check. Wed, 18 Nov 2020 00:18:10 +0100 Jan Dankert Refactoring Part 2: Removing all unnecessary methods in the action base classes. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class. Sun, 25 Oct 2020 01:45:39 +0200 Jan Dankert Fix: the flattened arrays were missing some values oO Sat, 10 Oct 2020 01:29:41 +0200 Jan Dankert Refactoring: Only using CSS classes with the 'or-'-prefix. Fri, 25 Sep 2020 23:59:08 +0200 Jan Dankert Refactoring: capsulate the default config in a class. Sun, 23 Feb 2020 04:01:30 +0100 Jan Dankert Refactoring with Namespaces for the cms modules, part 1: moving.