Debug login errors and group errors

Login error was fixed by detecting whether or not user is logged in or
if settings overridden.
Group error fixed by only allowing download if user is part of groups
not if the group is not equal.