Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-12-18 16:46:41 +0300
committerJoas Schilling <coding@schilljs.com>2021-01-20 10:50:17 +0300
commit6c1e294edd7389c8ecffdd2ead2534bf9972c64f (patch)
tree4e8182e2d3b948990f5310e0f2524fed41f6ba1a /lib
parent831c807eafa7887eb7072513b4413b8c2a8d102b (diff)
Compare and store the login name via the event
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Server.php2
-rw-r--r--lib/public/User/Events/UserLoggedInEvent.php13
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 1114e60f475..ba954165799 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -575,7 +575,7 @@ class Server extends ServerContainer implements IServerContainer {
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->get(IEventDispatcher::class);
- $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin));
+ $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin));
});
$userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
/** @var IEventDispatcher $dispatcher */
diff --git a/lib/public/User/Events/UserLoggedInEvent.php b/lib/public/User/Events/UserLoggedInEvent.php
index e2cb37a64dc..7d0c0bf41de 100644
--- a/lib/public/User/Events/UserLoggedInEvent.php
+++ b/lib/public/User/Events/UserLoggedInEvent.php
@@ -43,14 +43,18 @@ class UserLoggedInEvent extends Event {
/** @var bool */
private $isTokenLogin;
+ /** @var string */
+ private $loginName;
+
/**
* @since 18.0.0
*/
- public function __construct(IUser $user, string $password, bool $isTokenLogin) {
+ public function __construct(IUser $user, string $loginName, string $password, bool $isTokenLogin) {
parent::__construct();
$this->user = $user;
$this->password = $password;
$this->isTokenLogin = $isTokenLogin;
+ $this->loginName = $loginName;
}
/**
@@ -61,6 +65,13 @@ class UserLoggedInEvent extends Event {
}
/**
+ * @since 21.0.0
+ */
+ public function getLoginName(): string {
+ return $this->loginName;
+ }
+
+ /**
* @since 18.0.0
*/
public function getPassword(): string {