Bug #5587 - Redirect fails after a failed login and proper variable initialisation; merged from MOODLE_16_STABLE
Bug #5587 - Redirect fails after a failed login and proper variable initialisation; merged from MOODLE_16_STABLE

dilawar/moodle