whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: whoops, forgot to commit a file
Date Sat, 06 Aug 2016 23:20:07 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  213fed4   whoops, forgot to commit a file
213fed4 is described below

commit 213fed49cf908def23ee4cc2d66eadefc28d213f
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Aug 6 16:52:26 2016 -0400

    whoops, forgot to commit a file
---
 www/roster/views/actions/authgroup.json.rb | 43 ++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/www/roster/views/actions/authgroup.json.rb b/www/roster/views/actions/authgroup.json.rb
new file mode 100644
index 0000000..a21fc09
--- /dev/null
+++ b/www/roster/views/actions/authgroup.json.rb
@@ -0,0 +1,43 @@
+#
+# Add or remove a person from an authorization group in LDAP
+#
+
+if env.password
+  person = ASF::Person.find(@id)
+  group = ASF::AuthGroup.find(@group)
+
+  # update LDAP
+  ASF::LDAP.bind(env.user, env.password) do
+    if @action == 'add'
+      group.add(person)
+    elsif @action == 'remove'
+      group.remove(person)
+    end
+  end
+
+  # compose E-mail
+  action = (@action == 'add' ? 'added to' : 'removed from')
+  list = "#{@group} authorization group"
+
+  details = [person.dn, group.dn]
+
+  from = ASF::Person.find(env.user)
+
+  mail = Mail.new do
+    from "#{from.public_name} <#{from.id}@apache.org>".untaint
+    to "root@apache.org"
+    subject "#{person.public_name} #{action} #{list}"
+    body "Current roster can be found at:\n\n" +
+      "  https://whimsy.apache.org/roster/group/#{group.id}\n\n" +
+      "LDAP details:\n\n  #{details.join("\n  ")}"
+  end
+
+  # Header for root@'s lovely email filters
+  mail.header['X-For-Root'] = 'yes'
+
+  # deliver email
+  mail.deliver!
+end
+
+# return updated committee info to the client
+Group.serialize(@group)

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message