Skip to content
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

Log Manager login #12455

Merged
merged 2 commits into from
Jun 10, 2015
Merged

Log Manager login #12455

merged 2 commits into from
Jun 10, 2015

Conversation

sottwell
Copy link
Contributor

Added a parameter to the logManagerAction function and use it to set the userId property. Add a call to the logManagerAction function in login.class.php using the new parameter.

When a user is first logged in, invoking the OnManagerLogin event, the user object is already instantiated as the "anonymous" user with the userId of 0. So there is no way for the logManagerAction function to have the newly logged-in user's Id. The event would be logged in the database, but with a userId of 0, and of course could not be meaningfully displayed in the Manager Actions list.

By being able to pass the userId to the API function, and having that passed value override the default property of 0, now the login.class.php file or even a plugin using the OnManagerLogin event.

Because the new parameter is added to the end of the parameter list in the function definition, it can be ignored in a function call, so this is backwards-compatible and does not affect existing usage.

Susan Ottwell added 2 commits May 23, 2015 16:54
Add a line to trigger logManagerAction with an extra parameter to pass
the user ID
Add a parameter userId to the logManagerAction function definition so
it can be passed in to allow calling when the user object is not yet
updated
@sottwell sottwell changed the title Log login Log Manager login May 23, 2015
@theboxer
Copy link
Member

Hello @sottwell
I don't think that it's necessary to update logManagerAction method to achieve logging logins.
You can do it via:

$this->modx->logManagerAction('login_mgr','modUser',$this->user->get('id'));

Do you agree with this change?

@theboxer theboxer self-assigned this Jun 10, 2015
@sottwell
Copy link
Contributor Author

Whatever works. You certainly know the core better than I do.

@theboxer
Copy link
Member

Actually no, it does not work, I see the problem you are solving with the additional param now

@theboxer theboxer added this to the v2.4.0-pl milestone Jun 10, 2015
@theboxer theboxer merged commit 2f697bb into modxcms:develop Jun 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants