Added notification mail when users are activated by an administrator
authorMarcel Werk <burntime@woltlab.com>
Sat, 5 Jul 2014 12:49:05 +0000 (14:49 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 5 Jul 2014 12:49:05 +0000 (14:49 +0200)
wcfsetup/install/files/lib/data/user/UserAction.class.php
wcfsetup/install/files/lib/form/RegisterActivationForm.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 18e9555a88633e62571bfe13b7e4dbd91491c128..a32fc493c513bd37a52015f46164762e19d7b30a 100644 (file)
@@ -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();
        }
        
index 92a6c82c592277615c4d979878aa91a0efdea142..fd5ba71b1e341cf12c7f0653be59f97d3e2fa423 100644 (file)
@@ -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();
                
index 1e7b8a36c9494d6c49c7ab1cd9b7ff02dcafc7f6..b2f1186a41e0951c25afa5958184f326cec181cf 100644 (file)
@@ -1597,6 +1597,11 @@ Klicken Sie hier, um sich mit Ihrem neuen Kennwort anzumelden: {link controller=
                <item name="wcf.acp.user.authentication.failure.environment.user"><![CDATA[Benutzer]]></item>
                <item name="wcf.acp.user.authentication.failure.environment.admin"><![CDATA[Administration]]></item>
                <item name="wcf.acp.user.authentication.failure.time"><![CDATA[Datum]]></item>
+               <item name="wcf.acp.user.activation.mail"><![CDATA[Hallo {@$username},
+
+Ihr Benutzerkonto auf der Website: {@PAGE_TITLE|language} wurde vom Administrator freigeschaltet.
+Sie können jetzt den vollen Funktionsumfang der Seite nutzen.]]></item>
+               <item name="wcf.acp.user.activation.mail.subject"><![CDATA[Ihr Benutzerkonto auf der Website: {@PAGE_TITLE|language} wurde freigeschaltet]]></item>
        </category>
        
        <category name="wcf.acp.worker">
index 7feeb6f4cf9d5859ede16a0b158dc1116e0ab087..ab8369ddd58214617ac02f2ad768689e55ebfe38 100644 (file)
@@ -1566,6 +1566,11 @@ Login with your new password: {link controller='Login' isEmail=true}{/link}]]></
                <item name="wcf.acp.user.authentication.failure.environment.user"><![CDATA[TODO: Benutzer]]></item>
                <item name="wcf.acp.user.authentication.failure.environment.admin"><![CDATA[TODO: Administration]]></item>
                <item name="wcf.acp.user.authentication.failure.time"><![CDATA[TODO: Datum]]></item>
+               <item name="wcf.acp.user.activation.mail"><![CDATA[TODO: Hallo {@$username},
+
+Ihr Benutzerkonto auf der Website: {@PAGE_TITLE|language} wurde vom Administrator freigeschaltet.
+Sie können jetzt den vollen Funktionsumfang der Seite nutzen.]]></item>
+               <item name="wcf.acp.user.activation.mail.subject"><![CDATA[TODO: Ihr Benutzerkonto auf der Website: {@PAGE_TITLE|language} wurde freigeschaltet]]></item>
        </category>
        
        <category name="wcf.acp.worker">