Commit 831a258909b8ebf1e82838ffbcefbbf1cb7ee10e:
    address review comments and cleanup
    git-svn-id: 
https://svn.apache.org/repos/infra/infrastructure/trunk/projects/whimsy@820576 
90ea9780-b833-de11-8433-001ec94261de


Branch: refs/heads/master
Author: Sam Ruby <[email protected]>
Committer: Sam Ruby <[email protected]>
Pusher: rubys <[email protected]>

------------------------------------------------------------
www/officers/mlreq.cgi                                       | ++++++ ---
------------------------------------------------------------
17 changes: 12 additions, 5 deletions.
------------------------------------------------------------


diff --git a/www/officers/mlreq.cgi b/www/officers/mlreq.cgi
index 4aaf5bf..7225b19 100755
--- a/www/officers/mlreq.cgi
+++ b/www/officers/mlreq.cgi
@@ -48,7 +48,6 @@ _html do
             _input.name.podling disabled: true, value: '<podling>', 
               placeholder: 'podling'
             _ '-'
-            # ### duplicate 'name' attr?
             _input.name.list name: 'suffix1', required: true, 
               placeholder: 'list', pattern: '^\w+(-\w+)?$'
             _ '@'
@@ -113,6 +112,16 @@ _html do
       queue = []
 
       if @subdomain
+        apmail_bin = ASF::SVN['infra/infrastructure/apmail/trunk/bin']
+        lists = File.read(File.join(apmail_bin, '.archives')).
+          scan(/^\s+"(\w[-\w]+)", "\/home\/apmail\//).flatten
+
+        if lists.include? "#{@localpart}-private"
+          notifyee = "private@#{@localpart}.apache.org"
+        else
+          notifyee = "#{$USER}@.apache.org"
+        end
+
         queue << {
           subdomain: @subdomain,
           localpart: @localpart,
@@ -120,9 +129,7 @@ _html do
           moderators: mods,
           muopts: @muopts,
           replytolist: @replyto || "false",
-          # ### Note: assumes private@ list is created first!
-          # ### Some logic (CGI or apmail script) should check or enforce that.
-          notifyee: "private@#{@localpart}.apache.org"
+          notifyee: notifyee
         }
       else
         params.keys.grep(/^suffix\d+/).each do |suffix|
@@ -184,7 +191,7 @@ _html do
         queue.each do |vars|
           mlreq = "#{vars[:localpart]}-#{vars[:subdomain]}".gsub(/[^-\w]/,'_')
           vars.each {|name,value| vars[name] = Shellwords.shellescape(value)}
-          request = vars.map {|name,value| "#{name}=#{value}\n"}.join("")
+          request = vars.map {|name,value| "#{name}=#{value}\n"}.join
           _pre request
           File.open("#{mlreq.untaint}.txt",'w') { |file| file.write request }
           _.system(['svn', 'add', '--', "#{mlreq.untaint}.txt"])

Reply via email to