ProjeQtOr free project management software - Cron.php session user is the last logged in user - ProjeQtOr
 

Cron.php session user is the last logged in user

More
02 Jan 2020 18:33 #1 by burgerzs
Hi,

It seems to me that Background tasks are scheduled with Cron, then the parameters that are read will belong to the last logged in user instead of the admin user.

This causes problems, because if the logged in user has Not Receive His Emails set to Yes, then when new objects (eg. Ticktes) are created then an email won't be sent.

Is it possible to change this behaviour?

Regards,
Zsolt

Please Connexion or Create an account to join the conversation.

More
02 Jan 2020 18:50 #2 by babynus
If I remember correctly, cronned email are sent as admin.
But you're right, if admin has set "Not Receive His Emails" to Ys, emails may not be sent.

Ticket #4408 recorded.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
02 Jan 2020 19:00 #3 by burgerzs
I logged the session user from Cron.php with:
$tmp_uid=getSessionUser()->id;
debugTraceLog("SessionUserId: $tmp_uid");
$tmp_sid=session_id();
debugTraceLog("SessionId: $tmp_sid");


When I started the session with the admin user, I got:
2020-01-02 18:44:46.454
DEBUG
SessionUserId: 1
2020-01-02 18:44:46.454
DEBUG
SessionId: 7oh8hl08rs9csam21r1d73io9j

After I logged in with user no. 7, I got:
2020-01-02 18:55:10.430
DEBUG
SessionUserId: 7
2020-01-02 18:55:10.430
DEBUG
SessionId: jelaud20d00savspok904u1bqs

Regards,
Zsolt

Please Connexion or Create an account to join the conversation.

More
02 Jan 2020 19:08 #4 by burgerzs
It seems to me that when I log in in with a new user, then the cron session is restarted:
2020-01-02 19:06:53.543 ..... SCRIPT .... 172.29.25.180 =====/projeqtor/view/menuNotificationRead.php
2020-01-02 19:06:53.548 ..... SCRIPT .... 172.29.25.180 Page=menuNotificationRead.php
2020-01-02 19:06:53.548 ..... SCRIPT .... 172.29.25.180 refreshParameters()
2020-01-02 19:06:53.556 ..... SCRIPT .... 172.29.25.180 getProfile(objectOrIdProject=Audit #452)
2020-01-02 19:06:53.556 ..... SCRIPT .... 172.29.25.180 getProfile(objectOrIdProject=Audit #452)
2020-01-02 19:06:57.274
DEBUG
Cron possibly running twice
2020-01-02 19:06:57.275
DEBUG
current process ID is 879
2020-01-02 19:06:57.275
DEBUG
current unique ID is 5e0e30cec37667.39453628
2020-01-02 19:06:57.275
DEBUG
running process ID is 29931
2020-01-02 19:06:57.275
DEBUG
running unique ID is 5e0e313d0a4ce1.50314662
2020-01-02 19:06:57.275
DEBUG
=> stopping current Cron
2020-01-02 19:06:57.825 ..... SCRIPT .... 172.29.25.180 Page=checkAlertToDisplay.php

Please Connexion or Create an account to join the conversation.

More
04 Jan 2020 08:29 #5 by burgerzs

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.031 seconds