[BUGFIX] Test loginUser before frontendUserRepository

Prevents a PHP warning if $GLOBALS['TSFE']->fe_user->user is not set
Merge pull request #580 from dogawaf/patch-2

[BUGFIX] Test loginUser before frontendUserRepository