openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit 353898e183d331c65614a945d6dac354e0f547fc
parent 99b024f7155aff0c3a954ebdba4f4e5aef760c4b
Author: Jan Dankert <develop@jandankert.de>
Date:   Sat, 26 Sep 2020 10:32:02 +0200

Refactoring: No global $conf array any more.

Diffstat:
modules/cms/Dispatcher.class.php | 3+--
modules/cms/action/ElementAction.class.php | 4++--
modules/cms/action/FileAction.class.php | 6+++---
modules/cms/action/FolderAction.class.php | 2+-
modules/cms/action/GroupAction.class.php | 2+-
modules/cms/action/LanguagelistAction.class.php | 6+++---
modules/cms/action/LoginAction.class.php | 24++++++++++++------------
modules/cms/action/ProjectAction.class.php | 7++++---
modules/cms/action/SearchAction.class.php | 2+-
modules/cms/action/StartAction.class.php | 26+++++++++++++-------------
modules/cms/action/UserAction.class.php | 8++++----
modules/cms/action/WebdavAction.class.php | 4++--
modules/cms/auth/DatabaseAuth.class.php | 2+-
modules/cms/auth/GuestAuth.class.php | 2+-
modules/cms/auth/HttpAuth.class.php | 2+-
modules/cms/auth/LdapAuth.class.php | 2+-
modules/cms/auth/OpenIdAuth.class.php | 4++--
modules/cms/base/Configuration.class.php | 5+++++
modules/cms/base/Language.class.php | 2+-
modules/cms/generator/PageGenerator.class.php | 2+-
modules/cms/generator/ValueGenerator.class.php | 2+-
modules/cms/generator/target/Ftp.class.php | 2+-
modules/cms/generator/target/Local.class.php | 4++--
modules/cms/generator/target/SFtp.class.php | 2+-
modules/cms/model/BaseObject.class.php | 4++--
modules/cms/model/File.class.php | 2+-
modules/cms/model/Image.class.php | 4++--
modules/cms/model/Project.class.php | 4++--
modules/cms/model/TemplateModel.class.php | 2+-
modules/cms/model/User.class.php | 12++++++------
modules/cms/ui/action/IndexAction.class.php | 2+-
modules/database/Database.class.php | 5++---
modules/util/FileUtils.class.php | 2+-
modules/util/Html.class.php | 2+-
modules/util/Ldap.class.php | 8++++----
modules/util/Mail.class.php | 6+++---
modules/util/Text.class.php | 2+-
modules/wikiparser/parser/WikiParser.class.php | 2+-
modules/wikiparser/renderer/DocBookRenderer.class.php | 4++--
modules/wikiparser/renderer/HtmlDomRenderer.class.php | 2+-
modules/wikiparser/renderer/HtmlRenderer.class.php | 4++--
modules/wikiparser/renderer/LatexRenderer.class.php | 2+-
modules/wikiparser/renderer/PdfRenderer.class.php | 2+-
modules/wikiparser/renderer/TextRenderer.class.php | 2+-
modules/wikiparser/renderer/XhtmlRenderer.class.php | 4++--
modules/wikiparser/util/Line.class.php | 2+-
46 files changed, 104 insertions(+), 100 deletions(-)

