From fcef0c7821547a61e497a154731e4087d2f54dbd Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 7 Apr 2002 09:08:19 +0000 Subject: [PATCH] =?UTF-8?q?Fehlermeldung=20f=C3=BCr=20Doppelspieler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/cgi-bin/info.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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")