Login and logout in control panel

Created log out function, changed log in function, exceptions for AJAX,
activity function.