diff options
author | Norbert Preining <norbert@preining.info> | 2022-03-29 03:00:35 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-03-29 03:00:35 +0000 |
commit | fed9dbe9efe10955aefb7687a15de45404cc76f4 (patch) | |
tree | 056a7157fcf92e74592f51aebfa3cd17da8645ca /support/lug/lugs.rb | |
parent | 5f80d92d8bebc775b30e2b212e33b08089517654 (diff) |
CTAN sync 202203290300
Diffstat (limited to 'support/lug/lugs.rb')
-rwxr-xr-x | support/lug/lugs.rb | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/support/lug/lugs.rb b/support/lug/lugs.rb deleted file mode 100755 index 06b4370097..0000000000 --- a/support/lug/lugs.rb +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env ruby -# encoding: UTF-8 -require 'cgi' -require 'erb' -require 'open-uri' -require 'date' -require 'resolv' - - -# admins to be informed, one per line: -ADMINS = %w{ - wybo@dekkerdocumenten.nl -} - -RESPONSE = <<EOF -Content-type: text/html - -<%= open(CALLERDIR+"../1blok1e.inc") { |f| f.read } %> -<%= open(CALLERDIR+"../1blok2e.inc") { |f| f.read } %> -<h1>TeX user groups around the world</h1> -<% if errmess.empty? %> - <h2>Thank you for your support of the LUG database</h2> - Your corrections will be sent to <%= ADMINS[0] %> for handling. -<% else %> - <h3>Sorry, you did not correctly enter the required fields:</h3><br> - <font color="red"> - <%= errmess.join("<br>") %> - </font><p> - <form>Please try again by going - <input type="button" value="Back" onClick="history.go(-1);return true;"> - </form> -<% end %> -<hr noshade> -</td></tr></table></td></tr></table> -<%= open(CALLERDIR+"../1blok4e.inc") { |f| f.read } %> <%= DateTime.now %> -</p></div></body></html> -EOF - -MESS = <<EOF -password=<%= q['password'] %> -submitemail=<%= q['submitemail'] %> -addr=<%= q['addr'] %> -bacc=<%= q['bacc'] %> -baddr=<%= q['baddr'] %> -bank=<%= q['bank'] %> -bcode=<%= q['bcode'] %> -brout=<%= q['brout'] %> -code=<%= q['code'] %> -editor=<%= q['editor'] %> -eemail=<%= q['eemail'] %> -email=<%= q['email'] %> -faddr=<%= q['faddr'] %> -femail=<%= q['femail'] %> -ffax=<%= q['ffax'] %> -fname=<%= q['fname'] %> -fphone=<%= q['fphone'] %> -fpos=<%= q['fpos'] %> -full=<%= q['full'] %> -gaddr=<%= q['gaddr'] %> -gemail=<%= q['gemail'] %> -gfax=<%= q['gfax'] %> -gname=<%= q['gname'] %> -gphone=<%= q['gphone'] %> -gpos=<%= q['gpos'] %> -lang=<%= q['lang'] %> -list=<%= q['list'] %> -members=<%= q['members'] %> -paddr=<%= q['paddr'] %> -pemail=<%= q['pemail'] %> -pfax=<%= q['pfax'] %> -pname=<%= q['pname'] %> -pphone=<%= q['pphone'] %> -ppos=<%= q['ppos'] %> -publ=<%= q['publ'] %> -short=<%= q['short'] %> -subscr=<%= q['subscr'] %> -www=<%= q['www'] %> -country=<%= q['country'] %> -EOF - -def validate_email_domain(email) - return false unless email =~ /\@(.*)/ - Resolv::DNS.open do |dns| - @mx = dns.getresources($1, Resolv::DNS::Resource::IN::MX) - end - @mx.size > 0 ? true : false -end - -def mail(message,to,code) - m = open("|/usr/bin/mail -s '===LUG correction for #{code}===' #{to}",'w') - m.puts message - m.close -end - -q = CGI.new - -CALLERDIR=ENV['HTTP_REFERER'].sub(/[^\/]*$/,'') - -errmess = [] -q['password'] == 'kjwb' || - errmess.push("You typed the wrong (or no) password") -validate_email_domain(q['submitemail']) || - errmess.push("You must enter a valid email addres") - -message = ERB.new(RESPONSE).result -print message - -exit unless errmess.empty? -message = ERB.new(MESS).result.gsub(/\r\n/,"\n ").strip -ADMINS.each { |m| mail(message,m,q['code']) } |