<title>Kennwort vergessen</title>
</content>
</page>
- <page identifier="com.woltlab.wcf.Mail">
- <pageType>system</pageType>
- <controller>wcf\form\MailForm</controller>
- <name language="de">E-Mail-Formular</name>
- <name language="en">Mail Form</name>
- <requireObjectID>1</requireObjectID>
- <content language="en">
- <title>Mail Form</title>
- </content>
- <content language="de">
- <title>E-Mail-Formular</title>
- </content>
- </page>
<page identifier="com.woltlab.wcf.NewPassword">
<pageType>system</pageType>
<controller>wcf\form\NewPasswordForm</controller>
</content>
</page>
</import>
+ <delete>
+ <page identifier="com.woltlab.wcf.Mail" />
+ </delete>
</data>
+++ /dev/null
-{include file='header'}
-
-{include file='formError'}
-
-<form method="post" action="{link controller='Mail' object=$user}{/link}">
- <section class="section">
- <h2 class="sectionTitle">{lang}wcf.user.mail.information{/lang}</h2>
-
- <dl{if $errorField == 'subject'} class="formError"{/if}>
- <dt><label for="subject">{lang}wcf.user.mail.subject{/lang}</label></dt>
- <dd>
- <input type="text" id="subject" name="subject" value="{$subject}" required class="long">
- {if $errorField == 'subject'}
- <small class="innerError">
- {if $errorType == 'empty'}
- {lang}wcf.global.form.error.empty{/lang}
- {else}
- {lang}wcf.user.mail.subject.error.{@$errorType}{/lang}
- {/if}
- </small>
- {/if}
- </dd>
- </dl>
-
- {if $__wcf->user->userID}
- <dl>
- <dt></dt>
- <dd><label><input type="checkbox" name="showAddress" value="1"{if $showAddress == 1} checked{/if}> {lang}wcf.user.mail.showAddress{/lang}</label></dd>
- </dl>
- {else}
- <dl{if $errorField == 'email'} class="formError"{/if}>
- <dt><label for="email">{lang}wcf.user.mail.senderEmail{/lang}</label></dt>
- <dd>
- <input type="email" id="email" name="email" value="{$email}" required class="medium">
- {if $errorField == 'email'}
- <small class="innerError">
- {if $errorType == 'empty'}
- {lang}wcf.global.form.error.empty{/lang}
- {elseif $errorType == 'invalid'}
- {lang}wcf.user.email.error.invalid{/lang}
- {else}
- {lang}wcf.user.mail.senderEmail.error.{@$errorType}{/lang}
- {/if}
- </small>
- {/if}
- </dd>
- </dl>
- {/if}
-
- {event name='informationFields'}
- </section>
-
- <section class="section">
- <h2 class="sectionTitle">{lang}wcf.user.mail.message{/lang}</h2>
-
- <dl class="wide{if $errorField == 'message'} formError{/if}">
- <dd>
- <textarea rows="15" cols="40" name="message" id="message" required>{$message}</textarea>
- {if $errorField == 'message'}
- <small class="innerError">
- {if $errorType == 'empty'}
- {lang}wcf.global.form.error.empty{/lang}
- {else}
- {lang}wcf.user.mail.message.error.{@$errorType}{/lang}
- {/if}
- </small>
- {/if}
- </dd>
- </dl>
-
- {event name='messageFields'}
- </section>
-
- {event name='sections'}
-
- {include file='captcha' supportsAsyncCaptcha=true}
-
- <div class="formSubmit">
- <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
- {@SECURITY_TOKEN_INPUT_TAG}
- </div>
-</form>
-
-{include file='footer'}
{if $user->userID != $__wcf->user->userID}
{if $user->isAccessible('canViewEmailAddress') || $__wcf->session->getPermission('admin.user.canEditMailAddress')}
<li><a href="mailto:{@$user->getEncodedEmail()}">{lang}wcf.user.button.mail{/lang}</a></li>
- {elseif $user->isAccessible('canMail') && $__wcf->session->getPermission('user.profile.canMail')}
- <li><a href="{link controller='Mail' object=$user}{/link}">{lang}wcf.user.button.mail{/lang}</a></li>
{/if}
{/if}
{if $user->userID != $__wcf->user->userID}
{if $user->isAccessible('canViewEmailAddress')}
<li><a class="jsTooltip" href="mailto:{@$user->getEncodedEmail()}" title="{lang}wcf.user.button.mail{/lang}"><span class="icon icon16 fa-envelope-o"></span> <span class="invisible">{lang}wcf.user.button.mail{/lang}</span></a></li>
- {elseif $user->isAccessible('canMail') && $__wcf->session->getPermission('user.profile.canMail')}
- <li><a class="jsTooltip" href="{link controller='Mail' object=$user}{/link}" title="{lang}wcf.user.button.mail{/lang}"><span class="icon icon16 fa-envelope-o"></span> <span class="invisible">{lang}wcf.user.button.mail{/lang}</span></a></li>
{/if}
{/if}
</option>
<!-- /user.signature -->
<!-- user.profile -->
- <option name="user.profile.canMail">
- <categoryname>user.profile</categoryname>
- <optiontype>boolean</optiontype>
- <defaultvalue>0</defaultvalue>
- </option>
<option name="user.profile.canChangeEmail">
<categoryname>user.profile</categoryname>
<optiontype>boolean</optiontype>
</option>
</options>
</import>
+ <delete>
+ <option name="user.profile.canMail" />
+ </delete>
</data>
<selectoptions>0:wcf.user.access.everyone
1:wcf.user.access.registered
2:wcf.user.access.following
-3:wcf.user.access.nobody</selectoptions>
- <editable>3</editable>
- </option>
- <option name="canMail">
- <categoryname>settings.privacy.messaging</categoryname>
- <optiontype>select</optiontype>
- <defaultvalue>1</defaultvalue>
- <selectoptions>0:wcf.user.access.everyone
-1:wcf.user.access.registered
-2:wcf.user.access.following
3:wcf.user.access.nobody</selectoptions>
<editable>3</editable>
</option>
</option>
</options>
</import>
+ <delete>
+ <option name="canMail" />
+ </delete>
</data>
+++ /dev/null
-<?php
-namespace wcf\form;
-use wcf\data\user\UserProfile;
-use wcf\system\cache\runtime\UserProfileRuntimeCache;
-use wcf\system\email\mime\MimePartFacade;
-use wcf\system\email\mime\RecipientAwareTextMimePart;
-use wcf\system\email\Email;
-use wcf\system\email\Mailbox;
-use wcf\system\email\UserMailbox;
-use wcf\system\exception\IllegalLinkException;
-use wcf\system\exception\PermissionDeniedException;
-use wcf\system\exception\UserInputException;
-use wcf\system\page\PageLocationManager;
-use wcf\system\request\LinkHandler;
-use wcf\system\WCF;
-use wcf\util\HeaderUtil;
-use wcf\util\StringUtil;
-use wcf\util\UserUtil;
-
-/**
- * Shows the user mail form.
- *
- * @author Marcel Werk
- * @copyright 2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\Form
- */
-class MailForm extends AbstractCaptchaForm {
- /**
- * @inheritDoc
- */
- public $useCaptcha = PROFILE_MAIL_USE_CAPTCHA;
-
- /**
- * @inheritDoc
- */
- public $forceCaptcha = true;
-
- /**
- * recipient's user id
- * @var integer
- */
- public $userID = 0;
-
- /**
- * recipient's user object
- * @var UserProfile
- */
- public $user = null;
-
- /**
- * true to add the reply-to header
- * @var boolean
- */
- public $showAddress = true;
-
- /**
- * email subject
- * @var string
- */
- public $subject = '';
-
- /**
- * email message
- * @var string
- */
- public $message = '';
-
- /**
- * sender's email address
- * @var string
- */
- public $email = '';
-
- /**
- * @inheritDoc
- */
- public $neededPermissions = ['user.profile.canMail'];
-
- /**
- * @inheritDoc
- */
- public function readParameters() {
- parent::readParameters();
-
- if (isset($_REQUEST['id'])) $this->userID = intval($_REQUEST['id']);
- $this->user = UserProfileRuntimeCache::getInstance()->getObject($this->userID);
- if ($this->user === null) {
- throw new IllegalLinkException();
- }
- // validate ignore status
- if (WCF::getUser()->userID && $this->user->isIgnoredUser(WCF::getUser()->userID)) {
- throw new PermissionDeniedException();
- }
-
- $this->canonicalURL = LinkHandler::getInstance()->getLink('Mail', ['object' => $this->user->getDecoratedObject()]);
- }
-
- /**
- * @inheritDoc
- */
- public function readFormParameters() {
- parent::readFormParameters();
-
- $this->showAddress = 0;
- if (isset($_POST['message'])) $this->message = StringUtil::trim($_POST['message']);
- if (isset($_POST['subject'])) $this->subject = StringUtil::trim($_POST['subject']);
- if (isset($_POST['email'])) $this->email = StringUtil::trim($_POST['email']);
- if (isset($_POST['showAddress'])) $this->showAddress = intval($_POST['showAddress']);
- }
-
- /**
- * @inheritDoc
- */
- public function validate() {
- if (!WCF::getUser()->userID) {
- if (empty($this->email)) {
- throw new UserInputException('email');
- }
-
- if (!UserUtil::isValidEmail($this->email)) {
- throw new UserInputException('email', 'invalid');
- }
- }
-
- if (empty($this->subject)) {
- throw new UserInputException('subject');
- }
-
- if (empty($this->message)) {
- throw new UserInputException('message');
- }
-
- parent::validate();
- }
-
- /**
- * @inheritDoc
- */
- public function save() {
- parent::save();
-
- // build message data
- $messageData = [
- 'message' => $this->message,
- 'username' => WCF::getUser()->userID ? WCF::getUser()->username : $this->email
- ];
-
- // build mail
- $email = new Email();
- $email->addRecipient(new UserMailbox($this->user->getDecoratedObject()));
- $email->setSubject($this->user->getLanguage()->getDynamicVariable('wcf.user.mail.mail.subject', [
- 'username' => WCF::getUser()->userID ? WCF::getUser()->username : $this->email,
- 'subject' => $this->subject
- ]));
- $email->setBody(new MimePartFacade([
- new RecipientAwareTextMimePart('text/html', 'email_mail', 'wcf', $messageData),
- new RecipientAwareTextMimePart('text/plain', 'email_mail', 'wcf', $messageData)
- ]));
-
- // add reply-to tag
- if (WCF::getUser()->userID) {
- if ($this->showAddress) {
- $email->setReplyTo(new UserMailbox(WCF::getUser()));
- }
- }
- else {
- $email->setReplyTo(new Mailbox($this->email));
- }
-
- // send mail
- $email->send();
- $this->saved();
-
- // forward to profile page
- HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink('User', ['object' => $this->user]), WCF::getLanguage()->getDynamicVariable('wcf.user.mail.sent', ['user' => $this->user]));
- exit;
- }
-
- /**
- * @inheritDoc
- */
- public function readData() {
- parent::readData();
-
- PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.User', $this->user->userID, $this->user);
- if (MODULE_MEMBERS_LIST) PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.MembersList');
- }
-
- /**
- * @inheritDoc
- */
- public function assignVariables() {
- parent::assignVariables();
-
- WCF::getTPL()->assign([
- 'user' => $this->user,
- 'showAddress' => $this->showAddress,
- 'message' => $this->message,
- 'subject' => $this->subject,
- 'email' => $this->email
- ]);
- }
-
- /**
- * @inheritDoc
- */
- public function show() {
- if (!$this->user->isAccessible('canMail')) {
- throw new PermissionDeniedException();
- }
-
- parent::show();
- }
-}
<item name="wcf.acp.group.option.user.profile.avatar.maxSize"><![CDATA[Maximale Dateigröße]]></item>
<item name="wcf.acp.group.option.user.profile.canChangeEmail"><![CDATA[Kann E-Mail-Adresse ändern]]></item>
<item name="wcf.acp.group.option.user.profile.canEditUserTitle"><![CDATA[Kann eigenen Benutzertitel bearbeiten]]></item>
- <item name="wcf.acp.group.option.user.profile.canMail"><![CDATA[Kann E-Mails an andere Benutzer senden]]></item>
<item name="wcf.acp.group.option.user.profile.canQuit"><![CDATA[Kann Benutzerkonto löschen]]></item>
<item name="wcf.acp.group.option.user.profile.canRename"><![CDATA[Kann Benutzernamen ändern]]></item>
<item name="wcf.acp.group.option.user.profile.canViewMembersList"><![CDATA[Kann Mitglieder-Liste sehen]]></item>
<item name="wcf.user.option.birthday"><![CDATA[Geburtstag]]></item>
<item name="wcf.user.option.birthdayShowYear"><![CDATA[Geburtsjahr im Profil anzeigen]]></item>
<item name="wcf.user.option.birthdayShowYear.description"><![CDATA[Mitglieder können dadurch {if LANGUAGE_USE_INFORMAL_VARIANT}dein{else}Ihr{/if} Alter sehen.]]></item>
- <item name="wcf.user.option.canMail"><![CDATA[Kann E-Mails senden]]></item>
<item name="wcf.user.option.canViewEmailAddress"><![CDATA[Kann E-Mail-Adresse sehen]]></item>
<item name="wcf.user.option.canViewOnlineStatus"><![CDATA[Kann Online-Status sehen]]></item>
<item name="wcf.user.option.canViewProfile"><![CDATA[Kann Benutzerprofil sehen]]></item>
<item name="wcf.user.option.searchBooleanOption"><![CDATA[Auswahl des Benutzers bei „{$option->getTitle()}“:]]></item>
</category>
<category name="wcf.user.mail">
- <item name="wcf.user.mail.information"><![CDATA[Informationen]]></item>
- <item name="wcf.user.mail.mail.subject"><![CDATA[Nachricht von {@$username}: {@$subject}]]></item>
<item name="wcf.user.mail.mail.plaintext"><![CDATA[Hallo {@$mailbox->getUser()->username},
„{@$username}“ hat {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} über die Website {@PAGE_TITLE|language} [URL:{link isEmail=true}{/link}] folgende Nachricht gesandt:
<p>„{$username}“ hat {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} über die Website <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|language}</a> folgende Nachricht gesandt:</p>
<p>{@$message|newlineToBreak}</p>]]></item>
- <item name="wcf.user.mail.message"><![CDATA[Nachricht]]></item>
- <item name="wcf.user.mail.senderEmail"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} E-Mail-Adresse]]></item>
- <item name="wcf.user.mail.sent"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} Nachricht an {$user->username} wurde erfolgreich versandt.]]></item>
- <item name="wcf.user.mail.showAddress"><![CDATA[Meine E-Mail-Adresse als Absender-Adresse benutzen. Der Empfänger kann direkt auf die Nachricht antworten.]]></item>
- <item name="wcf.user.mail.subject"><![CDATA[Betreff]]></item>
</category>
<category name="wcf.user.rank">
<item name="wcf.user.rank.administrator"><![CDATA[Administrator]]></item>
<item name="wcf.acp.group.option.user.profile.avatar.maxSize"><![CDATA[Maximum Image File Size]]></item>
<item name="wcf.acp.group.option.user.profile.canChangeEmail"><![CDATA[Can change their email address]]></item>
<item name="wcf.acp.group.option.user.profile.canEditUserTitle"><![CDATA[Can edit their user title]]></item>
- <item name="wcf.acp.group.option.user.profile.canMail"><![CDATA[Can send emails to users]]></item>
<item name="wcf.acp.group.option.user.profile.canQuit"><![CDATA[Can delete their user account]]></item>
<item name="wcf.acp.group.option.user.profile.canRename"><![CDATA[Can change their username]]></item>
<item name="wcf.acp.group.option.user.profile.canViewMembersList"><![CDATA[Can view members list]]></item>
<item name="wcf.user.option.birthday"><![CDATA[Birthday]]></item>
<item name="wcf.user.option.birthdayShowYear"><![CDATA[Display year of birth]]></item>
<item name="wcf.user.option.birthdayShowYear.description"><![CDATA[Allows users to view your age.]]></item>
- <item name="wcf.user.option.canMail"><![CDATA[Can Send Me Emails]]></item>
<item name="wcf.user.option.canViewEmailAddress"><![CDATA[Can View My Email Address]]></item>
<item name="wcf.user.option.canViewOnlineStatus"><![CDATA[Can View My Online Status]]></item>
<item name="wcf.user.option.canViewProfile"><![CDATA[Can View My Profile]]></item>
<item name="wcf.user.option.searchBooleanOption"><![CDATA[User’s selection for “{$option->getTitle()}”:]]></item>
</category>
<category name="wcf.user.mail">
- <item name="wcf.user.mail.information"><![CDATA[Details]]></item>
- <item name="wcf.user.mail.mail.subject"><![CDATA[Message From {@$username}: {@$subject}]]></item>
<item name="wcf.user.mail.mail.plaintext"><![CDATA[Dear {@$mailbox->getUser()->username},
“{@$username}” sent you a message on {@PAGE_TITLE|language} [URL:{link isEmail=true}{/link}]:
<p>„{$username}“ sent you a message on <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|language}</a>:</p>
<p>{@$message|newlineToBreak}</p>]]></item>
- <item name="wcf.user.mail.message"><![CDATA[Message]]></item>
- <item name="wcf.user.mail.senderEmail"><![CDATA[Your email address]]></item>
- <item name="wcf.user.mail.sent"><![CDATA[The message has been sent to {$user->username}.]]></item>
- <item name="wcf.user.mail.showAddress"><![CDATA[Use my email address as sender address, the recipient can directly reply to me.]]></item>
- <item name="wcf.user.mail.subject"><![CDATA[Subject]]></item>
</category>
<category name="wcf.user.rank">
<item name="wcf.user.rank.administrator"><![CDATA[Administrator]]></item>