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.
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
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
En poursuivant votre navigation, vous acceptez le dépôt de cookies tiers destinés au bon fonctionnement et à la sécurisation du site (gestion de session, reCaptcha) et à une analyse statistique anonymisée des accès sur notre site (Google Analytics). Si vous vous inscrivez, les informations que vous fournirez ne seront jamais divulguées à un tiers sous quelque forme que ce soit. En savoir plus
Cookies settings
×
Functional Cookies
Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.
Session
Please login to see yours activities!
Other cookies
Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.