Revert "Add PoC event listeners for authentication events"
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 7 Jun 2021 08:24:53 +0000 (10:24 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 7 Jun 2021 11:51:07 +0000 (13:51 +0200)
This was a PoC commit. It is reverted so that it remains in the commit history.

This reverts commit 5c8dc3b07bc3ad128975f7378744be58037b42ef.

com.woltlab.wcf/eventListener.xml
wcfsetup/install/files/lib/system/event/listener/UserLoggedInEmailNotificationListener.class.php [deleted file]
wcfsetup/install/files/lib/system/event/listener/UserMultifactorSucceededEmailNotificationListener.class.php [deleted file]

index a3fddcea1aa26e5df40e38b5c2c07766115817dd..e7beec0941fe1e491392ad17104ec35cfce71b71 100644 (file)
                        <listenerclassname>wcf\system\event\listener\UserLinkHtmlInputNodeProcessorListener</listenerclassname>
                        <environment>all</environment>
                </eventlistener>
-               <eventlistener name="userLoggedInEmailNotification">
-                       <eventclassname>wcf\system\user\authentication\UserLoggedIn</eventclassname>
-                       <eventname>:default</eventname>
-                       <listenerclassname>wcf\system\event\listener\UserLoggedInEmailNotificationListener</listenerclassname>
-                       <environment>all</environment>
-               </eventlistener>
-               <eventlistener name="userMultifactorSucceededEmailNotification">
-                       <eventclassname>wcf\system\user\authentication\UserMultifactorSucceeded</eventclassname>
-                       <eventname>:default</eventname>
-                       <listenerclassname>wcf\system\event\listener\UserMultifactorSucceededEmailNotificationListener</listenerclassname>
-                       <environment>all</environment>
-               </eventlistener>
        </import>
 </data>
diff --git a/wcfsetup/install/files/lib/system/event/listener/UserLoggedInEmailNotificationListener.class.php b/wcfsetup/install/files/lib/system/event/listener/UserLoggedInEmailNotificationListener.class.php
deleted file mode 100644 (file)
index 7d8ce06..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-namespace wcf\system\event\listener;
-
-use wcf\system\email\SimpleEmail;
-use wcf\system\user\authentication\UserLoggedIn;
-
-/**
- * Sends a notification email when the user logs in.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2021 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\System\Event\Listener
- */
-final class UserLoggedInEmailNotificationListener implements IParameterizedEventListener
-{
-    /**
-     * @inheritDoc
-     * @param UserLoggedIn $eventObj
-     */
-    public function execute($eventObj, $className, $eventName, array &$parameters)
-    {
-        $email = new SimpleEmail();
-        $email->setRecipient($eventObj->getUser());
-        $email->setSubject("You logged in");
-        $email->setMessage("You logged in");
-        $email->setHtmlMessage("You logged in");
-        $email->send();
-    }
-}
diff --git a/wcfsetup/install/files/lib/system/event/listener/UserMultifactorSucceededEmailNotificationListener.class.php b/wcfsetup/install/files/lib/system/event/listener/UserMultifactorSucceededEmailNotificationListener.class.php
deleted file mode 100644 (file)
index 17cac35..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-namespace wcf\system\event\listener;
-
-use wcf\system\email\SimpleEmail;
-use wcf\system\user\authentication\UserMultifactorSucceeded;
-
-/**
- * Sends a notification email when the user performs MF authentication.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2021 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\System\Event\Listener
- */
-final class UserMultifactorSucceededEmailNotificationListener implements IParameterizedEventListener
-{
-    /**
-     * @inheritDoc
-     * @param UserMultifactorSucceeded $eventObj
-     */
-    public function execute($eventObj, $className, $eventName, array &$parameters)
-    {
-        $email = new SimpleEmail();
-        $email->setRecipient($eventObj->getUser());
-        $email->setSubject("You performed MFA with {$eventObj->getSetup()->getObjectType()->objectType}");
-        $email->setMessage("You performed MFA with {$eventObj->getSetup()->getObjectType()->objectType}");
-        $email->setHtmlMessage("You performed MFA with {$eventObj->getSetup()->getObjectType()->objectType}");
-        $email->send();
-    }
-}