<header class="contentHeader">
<div class="contentHeaderTitle">
<h1 class="contentTitle">{lang}wcf.acp.firstTimeSetup.options{/lang}</h1>
- <p class="contentHeaderDescription">{lang}wcf.acp.firstTimeSetup.options.description{/lang}</p>
</div>
</header>
--- /dev/null
+{include file='header' pageTitle='wcf.acp.firstTimeSetup.optionsEmail'}
+
+{event name='javascriptInclude'}
+
+<script data-relocate="true">
+ $(function() {
+ new WCF.Option.Handler();
+ });
+
+ {event name='javascriptInit'}
+</script>
+
+<header class="contentHeader">
+ <div class="contentHeaderTitle">
+ <h1 class="contentTitle">{lang}wcf.acp.firstTimeSetup.optionsEmail{/lang}</h1>
+ </div>
+</header>
+
+{if $success|isset}
+ <p class="success">{lang}wcf.global.success.edit{/lang}</p>
+{/if}
+
+{include file='formError'}
+
+<form method="post" action="{link controller='FirstTimeSetupOptionsEmail'}{/link}" enctype="multipart/form-data">
+ {include file='optionFieldList' langPrefix='wcf.acp.option.'}
+
+ <div class="formSubmit">
+ <input type="submit" value="{lang}wcf.global.button.submit{/lang}" name="__submit" accesskey="s">
+ {csrfToken}
+ </div>
+</form>
+
+{include file='footer'}
$controller = match (\FIRST_TIME_SETUP_STATE) {
0 => FirstTimeSetupLicenseForm::class,
1 => FirstTimeSetupOptionsForm::class,
+ 2 => FirstTimeSetupOptionsEmailForm::class,
default => FirstTimeSetupCompletedPage::class
};
--- /dev/null
+<?php
+
+namespace wcf\acp\form;
+
+use wcf\data\option\Option;
+use wcf\data\option\OptionAction;
+use wcf\system\exception\PermissionDeniedException;
+use wcf\system\option\OptionHandler;
+use wcf\system\request\LinkHandler;
+use wcf\system\WCF;
+use wcf\util\HeaderUtil;
+
+/**
+ * Shows email options during first time setup.
+ *
+ * @author Tim Duesterhus, Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ *
+ * @property OptionHandler $optionHandler
+ */
+final class FirstTimeSetupOptionsEmailForm extends AbstractOptionListForm
+{
+ /**
+ * @inheritDoc
+ */
+ public $neededPermissions = ['admin.configuration.canEditOption'];
+
+ /**
+ * list of options
+ * @var array
+ */
+ public $options = [];
+
+ /**
+ * @var string[]
+ */
+ public $optionNames = [
+ 'mail_from_name',
+ 'mail_from_address',
+ 'mail_admin_address',
+ 'module_contact_form',
+ ];
+
+ /**
+ * @inheritDoc
+ */
+ public function readParameters()
+ {
+ parent::readParameters();
+
+ if (\FIRST_TIME_SETUP_STATE == -1) {
+ throw new PermissionDeniedException();
+ }
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function initOptionHandler()
+ {
+ parent::initOptionHandler();
+
+ $this->optionHandler->filterOptions($this->optionNames);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function readData()
+ {
+ parent::readData();
+
+ foreach ($this->optionNames as $optionName) {
+ $this->options[] = $this->optionHandler->getSingleOption($optionName);
+ }
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function save()
+ {
+ parent::save();
+
+ $saveOptions = $this->optionHandler->save('wcf.acp.option', 'wcf.acp.option.option');
+ $saveOptions[Option::getOptionByName('first_time_setup_state')->optionID] = 3;
+ $this->objectAction = new OptionAction([], 'updateAll', ['data' => $saveOptions]);
+ $this->objectAction->executeAction();
+ $this->saved();
+
+ \http_response_code(303);
+ HeaderUtil::redirect(LinkHandler::getInstance()->getControllerLink(
+ FirstTimeSetupAction::class,
+ ));
+
+ exit;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function assignVariables()
+ {
+ parent::assignVariables();
+
+ WCF::getTPL()->assign([
+ 'options' => $this->options,
+ 'optionNames' => $this->optionNames,
+ ]);
+ }
+}
use wcf\util\HeaderUtil;
/**
- * Shows the option edit form.
+ * Shows general options during first time setup.
*
- * @author Alexander Ebert
+ * @author Tim Duesterhus, Alexander Ebert
* @copyright 2001-2023 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*
public $optionNames = [
'page_title',
'timezone',
- 'mail_from_name',
- 'mail_from_address',
- 'mail_admin_address',
- 'module_contact_form',
];
/**
<item name="wcf.acp.firstTimeSetup.license.noCredentialsConfirm"><![CDATA[Ohne Eingabe der Lizenzdaten fortfahren]]></item>
<item name="wcf.acp.firstTimeSetup.license.explanation"><![CDATA[<p>Die Eingabe von Lizenzdaten ist zur Installation und zur Aktualisierung der gekauften WoltLab Suite™-Apps erforderlich.</p>]]></item>
<item name="wcf.acp.firstTimeSetup.license.noCredentialsConfirm.description"><![CDATA[Die Eingabe der Lizenzdaten wird empfohlen. Falls noch keine Internetverbindung zu unseren Paket-Servern zur Verfügung steht oder Sie noch keine Lizenzdaten besitzen, können Sie die Eingabe überspringen. Lizenzdaten können jederzeit hinterlegt werden, um die gekauften WoltLab Suite™-Apps zu installieren.]]></item>
- <item name="wcf.acp.firstTimeSetup.options"><![CDATA[Erstmalige Einrichtung: Einstellungen]]></item>
- <item name="wcf.acp.firstTimeSetup.options.description"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Konfiguriere{else}Konfigurieren Sie{/if} die wichtigsten Einstellungen, diese können auch später über die Optionen verändert werden.]]></item>
+ <item name="wcf.acp.firstTimeSetup.options"><![CDATA[Erstmalige Einrichtung: Allgemeine Einstellungen]]></item>
+ <item name="wcf.acp.firstTimeSetup.optionsEmail"><![CDATA[Erstmalige Einrichtung: E-Mail-Einstellungen]]></item>
<item name="wcf.acp.firstTimeSetup.completed"><![CDATA[Erstmalige Einrichtung abgeschlossen]]></item>
</category>
<category name="wcf.acp.group">
<item name="wcf.acp.firstTimeSetup.license.noCredentialsConfirm"><![CDATA[Continue without entering license information]]></item>
<item name="wcf.acp.firstTimeSetup.license.explanation"><![CDATA[<p>Entering license credentials is required to install and update the purchased WoltLab Suite™ Apps.</p>]]></item>
<item name="wcf.acp.firstTimeSetup.license.noCredentialsConfirm.description"><![CDATA[Entering license information is recommended. If no network connection to our package servers is available yet, or if you do not yet have license information, you can skip this step. License information can be entered at any time to install purchased WoltLab Suite™ Apps.]]></item>
- <item name="wcf.acp.firstTimeSetup.options"><![CDATA[First Time Setup: Settings]]></item>
- <item name="wcf.acp.firstTimeSetup.options.description"><![CDATA[Configure the most important settings now, you can change them later at any time.]]></item>
+ <item name="wcf.acp.firstTimeSetup.options"><![CDATA[First Time Setup: General Settings]]></item>
+ <item name="wcf.acp.firstTimeSetup.optionsEmail"><![CDATA[First Time Setup: Email Settings]]></item>
<item name="wcf.acp.firstTimeSetup.completed"><![CDATA[First Time Setup Completed]]></item>
</category>
<category name="wcf.acp.group">