I made the code more passive, avoiding issued at taking, returning,
storing alerts or removing alerts from an item.
Now they all check if it is with you before returning/deleting
alert etc. I am not sure if all cases are covered, but they are
better than before. I had one only issued on this on that time,
but I prefer to prioritize safety/security.
I took the opportunitie to move some code from Controllers to
the model itself, as they were changing with the DB.
It happend once: a user asked to be added to the waiting
list at the same time other user was returning the item.
So the user ended up waiting for the user he was already
using.
The language were set only on session. But now it is
stored with user profile, on DB.
It is important as now I can send alert e-mails to each
user on their own languages and not the activer
user language.
Also, wherever the user logs out and logs in again,
it will see the same site locale.