add login validation code

git-svn-id: https://markus.cdf.toronto.edu/svn/csc207-2014-09/group_0909/app@171 8153ec5e-17d7-4962-8641-23ff7c14a8d4