Attached a patch that fixes some behavioural problems with the 'ldapauth' module.
Firstly, our LDAP server contains only scant information on each user. Currently, the only data we trust in it is the login, passwords and group memberships. Therefore, we have disabled the behaviour whereby on a successful login, the LDAP details are used to update the 'go_users' record. This was imperative, as we have set up all the 'go_users' correctly, and rely on them to be correct for our custom modules to work as expected. The old behaviour may still be desirable in the majority of cases, so I would recommend making this condition configurable if this patch is to be considered for upstream.
So, given that it no longer updates the 'go_users' table, the ldapauth class has to log the user in during the 'before_login' hook (with $GO_SECURITY->logged_in($user_id), if they have successfully authenticated against the LDAP server. This is really all we were hoping and expecting the ldapauth module to do. To complete this, it was necessary to update 'auth' to only authenticate against the 'go_users' table if none of the 'before_login' hooks had agreed to log the user in already.
And, as 'ldapauth' and 'imapauth' should be siblings (i.e. no direct dependency), I figured that it would be better for it ldapauth not to inherit imapauth, but rather to instantiate it in order to make use of it's 'get_domain_config' function *only if* the 'imapauth' module exists and is enabled.
Hope this helps. Please feel free to include upstream, as-is, in part or modified, as you see fit.
Regards,
--
Ross
