fixed validations in templates and add alternative validation if LDAP is disabled