backport of #9848

Fix memberOf detection. Fixes: #9835

Conflicts:
	apps/user_ldap/lib/wizard.php

Fix remarks in #9848

Conflicts:
	apps/user_ldap/lib/wizard.php

Fix initializing in #9848

do not change var names here