New login system

With this commit i have fixed the login system. I have tested it many
times and it works.
Note: you must change the password in Mysql, you must use the function
to crypt the password and then set it in the db. After you can login
correctly.