The `attachment_storage` is now a secret option
authorAlexander Ebert <ebert@woltlab.com>
Fri, 12 Apr 2019 11:22:09 +0000 (13:22 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 12 Apr 2019 11:22:09 +0000 (13:22 +0200)
Closes #2891

com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/data/option/OptionEditor.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 4c21f293cb38d0ae5fe05e5321975e12fed581a3..ef2d9ec44da7ade73f3d3b1a967d52de21db97e6 100644 (file)
@@ -1015,10 +1015,6 @@ redis:wcf.acp.option.cache_source_type.redis</selectoptions>
                                <optiontype>text</optiontype>
                        </option>
                        <!-- /general.payment -->
-                       <option name="attachment_storage">
-                               <categoryname>message.attachment</categoryname>
-                               <optiontype>text</optiontype>
-                       </option>
                        <option name="attachment_enable_thumbnails">
                                <categoryname>message.attachment</categoryname>
                                <optiontype>boolean</optiontype>
@@ -1730,6 +1726,7 @@ DESC:wcf.global.sortOrder.descending</selectoptions>
                </options>
        </import>
        <delete>
+               <option name="attachment_storage" />
                <option name="module_attachment"/>
        </delete>
 </data>
index fe84df28cee709174f4a392358acd8d4cb177a31..25601d139c383b260d5f714d1daee2ae9dc74239 100644 (file)
@@ -141,8 +141,13 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject
                // file header
                $writer->write("<?php\n/**\n* generated at ".gmdate('r')."\n*/\n");
                
+               // Secret options cannot be enabled through the regular options, they need to be manually
+               // defined in the Core's `config.inc.php` to be activated.
+               $attachmentStorage = new Option(null, ['optionName' => 'attachment_storage', 'optionType' => 'text', 'optionValue' => null]);
+               $secretOptions = [$attachmentStorage->getConstantName() => $attachmentStorage];
+               
                // get all options
-               $options = Option::getOptions();
+               $options = $secretOptions + Option::getOptions();
                foreach ($options as $optionName => $option) {
                        $writeValue = $option->optionValue;
                        if ($writeValue === null) {
index 17199487fcd20f2be2a6960598be7761df633bcc..8554e39893a778c8e52dd028ef021363b1252bf6 100644 (file)
@@ -1383,8 +1383,6 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in
                <item name="wcf.acp.option.attachment_retain_dimensions"><![CDATA[Bildformat beim Erzeugen von Vorschaugrafiken beibehalten]]></item>
                <item name="wcf.acp.option.attachment_thumbnail_height"><![CDATA[Höhe der Vorschaugrafiken]]></item>
                <item name="wcf.acp.option.attachment_thumbnail_width"><![CDATA[Breite der Vorschaugrafiken]]></item>
-               <item name="wcf.acp.option.attachment_storage"><![CDATA[Speicherort der Dateianhänge]]></item>
-               <item name="wcf.acp.option.attachment_storage.description"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du kannst{else}Sie können{/if} optional einen vom Standard abweichenden Speicherort für die Dateianhänge definieren. Bereits existierende Dateianhänge müssen bei einer Änderung des Speicherortes manuell in den neuen Ort übertragen werden.]]></item>
                <item name="wcf.acp.option.module_attachment"><![CDATA[Dateianhänge]]></item>
                <item name="wcf.acp.option.module_smiley"><![CDATA[Smileys]]></item>
                <item name="wcf.acp.option.category.message.censorship"><![CDATA[Zensur-Funktion]]></item>
index 0dea3f0ad6c458e0e43ada6b0d7b1f8ae8b42b7b..858685c082e5e8fca06b4b5c311c438eb90f448d 100644 (file)
@@ -1360,8 +1360,6 @@ This protocol file contains {$data[count]} new entries. The first three error me
                <item name="wcf.acp.option.attachment_retain_dimensions"><![CDATA[Retain thumbnail dimensions]]></item>
                <item name="wcf.acp.option.attachment_thumbnail_height"><![CDATA[Thumbnail Height]]></item>
                <item name="wcf.acp.option.attachment_thumbnail_width"><![CDATA[Thumbnail Width]]></item>
-               <item name="wcf.acp.option.attachment_storage"><![CDATA[Storage Location]]></item>
-               <item name="wcf.acp.option.attachment_storage.description"><![CDATA[You can specify a different storage location for attachments. Attention! You are responsible to move any existing attachments to the new storage location.]]></item>
                <item name="wcf.acp.option.module_attachment"><![CDATA[Attachments]]></item>
                <item name="wcf.acp.option.module_smiley"><![CDATA[Smilies]]></item>
                <item name="wcf.acp.option.category.message.censorship"><![CDATA[Censorship]]></item>