-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ImpersonateEvents for SnappyMail (and others) #180
Conversation
Does it carry enough information to know which user is impersonated, and when impersonation finishes? It looks like to do guess work. What about having |
For me personally i don't care which user. Just "impersonate" is enough for me to force logout. I've just extended it a bit if other apps also want to use it. Just do what you think is right. |
@the-djmaze added a commit, does this work for you? I removed the legacy emitter, it should not be used anymore. It carries only some legacy bits (which should be phased out…) |
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
5028964
to
cc35951
Compare
@the-djmaze does it work for you? ^ |
I will check! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine in general
Just two suggestions
lib/Controller/LogoutController.php
Outdated
$user = $this->session->get('oldUserId'); | ||
$user = $this->userManager->get($user); | ||
$impersonator = $this->session->get('oldUserId'); | ||
$impersonator = $this->userManager->get($impersonator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend different variable names for the uid and the user object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had the same feeling and almost changed it back then. Well, almost. 👍
lib/Controller/LogoutController.php
Outdated
@@ -60,7 +66,10 @@ public function logout(string $userId): JSONResponse { | |||
); | |||
} | |||
|
|||
$this->userSession->setUser($user); | |||
$impersonatee = $this->userManager->get($userId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the more clearer distinction on the name of the Getter function on the event.
...tee vs ...tor is visually so similar. $impersonatedUser
would be more different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same gut feeling, 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, actually as i did in the Event class… =D
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
On logout i get: Further it works as expected and helps a lot! |
I'll have another look, thanks for spotting it! |
Probably needs adjustements on the impersonate_logout.js code, perhaps getting rid of jquery traces 🙈 needs more looking into |
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Latest commit fixes logout |
/backport to stable25 |
More info at #179