[#1918] copy the login/authentication part from issues system, use ldap to login.