File modules/cms/action/configuration/ConfigurationEditAction.class.php
Last commit: Fri Apr 15 14:51:22 2022 +0200 dankert Refactoring: User,Config and Database info is now stored in the Request, because so there is no session required for clients which are using Basic Authorization.
1 <?php 2 namespace cms\action\configuration; 3 use cms\action\ConfigurationAction; 4 use cms\action\Method; 5 use cms\base\DefaultConfig; 6 use util\ArrayUtils; 7 use util\Request; 8 use util\Session; 9 10 class ConfigurationEditAction extends ConfigurationAction { 11 12 13 public function view() { 14 15 $defaultConfig = DefaultConfig::get();; 16 $currentConfig = Request::getConfig(); 17 18 $currentConfig['system'] = $this->getSystemConfiguration(); 19 20 // Language are to much entries 21 unset($currentConfig['language']); 22 23 $pad = str_repeat("\xC2\xA0",10); // Hard spaces 24 25 $flatDefaultConfig = ArrayUtils::dryFlattenArray( $defaultConfig , $pad ); 26 $flatCMSConfig = ArrayUtils::dryFlattenArray( Request::getConfig(), $pad ); 27 $flatConfig = ArrayUtils::dryFlattenArray( $currentConfig , $pad ); 28 29 $config = array_map( function($key,$value) use ($flatConfig,$flatCMSConfig,$flatDefaultConfig) { 30 31 if ( strpos($value['key'],'password') !== false ) 32 $value['value'] = '**********'; 33 34 return ['key'=>$key,'value'=>$value,'class'=>(empty($flatCMSConfig[$key])?'readonly':(isset($flatDefaultConfig[$key]) && $flatDefaultConfig[$key]==$flatConfig[$key]?'default':'changed'))]; 35 36 },array_keys($flatConfig),$flatConfig); 37 38 $this->setTemplateVar('config',$config ); 39 } 40 }
Downloadmodules/cms/action/configuration/ConfigurationEditAction.class.php
History Fri, 15 Apr 2022 14:51:22 +0200 dankert Refactoring: User,Config and Database info is now stored in the Request, because so there is no session required for clients which are using Basic Authorization. Sun, 20 Mar 2022 22:34:34 +0100 dankert Fix: Mask passwords in configuration output. Thu, 19 Nov 2020 12:28:33 +0100 Jan Dankert Fix: nextSubAction() is depracated and should not be used. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.