diff --git a/scripts/cgi-bin/info.py b/scripts/cgi-bin/info.py
index 2dbd60ce8..76b28b5d0 100755
--- a/scripts/cgi-bin/info.py
+++ b/scripts/cgi-bin/info.py
@@ -22,8 +22,8 @@ def Display(Content, Title=DefaultTitle):
TemplateInput = TemplateHandle.read()
TemplateHandle.close() # close the file
-# for key in Form.keys():
-# Content=Content+"
"+str(key)+"="+str(Form[key])
+ for key in Form.keys():
+ Content=Content+"
"+str(key)+"="+str(Form[key])
# this defines an exception string in case our
# template file is messed up
@@ -78,7 +78,7 @@ def ShowInfo(custid, Password):
results = cursor.execute(query);
output=output+"
Anmeldungen
\n"
- query="select date, balance, text from transactions, descriptions where descriptions.handle=transactions.description and user="+str(custid)
+ query="select date, balance, text from transactions, descriptions where descriptions.handle=transactions.description and user="+str(custid)+" ORDER BY date"
results = cursor.execute(query);
output=output+"Transaktionen
\n\n"
@@ -128,16 +133,20 @@ def Save(custid, Password):
cursor=db.cursor()
cursor.execute('UPDATE users SET '+values+' where id='+str(custid))
- nfactions = cursor.execute("select game, id, faction from subscriptions where status='ACTIVE' and user="+str(custid))
+ nfactions = cursor.execute("select g.name, s.id, faction from games g, subscriptions s where s.status='ACTIVE' and s.user="+str(custid) + " and s.game=g.id")
while nfactions > 0:
game, sid, faction = cursor.fetchone()
if Form.has_key("cancel_"+faction):
- update = db.cursor("UPDATE subscriptions set status='CANCELLED' where id="+str(sid))
- server=smtplib.SMTP(smtpserver)
- Msg="From: accounts@vinyambar.de\nTo: admin@vinyambar.de\nSubject: Vinambar Abmeldung\n\n"
- Msg=Msg+"Die Partei: "+faction+" hat sich aus Spiel Nr. "+game+" abgemeldet\n"
- server.sendmail("accounts@vinyambar.de", "admin@vinyambar.de", Msg)
- server.close()
+ update = db.cursor()
+ update.execute("UPDATE subscriptions set status='CANCELLED' where id="+str(sid))
+ nfactions = nfactions - 1
+
+ nfactions = cursor.execute("select g.name, s.id, faction from games g, subscriptions s where s.status='CANCELLED' and s.user="+str(custid) + " and s.game=g.id")
+ while nfactions > 0:
+ game, sid, faction = cursor.fetchone()
+ if Form.has_key("activate_"+faction):
+ update = db.cursor()
+ update.execute("UPDATE subscriptions set status='ACTIVE' where id="+str(sid))
nfactions = nfactions - 1
db.close()