Merge pull request #27328 from nextcloud/fix/noid/UserLoggedInEvent-apache-auth

emit UserLoggedInEvent on apache auth
This commit is contained in:
Christoph Wurst 2021-06-01 17:38:41 +02:00 committed by GitHub
commit 84584959b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}