Fix user id is zero
This PR fixes that the user id is zero under certain circumstances. The user id will be the anonymous user in these cases. Mantis Ticket: https://mantis.ilias.de/view.php?id=32063
sorry, wrong PR, will post this comment in #4169
Since @kergomard now took over this component, we left it to him to decide how to move forward here.
Thank you @lscharmer for this PR that has been around for so long. I agree with @alex40724 , that this is most probably not the right solution and thus close this PR. I agree though, that the handling of users that are not authenticated is a mess even after the improvement and should be streamlined and improved. Thanks again and best, @kergomard