35 'syslogErrorReporting',
36 'belogErrorReporting',
45 if (isset($this->postValues[
'set'][
'write'])) {
46 $this->view->assign(
'configurationValuesSaved', TRUE);
47 $this->view->assign(
'savedConfigurationValueMessages', $this->updateLocalConfigurationValues());
52 return $this->view->render();
62 $typo3ConfVars = array_keys(
$GLOBALS[
'TYPO3_CONF_VARS']);
64 $commentArray = $this->getDefaultConfigArrayComments();
65 foreach ($typo3ConfVars as $sectionName) {
66 $data[$sectionName] = array();
68 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][$sectionName] as $key => $value) {
69 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS_extensionAdded'][$sectionName][$key])) {
72 $potentialValue = str_replace(array(
'\'.chr(10).\
'',
'\' . LF . \
''), array(LF, LF), $value);
73 while (preg_match(
'/' . preg_quote(
$GLOBALS[
'TYPO3_CONF_VARS_extensionAdded'][$sectionName][$key],
'/') .
'$/',
'', $potentialValue)) {
74 $potentialValue = preg_replace(
'/' . preg_quote(
$GLOBALS[
'TYPO3_CONF_VARS_extensionAdded'][$sectionName][$key],
'/') .
'$/',
'', $potentialValue);
76 $value = $potentialValue;
79 $description = trim($commentArray[$sectionName][$key]);
80 $isTextarea = preg_match(
'/^(<.*?>)?string \\(textarea\\)/i', $description) ? TRUE : FALSE;
81 $doNotRender = preg_match(
'/^(<.*?>)?string \\(exclude\\)/i', $description) ? TRUE : FALSE;
83 if (!is_array($value) && !$doNotRender && (!preg_match(
'/[' . LF . CR .
']/', $value) || $isTextarea)) {
85 $itemData[
'key'] = $key;
86 $itemData[
'description'] = $description;
88 $itemData[
'type'] =
'textarea';
89 $itemData[
'value'] = str_replace(array(
'\'.chr(10).\
'',
'\' . LF . \
''), array(LF, LF), $value);
90 } elseif (preg_match(
'/^(<.*?>)?boolean/i', $description)) {
91 $itemData[
'type'] =
'checkbox';
92 $itemData[
'value'] = $value ?
'1' :
'0';
93 $itemData[
'checked'] = (boolean)$value;
95 $itemData[
'type'] =
'input';
96 $itemData[
'value'] = $value;
100 if ($sectionName ===
'SYS' && in_array($key, $this->phpErrorCodesSettings)) {
101 $itemData[
'phpErrorCode'] = TRUE;
104 $data[$sectionName][] = $itemData;
116 protected function updateLocalConfigurationValues() {
117 $statusObjects = array();
118 if (isset($this->postValues[
'values']) && is_array($this->postValues[
'values'])) {
119 $configurationPathValuePairs = array();
120 $commentArray = $this->getDefaultConfigArrayComments();
121 $formValues = $this->postValues[
'values'];
122 foreach ($formValues as $section => $valueArray) {
123 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][$section])) {
124 foreach ($valueArray as $valueKey => $value) {
125 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][$section][$valueKey])) {
126 $description = trim($commentArray[$section][$valueKey]);
127 if (preg_match(
'/^string \\(textarea\\)/i', $description)) {
129 $value = str_replace(CR,
'', $value);
131 $value = str_replace(LF,
'\' . LF . \
'', $value);
133 if (preg_match(
'/^boolean/i', $description)) {
137 if (
$GLOBALS[
'TYPO3_CONF_VARS'][$section][$valueKey] === FALSE && $value ===
'0') {
139 } elseif (
$GLOBALS[
'TYPO3_CONF_VARS'][$section][$valueKey] === TRUE && $value ===
'1') {
144 if ((
string)
$GLOBALS[
'TYPO3_CONF_VARS'][$section][$valueKey] !== (
string)$value) {
145 $configurationPathValuePairs[$section .
'/' . $valueKey] = $value;
147 $status = $this->objectManager->get(
'TYPO3\\CMS\\Install\\Status\\OkStatus');
148 $status->setTitle(
'$TYPO3_CONF_VARS[\'' . $section .
'\'][\
'' . $valueKey .
'\']
'); 149 $status->setMessage('New value =
' . $value); 150 $statusObjects[] = $status; 156 if (count($statusObjects)) { 158 $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\
Configuration\\ConfigurationManager
'); 159 $configurationManager->setLocalConfigurationValuesByPathValuePairs($configurationPathValuePairs); 162 return $statusObjects; 170 protected function getDefaultConfigArrayComments() { 172 $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\
Configuration\\ConfigurationManager
'); 173 $string = GeneralUtility::getUrl($configurationManager->getDefaultConfigurationFileLocation()); 175 $commentArray = array(); 176 $lines = explode(LF, $string); 179 foreach ($lines as $lc) { 185 if (preg_match('/[
"\']([[:alnum:]_-]*)["\
'][[:space:]]*=>(.*)/i', $lc, $reg)) {
186 preg_match(
'/,[\\t\\s]*\\/\\/(.*)/i', $reg[2], $creg);
187 $theComment = trim($creg[1]);
188 if (substr(strtolower(trim($reg[2])), 0, 5) ==
'array' && $reg[1] === strtoupper($reg[1])) {
189 $mainKey = trim($reg[1]);
190 } elseif ($mainKey) {
191 $commentArray[$mainKey][$reg[1]] = $theComment;
196 if ($lc ===
'return array(') {
200 return $commentArray;
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]