Make user authorizarion compatible with external AD mode
cherrypick fix in captiveportal CGIs