Fixed a bug when the user is a teacher it used to crash cause power check was to Student

Now it checks if the person logging in is a teacher or a student and
acts accordingly