diff --git a/scripts/cgi-bin/info.py b/scripts/cgi-bin/info.py index 6f5f9964e..e90e7ea34 100755 --- a/scripts/cgi-bin/info.py +++ b/scripts/cgi-bin/info.py @@ -77,7 +77,7 @@ def SendPass(email): except: Display('
Beim Versenden des Passwortes ist ein Fehler aufgetreten.
Eventuell ist die email-Adresse unbekannt
', 'Kundendaten für '+email) - + def ShowInfo(custid, Password): global Errors db = MySQLdb.connect(db=dbname) @@ -101,7 +101,7 @@ def ShowInfo(custid, Password): races.append(cursor.fetchone()) output = '
Letzter Buchungstag: '+str(lastdate)[0:10]+'
\n' - + query = "SELECT sum(balance) from transactions where user="+str(custid) transactions = cursor.execute(query) balance = 0.00 @@ -163,7 +163,7 @@ def ShowInfo(custid, Password): "from races, games, subscriptions s "+ "where s.race=races.race and s.game="+str(int(gid))+" and s.game=games.id "+ "and s.user="+str(custid)+" ") - + fcursor = db.cursor() results = fcursor.execute(query) if results>0: @@ -186,7 +186,7 @@ def ShowInfo(custid, Password): continue output=output+line+'
\n

\n' output=output+"

" - + query="select date, balance, text from transactions, descriptions where descriptions.handle=transactions.description and user="+str(custid)+" ORDER BY date" results = cursor.execute(query); @@ -203,7 +203,7 @@ def ShowInfo(custid, Password): line = line + "\n" output=output+line output=output+"" - + output=output+'

' output=output+'' output=output+'' @@ -225,6 +225,7 @@ def TransferFaction(sid, faction, newuser, game): return def Save(custid, Password): + global Errors validkeys=['email','address','lastname','firstname','city','password','phone'] values='id='+str(custid) for key in Form.keys(): @@ -268,12 +269,16 @@ def Save(custid, Password): TransferFaction(sid, faction, newuser, game) nfactions = nfactions - 1 - nfactions = cursor.execute("select g.name, s.id, faction from games g, subscriptions s where s.status='TRANSFERED' and s.user="+str(custid) + " and s.game=g.id") + nfactions = cursor.execute("select g.id, g.name, s.id, faction from games g, subscriptions s where s.status='TRANSFERED' and s.user="+str(custid) + " and s.game=g.id") while nfactions > 0: - game, sid, faction = cursor.fetchone() + gid, game, sid, faction = cursor.fetchone() if Form.has_key("accept_"+faction): update = db.cursor() - update.execute("UPDATE subscriptions set status='ACTIVE' where id="+str(int(sid))) + i = update.execute("SELECT count(*) from subscriptions where status='ACTIVE' and game="+str(int(gid))) + if i==0: + update.execute("UPDATE subscriptions set status='ACTIVE' where id="+str(int(sid))) + else: + Errors=Errors+"Du hast bereits eine Aktive Partei in "+game+"
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")