Fix maintenance mode issue locking out admin users from logging into CMS

Fixes issue #857