-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: Add all rights to cron and manage session values for CronTask #17699
fix: Add all rights to cron and manage session values for CronTask #17699
Conversation
Maybe time to revisit #14652 to design a more controlled way to handle when we need to selectively ignore permission checks/have more than the user's current permissions. The method of changing the rights in the session is sketchy because if the crontask is running in the user's session, you could end up with the session being saved with the changed permissions (if the script exits early). |
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.
When running cron in glpi
mode (where the cron is called using an ajax call to front/cron.php
), isn't there a risk that if a fatal error occur the user is stuck with the wrong session data as it would not be restored ?
If so, would it be safe to use session_write_close()
at the start of front/cron.php
to prevent this ?
Probably. Although, I don't think it makes sense that the user's session would have been opened to begin with or that a new session would be created. |
The solution is to call |
ff5f5cd
to
07beb45
Compare
for the current need (and issue in !34188), I may be wrong, but I think I'm ok with the current changes. Anyway, BEFORE the release of 11.0, we need a solution for the workflow plugin @cedric-anne @cconard96 . |
07beb45
to
117087f
Compare
117087f
to
3692dce
Compare
Co-authored-by: Stanislas <skita@teclib.com>
The ticket in question reported a problem with the sending of SLA reminders.
The notification was not being generated and fatal errors were interrupting the notification generation mechanism due to undefined variables (
glpiname
andglpigroups
in this case).Access rights to GLPI objects were blocking the notification filter system, which was unable to find the objects due to a lack of rights.