Skip to content
Snippets Groups Projects
Commit 8533b3eb authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

preserve global user switch in cronjob, fixes #2242

Closes #2242

Merge request studip/studip!1475
parent 331c534a
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -94,6 +94,8 @@ class SendMailNotificationsJob extends CronJob
*/
public function execute($last_result, $parameters = [])
{
$cli_user = $GLOBALS['user'];
$notification = new ModulesNotification();
$query = "SELECT DISTINCT user_id
......@@ -112,6 +114,8 @@ class SendMailNotificationsJob extends CronJob
return;
}
$GLOBALS['user'] = new Seminar_user($user);
$ok = false;
$mailmessage = $notification->getAllNotifications($user->id);
......@@ -135,5 +139,7 @@ class SendMailNotificationsJob extends CronJob
}
}
);
$GLOBALS['user'] = $cli_user;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment