Currently
Initiating masquerade: "User DestinationUser masqueraded as DestinationUser."
Terminating masquerade: "User SourceUser stopped masquerading as SourceUser."
Must be
Initiating masquerade: "User SourceUser masqueraded as DestinationUser."
Terminating masquerade: "User SourceUser stopped masquerading as DestinationUser."
Problem
Variable $account is changed by ...->setAccount();
$account = $this->currentUser;
...
$this->currentUser->setAccount($new_user);
...
$this->logger->info(..., $account->getDisplayName() );
Solution
- $account = $this->currentUser;
+ $account = $this->currentUser->getAccount();
Comments
Comment #2
ragnarkurm commentedComment #3
ragnarkurm commentedComment #4
andypostComment #5
hgoto commentedI tested the patch #2 and I confirmed it fixes the issue. It's simple and I'd like to move this to RTBC.
The following is off-topic. How about changing the variable name for more code readability? For example, in the method
switchTo(), the variable$accountmeans the original account that going to masquerade another user. So$original_accountis more easy-to-understand name thanaccount, I think. But this may be against the policy or something. I'd like to hear other opinion.Comment #7
andypostThanx, commited and pushed!
@hgoto Please file new issue, I think
$target_accountis nicely describes the target of the function but probably better to extend code comments and change local variable names - suggestions are welcome in separate issue)Comment #8
hgoto commented@andypost, thank you for your reaction. I see. I understood! I'll file a new issue.