Fixed login issue

Fixed bug where any password would work if username was either admin or
res
Merge remote-tracking branch 'origin/Xingze' into BoDong