diff --git a/modules/cms/Dispatcher.class.php b/modules/cms/Dispatcher.class.php @@ -49,8 +49,7 @@ class Dispatcher $this->checkConfiguration(); // Vorhandene Konfiguration aus der Sitzung lesen. - global $conf; - $conf = Session::getConfig(); + $conf = \cms\base\Configuration::rawConfig(); define('PRODUCTION', \cms\base\Configuration::Conf()->is('production',true)); define('DEVELOPMENT', !PRODUCTION); diff --git a/modules/cms/action/ElementAction.class.php b/modules/cms/action/ElementAction.class.php @@ -93,7 +93,7 @@ class ElementAction extends BaseAction */ public function advancedPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $ini_date_format = \cms\base\Configuration::config('date','format'); @@ -146,7 +146,7 @@ class ElementAction extends BaseAction public function advancedView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->setTemplateVar('type',$this->element->getTypeName() ); // Abhaengig vom aktuellen Element-Typ die Eigenschaften anzeigen diff --git a/modules/cms/action/FileAction.class.php b/modules/cms/action/FileAction.class.php @@ -172,7 +172,7 @@ class FileAction extends ObjectAction if ( $this->file->extension == 'gz' ) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $mime_types = $conf['mime-types']; $pos = strrpos($this->file->filename,'.'); @@ -270,7 +270,7 @@ class FileAction extends ObjectAction */ function editView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // MIME-Types aus Datei lesen $this->setTemplateVars( $this->file->getProperties() ); } @@ -289,7 +289,7 @@ class FileAction extends ObjectAction */ function valueView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // MIME-Types aus Datei lesen $this->setTemplateVars( $this->file->getProperties() ); $this->setTemplateVar('value',$this->file->loadValue()); diff --git a/modules/cms/action/FolderAction.class.php b/modules/cms/action/FolderAction.class.php @@ -857,7 +857,7 @@ class FolderAction extends ObjectAction */ private function maxFileSize() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // When querying memory size values: // Many ini memory size values, such as upload_max_filesize, diff --git a/modules/cms/action/GroupAction.class.php b/modules/cms/action/GroupAction.class.php @@ -207,7 +207,7 @@ class GroupAction extends BaseAction } $this->setTemplateVar('memberships',$userliste); - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ($conf['security']['authorize']['type']=='ldap') $this->addNotice('group',$this->group->name,'GROUPS_MAY_CONFLICT_WITH_LDAP',OR_NOTICE_WARN); } diff --git a/modules/cms/action/LanguagelistAction.class.php b/modules/cms/action/LanguagelistAction.class.php @@ -63,7 +63,7 @@ class LanguagelistAction extends BaseAction public function showView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $countryList = $conf['countries']; $list = array(); @@ -107,7 +107,7 @@ class LanguagelistAction extends BaseAction */ function addView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $countryList = $conf['countries']; foreach( $this->project->getLanguageIds() as $id ) @@ -127,7 +127,7 @@ class LanguagelistAction extends BaseAction function addPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $countryList = $conf['countries']; // Hinzufuegen einer Sprache diff --git a/modules/cms/action/LoginAction.class.php b/modules/cms/action/LoginAction.class.php @@ -72,7 +72,7 @@ class LoginAction extends BaseAction { Logger::debug( "Login user: '$name'.'" ); - global $conf; + $conf = \cms\base\Configuration::rawConfig(); global $SESS; unset( $SESS['user'] ); @@ -168,7 +168,7 @@ class LoginAction extends BaseAction { // Hier nie "304 not modified" setzen, da sonst keine // Login-Fehlermeldung erscheinen kann. - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $sso = $conf['security']['sso']; $ssl = $conf['security']['ssl']; @@ -370,7 +370,7 @@ class LoginAction extends BaseAction */ function openidView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); foreach( $conf['database'] as $dbname=>$dbconf ) { @@ -419,7 +419,7 @@ class LoginAction extends BaseAction */ function applications() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // Diese Seite gilt pro Sitzung. $user = Session::getUser(); @@ -470,7 +470,7 @@ class LoginAction extends BaseAction */ public function openidloginView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $openId = Session::get('openid'); if ( !$openId->checkAuthentication() ) @@ -541,7 +541,7 @@ class LoginAction extends BaseAction */ function openidPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); Session::setUser(''); @@ -629,7 +629,7 @@ class LoginAction extends BaseAction */ function loginPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); Session::setUser(''); // Altes Login entfernen. @@ -842,7 +842,7 @@ class LoginAction extends BaseAction */ public function logoutPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $user = Session::getUser(); if ( is_object($user) ) @@ -1057,7 +1057,7 @@ class LoginAction extends BaseAction function show() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); global $PHP_AUTH_USER; global $PHP_AUTH_PW; @@ -1143,7 +1143,7 @@ class LoginAction extends BaseAction */ public function registercodeView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); foreach( $conf['database'] as $dbname=>$dbconf ) { if ( is_array($dbconf) && $dbconf['enabled'] ) @@ -1166,7 +1166,7 @@ class LoginAction extends BaseAction public function registerPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); Session::set('registerMail',$this->getRequestVar('mail') ); @@ -1206,7 +1206,7 @@ class LoginAction extends BaseAction */ function registercodePost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $origRegisterCode = Session::get('registerCode'); $inputRegisterCode = $this->getRequestVar('code'); diff --git a/modules/cms/action/ProjectAction.class.php b/modules/cms/action/ProjectAction.class.php @@ -2,6 +2,7 @@ namespace cms\action; +use cms\base\Configuration; use cms\model\Project; use cms\model\Folder; use language\Messages; @@ -252,7 +253,7 @@ class ProjectAction extends BaseAction */ public function syncView() { - global $conf; + $conf = Configuration::rawConfig(); $syncConf = $conf['sync']; if ( ! $syncConf['enabled'] ) @@ -317,7 +318,7 @@ class ProjectAction extends BaseAction $db = \cms\base\DB::get(); $this->setTemplateVar( 'dbid',$db->id ); - global $conf; + $conf = Configuration::rawConfig(); $dbids = array(); foreach( $conf['database'] as $dbname=>$dbconf ) @@ -345,7 +346,7 @@ class ProjectAction extends BaseAction */ function phpinfo() { - global $conf; + $conf = Configuration::rawConfig(); if ( !@$conf['security']['show_system_info'] ) Http::sendStatus(403,'Forbidden','Display of system information is disabled by configuration'); diff --git a/modules/cms/action/SearchAction.class.php b/modules/cms/action/SearchAction.class.php @@ -108,7 +108,7 @@ class SearchAction extends BaseAction */ public function quicksearchView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $text = $this->getRequestVar('search'); diff --git a/modules/cms/action/StartAction.class.php b/modules/cms/action/StartAction.class.php @@ -56,7 +56,7 @@ class StartAction extends BaseAction function setDb( $dbid ) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ( !isset($conf['database'][$dbid] )) throw new \LogicException( 'unknown DB-Id: '.$dbid ); @@ -77,7 +77,7 @@ class StartAction extends BaseAction function checkForDb() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $dbid = $this->getRequestVar('dbid'); if ( $dbid != '' ) @@ -94,7 +94,7 @@ class StartAction extends BaseAction } else { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ( !isset($conf['database']['default']) ) throw new \LogicException('default-database not set'); @@ -111,7 +111,7 @@ class StartAction extends BaseAction { Logger::debug( "login user $name" ); - global $conf; + $conf = \cms\base\Configuration::rawConfig(); global $SESS; unset( $SESS['user'] ); @@ -193,7 +193,7 @@ class StartAction extends BaseAction */ function loginView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $sso = $conf['security']['sso']; $ssl = $conf['security']['ssl']; @@ -440,7 +440,7 @@ class StartAction extends BaseAction */ public function applicationsView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // Diese Seite gilt pro Sitzung. $user = Session::getUser(); @@ -490,7 +490,7 @@ class StartAction extends BaseAction */ function openid() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $openId = Session::get('openid'); if ( !$openId->checkAuthentication() ) @@ -559,7 +559,7 @@ class StartAction extends BaseAction */ function loginPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->checkForDb(); Session::setUser(''); @@ -649,7 +649,7 @@ class StartAction extends BaseAction */ function logoutPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $user = Session::getUser(); if ( is_object($user) ) @@ -854,7 +854,7 @@ class StartAction extends BaseAction function showView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); global $PHP_AUTH_USER; global $PHP_AUTH_PW; @@ -980,7 +980,7 @@ class StartAction extends BaseAction public function registeruserdata() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); Session::set('registerMail',$this->getRequestVar('mail') ); // TODO: Attribut "Password" abfragen @@ -1006,7 +1006,7 @@ class StartAction extends BaseAction */ public function registercommit() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->checkForDb(); $origRegisterCode = Session::get('registerCode'); @@ -1064,7 +1064,7 @@ class StartAction extends BaseAction */ public function password() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // TODO: Attribut "Password" abfragen foreach( $conf['database'] as $dbname=>$dbconf ) diff --git a/modules/cms/action/UserAction.class.php b/modules/cms/action/UserAction.class.php @@ -88,7 +88,7 @@ class UserAction extends BaseAction $this->user->hotp = $this->hasRequestVar('hotp' ); $this->user->totp = $this->hasRequestVar('totp' ); - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ( @$conf['security']['user']['show_admin_mail'] ) $this->user->mail = $this->getRequestVar('mail' ); @@ -163,7 +163,7 @@ class UserAction extends BaseAction */ public function pwPost() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $pw1 = $this->getRequestVar('password1'); $pw2 = $this->getRequestVar('password2'); @@ -232,7 +232,7 @@ class UserAction extends BaseAction */ public function propView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $issuer = urlencode(\cms\base\Configuration::config('application','operator')); $account = $this->user->name.'@'.$_SERVER['SERVER_NAME']; @@ -338,7 +338,7 @@ class UserAction extends BaseAction } $this->setTemplateVar('memberships',$gruppenListe); - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ($conf['security']['authorize']['type']=='ldap') $this->addNotice('user',$this->user->name,'GROUPS_MAY_CONFLICT_WITH_LDAP',OR_NOTICE_WARN); } diff --git a/modules/cms/action/WebdavAction.class.php b/modules/cms/action/WebdavAction.class.php @@ -85,7 +85,7 @@ class WebdavAction extends BaseAction //Changed tobias - //global $conf; + //$conf = \cms\base\Configuration::rawConfig(); $prefs = new Preferences(); $conf = $prefs->load(); //End changed Tobias @@ -260,7 +260,7 @@ class WebdavAction extends BaseAction */ function setDefaultDb() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ( !isset($conf['database']['default']) ) { diff --git a/modules/cms/auth/DatabaseAuth.class.php b/modules/cms/auth/DatabaseAuth.class.php @@ -18,7 +18,7 @@ class DatabaseAuth implements Auth */ public function login($user, $password, $token) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $authDbConf = $conf['security']['authdb']; diff --git a/modules/cms/auth/GuestAuth.class.php b/modules/cms/auth/GuestAuth.class.php @@ -15,7 +15,7 @@ class GuestAuth implements Auth { public function username() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $guestConf = $conf['security']['guest']; if ($guestConf['enable']) diff --git a/modules/cms/auth/HttpAuth.class.php b/modules/cms/auth/HttpAuth.class.php @@ -32,7 +32,7 @@ class HttpAuth implements Auth */ public function login($user, $password, $token) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $http = new Http($conf['security']['http']['url']); $http->method = 'HEAD'; diff --git a/modules/cms/auth/LdapAuth.class.php b/modules/cms/auth/LdapAuth.class.php @@ -20,7 +20,7 @@ class LdapAuth implements Auth return false; } - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $db = \cms\base\DB::get(); $this->mustChangePassword = false; diff --git a/modules/cms/auth/OpenIdAuth.class.php b/modules/cms/auth/OpenIdAuth.class.php @@ -111,7 +111,7 @@ class OpenIdAuth implements Auth */ function serverOk() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $servers = $conf['security']['openid']['trusted_server']; if (empty($servers)) { @@ -177,7 +177,7 @@ class OpenIdAuth implements Auth */ public function getRedirectUrl() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->handle = md5(microtime() . session_id()); diff --git a/modules/cms/base/Configuration.class.php b/modules/cms/base/Configuration.class.php @@ -69,4 +69,9 @@ class Configuration { return Session::getConfig(); } + + public static function rawConfig() { + return self::getConfig(); + } + } diff --git a/modules/cms/base/Language.class.php b/modules/cms/base/Language.class.php @@ -34,7 +34,7 @@ class Language */ public static function lang($textVar, $vars = array()) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $lang = $conf['language']; $text = strtoupper($textVar); diff --git a/modules/cms/generator/PageGenerator.class.php b/modules/cms/generator/PageGenerator.class.php @@ -72,7 +72,7 @@ class PageGenerator extends BaseGenerator */ private function generatePageValue() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // Setzen der 'locale', damit sprachabhängige Systemausgaben (wie z.B. die // Ausgabe von strftime()) in der korrekten Sprache dargestellt werden. diff --git a/modules/cms/generator/ValueGenerator.class.php b/modules/cms/generator/ValueGenerator.class.php @@ -74,7 +74,7 @@ class ValueGenerator extends BaseGenerator $inhalt = ''; - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // Inhalt ist mit anderer Seite verkn�pft. if ( in_array($element->typeid,[Element::ELEMENT_TYPE_TEXT,Element::ELEMENT_TYPE_LONGTEXT,Element::ELEMENT_TYPE_DATE,Element::ELEMENT_TYPE_NUMBER]) && intval($value->linkToObjectId) != 0 && !$value->isLink ) diff --git a/modules/cms/generator/target/Ftp.class.php b/modules/cms/generator/target/Ftp.class.php @@ -38,7 +38,7 @@ class Ftp extends BaseTarget // Aufbauen der Verbindung public function open() { - //global $conf; + //$conf = \cms\base\Configuration::rawConfig(); //$conf_ftp = $conf['publish']['ftp']; $ftp = $this->url; diff --git a/modules/cms/generator/target/Local.class.php b/modules/cms/generator/target/Local.class.php @@ -75,7 +75,7 @@ class Local extends BaseTarget */ public function put($source, $dest, $lastChangeDate) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // Is the output directory writable? if ( !is_writeable( $this->localDestinationDirectory ) ) @@ -128,7 +128,7 @@ class Local extends BaseTarget */ private function mkdirs($path ) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ( is_dir($path) ) return; // Path exists diff --git a/modules/cms/generator/target/SFtp.class.php b/modules/cms/generator/target/SFtp.class.php @@ -46,7 +46,7 @@ class SFtp extends Scp // Aufbauen der Verbindung public function open() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); //$conf_ftp = $conf['publish']['sftp']; diff --git a/modules/cms/model/BaseObject.class.php b/modules/cms/model/BaseObject.class.php @@ -560,7 +560,7 @@ SQL */ public function filename() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $filename = $this->filename; @@ -1353,7 +1353,7 @@ SQL // Resolve config variables. $resolver->addResolver('config', function ($var) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); return ArrayUtils::getSubValue($conf,explode('.',$var) ); }); diff --git a/modules/cms/model/File.class.php b/modules/cms/model/File.class.php @@ -165,7 +165,7 @@ class File extends BaseObject if ( !empty( $this->mime_type ) ) return $this->mime_type; - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $mime_types = $conf['mime-types']; diff --git a/modules/cms/model/Image.class.php b/modules/cms/model/Image.class.php @@ -92,7 +92,7 @@ class Image extends File */ function imageResize( $newWidth,$newHeight,$factor,$oldformat,$newformat,$jpegquality ) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->write(); // Datei schreiben @@ -156,7 +156,7 @@ class Image extends File } // Ab Version 2 der GD-Bibliothek sind TrueColor-Umwandlungen moeglich. - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $hasTrueColor = $conf['image']['truecolor']; switch( $newformat ) diff --git a/modules/cms/model/Project.class.php b/modules/cms/model/Project.class.php @@ -553,7 +553,7 @@ EOF */ public function sync() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $syncConf = $conf['sync']; if ( ! $syncConf['enabled'] ) @@ -578,7 +578,7 @@ EOF { \logger\Logger::debug( 'Copying project '.$this->name.' to database '.$dbid_destination ); - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $zeit = date('Y-m-d\TH:i:sO'); $db_src = \cms\base\DB::get(); diff --git a/modules/cms/model/TemplateModel.class.php b/modules/cms/model/TemplateModel.class.php @@ -156,7 +156,7 @@ class TemplateModel extends ModelBase */ public function mimeType() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $mime_types = $conf['mime-types']; // Nur den letzten Teil der Extension auswerten: diff --git a/modules/cms/model/User.class.php b/modules/cms/model/User.class.php @@ -324,7 +324,7 @@ SQL */ protected function setDatabaseRow( $row ) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->userid = $row['id' ]; $this->name = $row['name' ]; @@ -470,7 +470,7 @@ SQL */ function addNewUserGroups() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $groupNames = explode(',',@$conf['security']['newuser']['groups']); if ( count($groupNames) == 0 ) @@ -836,7 +836,7 @@ SQL */ function hasRight( $objectid,$type ) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ( $this->isAdmin && !$conf['security']['readonly'] ) return true; @@ -858,7 +858,7 @@ SQL */ function addRight( $objectid,$type ) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ( $conf['security']['readonly'] ) if ( $type & Acl::ACL_READ ) @@ -882,7 +882,7 @@ SQL */ public function getAvailableStyles() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $styles = array(); foreach( $conf['style'] as $key=>$values) @@ -923,7 +923,7 @@ SQL */ function createPassword() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $pw = ''; $c = 'bcdfghjklmnprstvwz'; //consonants except hard to speak ones diff --git a/modules/cms/ui/action/IndexAction.class.php b/modules/cms/ui/action/IndexAction.class.php @@ -85,7 +85,7 @@ class IndexAction extends Action */ public function showView() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $user = Session::getUser(); diff --git a/modules/database/Database.class.php b/modules/database/Database.class.php @@ -81,12 +81,11 @@ class Database * Erwartet die Datenbank-Konfiguration als Parameter. * * @param array Konfiguration der Verbindung - * @param boolean admin Wenn es eine Admin-DB-Verbindung werden soll, die auch DDL ausfuehren darf */ public function __construct( $dbconf ) { - global $conf; - + $conf = \cms\base\Configuration::rawConfig(); + $this->conf = $dbconf + $conf['database-default']['defaults']; // linksstehender Operator hat Priorität! $this->connect(); diff --git a/modules/util/FileUtils.class.php b/modules/util/FileUtils.class.php @@ -30,7 +30,7 @@ class FileUtils */ public static function createTempFile() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $tmpdir = @$conf['cache']['tmp_dir']; $tmpfile = @tempnam($tmpdir, 'openrat_tmp'); diff --git a/modules/util/Html.class.php b/modules/util/Html.class.php @@ -43,7 +43,7 @@ class Html if (intval($id) == 0) $id = '-'; - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if (is_array($action)) { $params = $action; diff --git a/modules/util/Ldap.class.php b/modules/util/Ldap.class.php @@ -39,7 +39,7 @@ class Ldap */ function Ldap() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->timeout = intval($conf['ldap']['search']['timeout']); @@ -55,7 +55,7 @@ class Ldap */ function connect() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $ldapHost = $conf['ldap']['host']; $ldapPort = $conf['ldap']['port']; @@ -113,7 +113,7 @@ class Ldap */ function searchUser($username) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $techUser = $conf['ldap']['search']['user']; $techPass = $conf['ldap']['search']['password']; @@ -143,7 +143,7 @@ class Ldap */ function searchAttribute($filter, $attr) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $timeout = intval($conf['ldap']['search']['timeout']); diff --git a/modules/util/Mail.class.php b/modules/util/Mail.class.php @@ -80,7 +80,7 @@ class Mail */ function __construct($to, $text) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); // Zeilenumbruch CR/LF gem. RFC 822. $this->nl = chr(13) . chr(10); @@ -155,7 +155,7 @@ class Mail */ public function send() { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if (strpos($this->to, '@') === FALSE) throw new LogicException("E-Mail-Adress does not contain a domain name: " . $this->to); @@ -440,7 +440,7 @@ class Mail */ private function header_encode($text) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if (empty($conf['mail']['header_encoding'])) return $text; diff --git a/modules/util/Text.class.php b/modules/util/Text.class.php @@ -128,7 +128,7 @@ class Text */ public static function replaceHtmlChars($text) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); foreach (explode(' ', $conf['editor']['html']['replace']) as $repl) { list($ersetze, $mit) = explode(':', $repl . ':'); diff --git a/modules/wikiparser/parser/WikiParser.class.php b/modules/wikiparser/parser/WikiParser.class.php @@ -74,7 +74,7 @@ class WikiParser */ function parseMultiLineText($zeilen) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $children = array(); // Initiales Anlegen der Unterobjektliste. $anzahlZeilen = count($zeilen); // Anzahl Zeilen diff --git a/modules/wikiparser/renderer/DocBookRenderer.class.php b/modules/wikiparser/renderer/DocBookRenderer.class.php @@ -30,7 +30,7 @@ class DocBookRenderer */ function renderElement($child) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $attr = array(); $val = ''; @@ -201,7 +201,7 @@ class DocBookRenderer */ function renderXmlElement($tag, $value, $empty, $attr = array()) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ($tag == '') return $value; diff --git a/modules/wikiparser/renderer/HtmlDomRenderer.class.php b/modules/wikiparser/renderer/HtmlDomRenderer.class.php @@ -44,7 +44,7 @@ class HtmlDomRenderer */ function renderElement($child) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $this->path[] = $child; diff --git a/modules/wikiparser/renderer/HtmlRenderer.class.php b/modules/wikiparser/renderer/HtmlRenderer.class.php @@ -71,7 +71,7 @@ class HtmlRenderer */ function renderElement($child) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $attr = array(); $val = ''; @@ -416,7 +416,7 @@ class HtmlRenderer */ function renderHtmlElement($tag, $value, $empty, $attr = array()) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ($tag == '') return $value; diff --git a/modules/wikiparser/renderer/LatexRenderer.class.php b/modules/wikiparser/renderer/LatexRenderer.class.php @@ -24,7 +24,7 @@ class LatexRenderer */ function renderElement($child) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $val = ''; $before = ''; diff --git a/modules/wikiparser/renderer/PdfRenderer.class.php b/modules/wikiparser/renderer/PdfRenderer.class.php @@ -44,7 +44,7 @@ class PdfRenderer */ function renderElement($child) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); switch (strtolower(get_class($child))) { case 'tableofcontentelement': diff --git a/modules/wikiparser/renderer/TextRenderer.class.php b/modules/wikiparser/renderer/TextRenderer.class.php @@ -34,7 +34,7 @@ class TextRenderer */ function renderElement($child) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $className = strtolower(get_class($child)); $val = ''; diff --git a/modules/wikiparser/renderer/XhtmlRenderer.class.php b/modules/wikiparser/renderer/XhtmlRenderer.class.php @@ -44,7 +44,7 @@ class XhtmlRenderer */ function renderElement($child) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $attr = array(); $val = ''; @@ -407,7 +407,7 @@ class XhtmlRenderer */ function renderHtmlElement($tag, $value, $empty, $attr = array()) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); if ($tag == '') return $value; diff --git a/modules/wikiparser/util/Line.class.php b/modules/wikiparser/util/Line.class.php @@ -43,7 +43,7 @@ class Line */ function __construct($s) { - global $conf; + $conf = \cms\base\Configuration::rawConfig(); $text_markup = $conf['editor']['text-markup']; // Html::debug($text_markup);