summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-06-01 13:59:40 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-06-01 15:41:04 +0000
commit2e57360a0d795fbfec1b0fd60554c7020d83ee26 (patch)
tree9aa2625bac17989a531e454f027b0852c884eaae /lib
parent25c24c2b6e48d159406d57cf0d858a89666cefee (diff)
downloadnextcloud-server-2e57360a0d795fbfec1b0fd60554c7020d83ee26.tar.gz
nextcloud-server-2e57360a0d795fbfec1b0fd60554c7020d83ee26.zip
emit UserLoggedInEvent on apache auth
- post_login OC_Hook is barely used or listened to Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/legacy/OC_User.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php
index c8d9b51eaba..3638a32589d 100644
--- a/lib/private/legacy/OC_User.php
+++ b/lib/private/legacy/OC_User.php
@@ -36,7 +36,10 @@
*
*/
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\ILogger;
+use OCP\IUserManager;
+use OCP\User\Events\UserLoggedInEvent;
/**
* This class provides wrapper methods for user management. Multiple backends are
@@ -186,6 +189,15 @@ class OC_User {
'isTokenLogin' => false,
]
);
+ /** @var IEventDispatcher $dispatcher */
+ $dispatcher = \OC::$server->get(IEventDispatcher::class);
+ $dispatcher->dispatchTyped(new UserLoggedInEvent(
+ \OC::$server->get(IUserManager::class)->get($uid),
+ $uid,
+ '',
+ false)
+ );
+
//trigger creation of user home and /files folder
\OC::$server->getUserFolder($uid);
}