Only allow ejabberd logins when XMPP service is enabled
This commit is contained in:
parent
263eb88b72
commit
12b4fb37fa
@ -154,6 +154,11 @@ admin_users = ejabberd_credentials['admins']
|
||||
|
||||
hosts.each do |host|
|
||||
ldap_rootdn = "uid=service,ou=#{host[:name]},cn=applications,dc=kosmos,dc=org"
|
||||
if host[:name] == "kosmos.org"
|
||||
ldap_filter = "(&(objectClass=person)(serviceEnabled=xmpp))"
|
||||
else
|
||||
ldap_filter = "(objectClass=person)"
|
||||
end
|
||||
|
||||
template "/opt/ejabberd/conf/#{host[:name]}.yml" do
|
||||
source "vhost.yml.erb"
|
||||
@ -167,7 +172,8 @@ hosts.each do |host|
|
||||
ldap_base: ldap_base,
|
||||
ldap_server: ldap_domain,
|
||||
ldap_rootdn: ldap_rootdn,
|
||||
ldap_encryption_type: ldap_encryption_type
|
||||
ldap_encryption_type: ldap_encryption_type,
|
||||
ldap_filter: ldap_filter
|
||||
notifies :reload, "service[ejabberd]", :delayed
|
||||
end
|
||||
end
|
||||
|
@ -16,7 +16,7 @@ host_config:
|
||||
ldap_password: "<%= @host[:ldap_password] %>"
|
||||
ldap_encrypt: <%= @ldap_encryption_type %>
|
||||
ldap_base: "ou=<%= @host[:name] %>,<%= @ldap_base %>"
|
||||
ldap_filter: "(objectClass=person)"
|
||||
ldap_filter: "<%= @ldap_filter %>"
|
||||
<% end -%>
|
||||
|
||||
append_host_config:
|
||||
|
Loading…
x
Reference in New Issue
Block a user