From 6f26e0a577eabaadfd70dc94c8f02dc07322e06b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 8 Apr 2002 10:01:42 +0000 Subject: [PATCH] bugfix bonus-link --- scripts/cgi-bin/eressea-confirm.py | 2 +- scripts/cgi-bin/eressea-register.py | 24 ++++++++++++++++-------- scripts/cgi-bin/info.py | 4 ++-- scripts/cgi-bin/poll2001.py | 2 +- scripts/cgi-bin/standin.py | 2 +- scripts/cgi-bin/vinyambar-register.py | 2 +- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/scripts/cgi-bin/eressea-confirm.py b/scripts/cgi-bin/eressea-confirm.py index 240188b20..567a96455 100755 --- a/scripts/cgi-bin/eressea-confirm.py +++ b/scripts/cgi-bin/eressea-confirm.py @@ -10,7 +10,7 @@ import os import re # specify the filename of the template file -scripturl="http://eressea.upb.de/~enno/cgi-bin/eressea-confirm.py" +scripturl="http://eressea.upb.de/cgi-bin/eressea/eressea-confirm.py" HTMLTemplate = "eressea.html" DefaultTitle = "Eressea Anmeldung" dbname = "eressea" diff --git a/scripts/cgi-bin/eressea-register.py b/scripts/cgi-bin/eressea-register.py index a8616338e..7a9486628 100755 --- a/scripts/cgi-bin/eressea-register.py +++ b/scripts/cgi-bin/eressea-register.py @@ -10,7 +10,7 @@ import smtplib from whrandom import choice # specify the filename of the template file -scripturl="http://eressea.upb.de/~enno/cgi-bin/eressea-register.py" +scripturl="http://eressea.upb.de/cgi-bin/eressea/eressea-register.py" HTMLTemplate = "eressea.html" MailTemplate="register.mail" DefaultTitle = "Eressea Anmeldung" @@ -124,6 +124,7 @@ else: Display('Deine Email-Adresse ist für Eressea nicht zugelassen. '+reason) sys.exit(0) + # create a new user record password=genpasswd() fields = "firstname, lastname, locale, email, address, city, status, password" values = "'"+firstname+"', '"+lastname+"', '"+locale+"', '"+email+"', '"+address+"', '"+city+"', 'WAITING', '"+password+"'" @@ -139,12 +140,6 @@ else: if referrer!=None: fields=fields+", referrer" values=values+", '"+referrer+"'" - if bonus!=None: - fields=fields+", bonus" - if bonus=='yes': - values=values+", 1" - else: - values=values+", 0" if firsttime!=None: fields=fields+", firsttime" if firsttime=='yes': @@ -154,12 +149,25 @@ else: cursor.execute("insert into users ("+fields+") VALUES ("+values+")") cursor.execute("SELECT LAST_INSERT_ID() from dual") custid=cursor.fetchone()[0] + + # track IP addresses ip=None if os.environ.has_key('REMOTE_ADDR'): ip=os.environ['REMOTE_ADDR'] if ip!=None: cursor.execute("REPLACE userips (ip, user) VALUES ('"+ip+"', "+str(int(custid))+")") - cursor.execute("insert into subscriptions (user, race, game, status) VALUES ("+str(int(custid))+", '"+race+"', 0, 'PENDING')") + + # add a subscription record + values="'PENDING'" + fields="status" + if bonus!=None: + fields=fields+", bonus" + if bonus=='yes': + values=values+", 1" + else: + values=values+", 0" + cursor.execute("insert into subscriptions (user, race, game, "+fields+") VALUES ("+str(int(custid))+", '"+race+"', 0, "+values+")") + cursor.execute("select count(*) from users where status='WAITING' or status='CONFIRMED'") Send(email, custid, firstname, password, cursor.fetchone()[0]) text={"de":"Deine Anmeldung wurde bearbeitet. Eine EMail mit Hinweisen ist unterwegs zu Dir", "en":"Your application was processed. An email containing further instructions is being sent to you"} diff --git a/scripts/cgi-bin/info.py b/scripts/cgi-bin/info.py index acf772513..86aa74ca0 100755 --- a/scripts/cgi-bin/info.py +++ b/scripts/cgi-bin/info.py @@ -7,8 +7,8 @@ import re import smtplib # specify the filename of the template file -scripturl="http://eressea.upb.de/~enno/cgi-bin/info.py" -TemplateFile = "vinyambar.html" +scripturl="http://eressea.upb.de/cgi-bin/eressea/info.py" +TemplateFile = "/home/enno/www/cgi-bin/vinyambar.html" DefaultTitle = "Vinyambar Datenbank" dbname = "vinyambar" From = "accounts@vinyambar.de" diff --git a/scripts/cgi-bin/poll2001.py b/scripts/cgi-bin/poll2001.py index 6aac91db4..7ca2d4ee3 100755 --- a/scripts/cgi-bin/poll2001.py +++ b/scripts/cgi-bin/poll2001.py @@ -9,7 +9,7 @@ import re TemplateFile = "vinyambar.html" DefaultTitle = "Eressea Umfrage 2001" dbname = "eressea" -myurl="http://eressea.upb.de/~enno/cgi-bin/poll2001.py" +myurl="http://eressea.upb.de/cgi-bin/eressea/poll2001.py" # define a new function called Display # it takes one parameter - a string to Display diff --git a/scripts/cgi-bin/standin.py b/scripts/cgi-bin/standin.py index 0bbd9431a..735e9d2ef 100755 --- a/scripts/cgi-bin/standin.py +++ b/scripts/cgi-bin/standin.py @@ -6,7 +6,7 @@ import cgi import re # specify the filename of the template file -scripturl='http://eressea.upb.de/~enno/cgi-bin/standin.py' +scripturl='http://eressea.upb.de/cgi-bin/eressea/standin.py' TemplateFile = "vinyambar.html" DefaultTitle = "Vinyambar Parteibörse" dbname = "vinyambar" diff --git a/scripts/cgi-bin/vinyambar-register.py b/scripts/cgi-bin/vinyambar-register.py index 3f25ad4e0..39c3a6f99 100755 --- a/scripts/cgi-bin/vinyambar-register.py +++ b/scripts/cgi-bin/vinyambar-register.py @@ -10,7 +10,7 @@ import smtplib from whrandom import choice # specify the filename of the template file -scripturl="http://eressea.upb.de/~enno/cgi-bin/vinyambar-register.py" +scripturl="http://eressea.upb.de/cgi-bin/eressea/vinyambar-register.py" HTMLTemplate = "vinyambar.html" MailTemplate="vinyambar-register.mail" DefaultTitle = "Vinyambar Anmeldung"