bug #4352 : Adding support for authentifying users only on the domains in which the login exists
integrating bug #4352
fixing an SQL error (regression)
Merge branch 'ehu-bug4352'