login logic and admin check

login logic and admin check, verify the user from mysql database