Fixed several bugs

Fixed a bug that The User Role had a wrong ID.
Added preventions for SQL injections.
Fixed a bug which caused that a session was not detected properly
(IsNewsessionNeeded())

Added all tests except the functions ResetPasswordByMail() and
SetLastLoginDateTime()