bugfix bonus-link

This commit is contained in:
Enno Rehling 2002-04-08 10:01:42 +00:00
parent 7b9721c64a
commit 6f26e0a577
6 changed files with 22 additions and 14 deletions

View File

@ -10,7 +10,7 @@ import os
import re import re
# specify the filename of the template file # 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" HTMLTemplate = "eressea.html"
DefaultTitle = "Eressea Anmeldung" DefaultTitle = "Eressea Anmeldung"
dbname = "eressea" dbname = "eressea"

View File

@ -10,7 +10,7 @@ import smtplib
from whrandom import choice from whrandom import choice
# specify the filename of the template file # 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" HTMLTemplate = "eressea.html"
MailTemplate="register.mail" MailTemplate="register.mail"
DefaultTitle = "Eressea Anmeldung" DefaultTitle = "Eressea Anmeldung"
@ -124,6 +124,7 @@ else:
Display('Deine Email-Adresse ist für Eressea nicht zugelassen. '+reason) Display('Deine Email-Adresse ist für Eressea nicht zugelassen. '+reason)
sys.exit(0) sys.exit(0)
# create a new user record
password=genpasswd() password=genpasswd()
fields = "firstname, lastname, locale, email, address, city, status, password" fields = "firstname, lastname, locale, email, address, city, status, password"
values = "'"+firstname+"', '"+lastname+"', '"+locale+"', '"+email+"', '"+address+"', '"+city+"', 'WAITING', '"+password+"'" values = "'"+firstname+"', '"+lastname+"', '"+locale+"', '"+email+"', '"+address+"', '"+city+"', 'WAITING', '"+password+"'"
@ -139,12 +140,6 @@ else:
if referrer!=None: if referrer!=None:
fields=fields+", referrer" fields=fields+", referrer"
values=values+", '"+referrer+"'" values=values+", '"+referrer+"'"
if bonus!=None:
fields=fields+", bonus"
if bonus=='yes':
values=values+", 1"
else:
values=values+", 0"
if firsttime!=None: if firsttime!=None:
fields=fields+", firsttime" fields=fields+", firsttime"
if firsttime=='yes': if firsttime=='yes':
@ -154,12 +149,25 @@ else:
cursor.execute("insert into users ("+fields+") VALUES ("+values+")") cursor.execute("insert into users ("+fields+") VALUES ("+values+")")
cursor.execute("SELECT LAST_INSERT_ID() from dual") cursor.execute("SELECT LAST_INSERT_ID() from dual")
custid=cursor.fetchone()[0] custid=cursor.fetchone()[0]
# track IP addresses
ip=None ip=None
if os.environ.has_key('REMOTE_ADDR'): if os.environ.has_key('REMOTE_ADDR'):
ip=os.environ['REMOTE_ADDR'] ip=os.environ['REMOTE_ADDR']
if ip!=None: if ip!=None:
cursor.execute("REPLACE userips (ip, user) VALUES ('"+ip+"', "+str(int(custid))+")") 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'") cursor.execute("select count(*) from users where status='WAITING' or status='CONFIRMED'")
Send(email, custid, firstname, password, cursor.fetchone()[0]) 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"} 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"}

View File

@ -7,8 +7,8 @@ import re
import smtplib import smtplib
# specify the filename of the template file # specify the filename of the template file
scripturl="http://eressea.upb.de/~enno/cgi-bin/info.py" scripturl="http://eressea.upb.de/cgi-bin/eressea/info.py"
TemplateFile = "vinyambar.html" TemplateFile = "/home/enno/www/cgi-bin/vinyambar.html"
DefaultTitle = "Vinyambar Datenbank" DefaultTitle = "Vinyambar Datenbank"
dbname = "vinyambar" dbname = "vinyambar"
From = "accounts@vinyambar.de" From = "accounts@vinyambar.de"

View File

@ -9,7 +9,7 @@ import re
TemplateFile = "vinyambar.html" TemplateFile = "vinyambar.html"
DefaultTitle = "Eressea Umfrage 2001" DefaultTitle = "Eressea Umfrage 2001"
dbname = "eressea" 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 # define a new function called Display
# it takes one parameter - a string to Display # it takes one parameter - a string to Display

View File

@ -6,7 +6,7 @@ import cgi
import re import re
# specify the filename of the template file # 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" TemplateFile = "vinyambar.html"
DefaultTitle = "Vinyambar Parteibörse" DefaultTitle = "Vinyambar Parteibörse"
dbname = "vinyambar" dbname = "vinyambar"

View File

@ -10,7 +10,7 @@ import smtplib
from whrandom import choice from whrandom import choice
# specify the filename of the template file # 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" HTMLTemplate = "vinyambar.html"
MailTemplate="vinyambar-register.mail" MailTemplate="vinyambar-register.mail"
DefaultTitle = "Vinyambar Anmeldung" DefaultTitle = "Vinyambar Anmeldung"