From: Marcel Werk Date: Sat, 5 Jul 2014 12:49:05 +0000 (+0200) Subject: Added notification mail when users are activated by an administrator X-Git-Tag: 2.1.0_Alpha_1~618 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=11dccf1c30bfdf0851d53cf2917d1a352e8c4f38;p=GitHub%2FWoltLab%2FWCF.git Added notification mail when users are activated by an administrator --- diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index 18e9555a88..a32fc493c5 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -12,6 +12,7 @@ use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\event\EventHandler; use wcf\system\exception\PermissionDeniedException; use wcf\system\exception\UserInputException; +use wcf\system\mail\Mail; use wcf\system\request\RequestHandler; use wcf\system\WCF; use wcf\util\UserRegistrationUtil; @@ -550,6 +551,16 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio )); $action->executeAction(); + // send e-mail notification + if (!empty($this->parameters['skipNotification'])) { + foreach ($this->objects as $user) { + $mail = new Mail(array($user->username => $user->email), $user->getLanguage()->getDynamicVariable('wcf.acp.user.activation.mail.subject'), $user->getLanguage()->getDynamicVariable('wcf.acp.user.activation.mail', array( + 'username' => $user->username + ))); + $mail->send(); + } + } + $this->unmarkItems(); } diff --git a/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php b/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php index 92a6c82c59..fd5ba71b1e 100644 --- a/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php @@ -79,7 +79,7 @@ class RegisterActivationForm extends AbstractForm { parent::save(); // enable user - $this->objectAction = new UserAction(array($this->user), 'enable'); + $this->objectAction = new UserAction(array($this->user), 'enable', array('skipNotification' => true)); $this->objectAction->executeAction(); $this->saved(); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 1e7b8a36c9..b2f1186a41 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1597,6 +1597,11 @@ Klicken Sie hier, um sich mit Ihrem neuen Kennwort anzumelden: {link controller= + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 7feeb6f4cf..ab8369ddd5 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1566,6 +1566,11 @@ Login with your new password: {link controller='Login' isEmail=true}{/link}]]> + +