emit UserLoggedInEvent on apache auth

- post_login OC_Hook is barely used or listened to

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-06-01 13:59:40 +02:00 committed by backportbot[bot]
parent 25c24c2b6e
commit 2e57360a0d
1 changed files with 12 additions and 0 deletions

View File

@ -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);
}