Fixed setup of LDAP modules in the slave

As a side note I have added code to check that the user does not tries to synchronze with the local host (this hanged the process). We have repeated code for checking if a adress is local in at least 3 places so I will do in another branch a method for that.