whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] 02/02: update mlreq latest dependencies; new LDAP structure
Date Sun, 02 Jul 2017 23:11:18 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 24889bb26cf707c13c9bbf42c0284898eee1c1e9
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Jul 2 19:10:19 2017 -0400

    update mlreq latest dependencies; new LDAP structure
---
 www/officers/mlreq.cgi | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/www/officers/mlreq.cgi b/www/officers/mlreq.cgi
index 157c563..d8d9abb 100755
--- a/www/officers/mlreq.cgi
+++ b/www/officers/mlreq.cgi
@@ -1,21 +1,23 @@
-#!/usr/bin/ruby1.9.1
+#!/usr/bin/env ruby
+PAGETITLE = "Apache Mailing list Request Form" # Wvisible:infra mail list
+$LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'wunderbar'
 require 'shellwords'
 require 'mail'
 require 'whimsy/asf'
+require 'whimsy/asf/rack'
 require 'whimsy/asf/podlings'
 require 'whimsy/asf/site'
 
-$SAFE = 1
-
 # This is a version number check embedded in the json files.
 # 
 # The script started generating format numbers on 2012-08-28 but had been
 # in production for some number before that.
 FORMAT_NUMBER = 4
 
-user = ASF::Person.new($USER)
-AUTHORIZED = (user.asf_member? or ASF.pmc_chairs.include?(user) or $USER=='ea')
+user = ASF::Auth.decode(env = {})
+
+AUTHORIZED = (user.asf_member? or ASF.pmc_chairs.include?(user))
 if !AUTHORIZED && env['REQUEST_METHOD'].to_s != 'GET'
   print "Status: 401 Unauthorized\r\n"
   print "WWW-Authenticate: Basic realm=\"ASF Members and Officers\"\r\n\r\n"
@@ -23,7 +25,7 @@ if !AUTHORIZED && env['REQUEST_METHOD'].to_s != 'GET'
 end
 
 lists = ASF::Mail.lists
-pmcs = ASF::Committee.list.map(&:mail_list)
+pmcs = ASF::Committee.pmcs.map(&:mail_list)
 pmcs.delete_if {|pmc| not lists.include? "#{pmc}-private"}
 
 # INFRA-11555
@@ -195,9 +197,9 @@ _html do
 
         _.system [
           'svn', 'commit', '--no-auth-cache', '--non-interactive',
-          '-m', "#{request} mailing list request by #{$USER} via " + 
+          '-m', "#{request} mailing list request by #{env.user} via " + 
             env['SERVER_ADDR'],
-          (['--username', $USER, '--password', $PASSWORD] if $PASSWORD),
+          (['--username', env.user, '--password', env.password] if env.password),
           '--', *tocommit
         ]
         _p do

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

Mime
View raw message