Fix a few typos introduced in last commit + case sensitivity due to dirty LDAP entries
This commit is contained in:
parent
cc21e41d4a
commit
ddf8cb7f78
1 changed files with 8 additions and 8 deletions
|
@ -50,21 +50,21 @@ def main
|
|||
if (match.size > 0)
|
||||
entry = match.first
|
||||
members = entry.uniquemember.map do |dn|
|
||||
/mail=([^,]+),/.match(dn).values_at(1).first
|
||||
/mail=([^,]+),/.match(dn).values_at(1).first.downcase
|
||||
end
|
||||
|
||||
puts "OK"
|
||||
puts "Found #{entry.dn} with #{members.size} members"
|
||||
|
||||
print "Searchin mlmmj... "
|
||||
if (File.executable?(mlmmj_list_binary))
|
||||
mlmmj_list_binary = conf["mlmmj"]["list_binary"]
|
||||
mlmmj_basepath = conf["mlmmj"]["basepath"]
|
||||
list = "#{mlmmj_basepath}/#{cn}@#{domain}"
|
||||
if (File.executable?(mlmmj_list_binary))
|
||||
raw = %x(#{mlmmj_list_binary} -L #{list} -s)
|
||||
|
||||
if ($?.exitstatus == 0)
|
||||
purs "OK"
|
||||
puts "OK"
|
||||
subscribers = raw.split("\n")
|
||||
puts "Found #{cn}@#{domain} with #{subscribers.size} subscribers"
|
||||
print "\n"
|
||||
|
@ -75,7 +75,7 @@ def main
|
|||
if (subscribers.include?(m))
|
||||
subscribers.delete(m)
|
||||
else
|
||||
puts "Adding #{m}... "
|
||||
print "Adding #{m}... "
|
||||
mlmmj_sub_binary = conf["mlmmj"]["sub_binary"]
|
||||
%x(#{mlmmj_sub_binary} -L #{list} -a #{m} -q -f -s)
|
||||
if ($?.exitstatus == 0)
|
||||
|
@ -88,9 +88,9 @@ def main
|
|||
|
||||
# Remove remaining "subcribers" (= they did not match with members)
|
||||
subscribers.each do |s|
|
||||
puts "Removing #{s}... "
|
||||
print "Removing #{s}... "
|
||||
mlmmj_unsub_binary = conf["mlmmj"]["unsub_binary"]
|
||||
%x(#{mlmmj_unsub_binary} -L #{list} -a #{m} -q -s)
|
||||
%x(#{mlmmj_unsub_binary} -L #{list} -a #{s} -q -s)
|
||||
if ($?.exitstatus == 0)
|
||||
puts "OK"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue