Implemented login and logout session.

When a user tries to upload a file the application checks if he is
logged in. Moreover if he tries to log in with an incorrect
username/password, the program shows an error message.
Improved permissionScript.sh.