noch ein paar mehr fixes und anpassungen

This commit is contained in:
Enno Rehling 2002-04-21 12:09:21 +00:00
parent 1bcb841fcb
commit 0ff5b6eaed
4 changed files with 20 additions and 9 deletions

View File

@ -10,7 +10,6 @@ import os
import re
# specify the filename of the template file
scripturl="http://eressea.upb.de/cgi-bin/eressea/eressea-confirm.py"
HTMLTemplate = "eressea.html"
DefaultTitle = "Eressea Anmeldung"
dbname = "eressea"

View File

@ -13,7 +13,6 @@ import smtplib
from whrandom import choice
# specify the filename of the template file
scripturl="http://eressea.upb.de/cgi-bin/eressea/eressea-register.py"
HTMLTemplate = "eressea.html"
MailTemplate="register.mail"
DefaultTitle = "Eressea Anmeldung"
@ -23,7 +22,7 @@ locale="de"
smtpserver = 'localhost'
db=None
game_id=0 # Eressea Main game
tutorial_id=None #
tutorial_id=None # 1 to active, None to disable tutorials
# define a new function called Display
# it takes one parameter - a string to Display

View File

@ -16,7 +16,7 @@ def genpasswd():
newpasswd = newpasswd + choice(chars)
return newpasswd
query = "select distinct u.email, s.id, s.password, r.name, u.locale, s.bonus from users u, races r, subscriptions s left join userips i on u.id=i.user left join bannedips b on i.ip=b.ip where s.user=u.id and b.ip is NULL and u.status='CONFIRMED' and r.race=s.race and s.game="+str(game_id)+" and r.locale='de' order by u.id"
query = "select distinct u.email, s.id, s.password, r.name, u.locale, s.bonus from users u, races r, subscriptions s left join userips i on u.id=i.user left join bannedips b on i.ip=b.ip where s.user=u.id and b.ip is NULL and s.status='CONFIRMED' and r.race=s.race and s.game="+str(game_id)+" and r.locale='de' order by u.id"
db=MySQLdb.connect(db=dbname)
cursor = db.cursor()
c = db.cursor()

View File

@ -21,9 +21,10 @@ MailTemplate="templates/register.mail"
smtpserver='localhost'
server=smtplib.SMTP(smtpserver)
patchdir='/home/eressea/eressea-rsync'
game_id=0
def Patch():
i = cursor.execute("select name, patch from games where id=0")
i = cursor.execute("select name, patch from games where id="+str(game_id))
name, patch = cursor.fetchone()
print "Auswertung für " + name + " Patch Level " + str(int(patch)) + ", Runde "+str(lastturn)
while os.access(patchdir+'/patch-'+str(int(patch+1))+'.sql', os.F_OK):
@ -50,13 +51,25 @@ def Send(email, custid, firstname, password, position, locale):
return
Patch()
cursor.execute("update users set status='EXPIRED' where TO_DAYS(updated)<TO_DAYS('"+date+"') and status='WAITING'")
cursor.execute("update users set status='WAITING' where TO_DAYS(updated)<TO_DAYS('"+date+"') and status='CONFIRMED'")
users = cursor.execute("select firstname, locale, email, id, password from users where status='WAITING' order by id")
print "must update this. only partially done"
sys.exit(-1)
position=0
# remove all illegal and banned users:
users = cursor.execute("SELECT s.id from users u, subscriptions s where u.id=s.user and u.status in ('BANNED', 'ILLEGAL')")
while users:
users=users-1
sid = cursor.fetchone()[0]
update.execute("UPDATE subscriptions set status='EXPIRED' WHERE id="+str(int(sid)))
# espire all users without confirmation. reset waiting list.
cursor.execute("update subscriptions set status='EXPIRED' where TO_DAYS(updated)<TO_DAYS('"+date+"') and status='WAITING'")
cursor.execute("update subscriptions set status='WAITING' where TO_DAYS(updated)<TO_DAYS('"+date+"') and status='CONFIRMED'")
# remind everyone who is left on the waiting list.
waiting = cursor.execute("select firstname, locale, email, u.id, s.password from users u, subscriptions s where u.id=s.users and s.status='WAITING'")
position=0
while waiting:
waiting=waiting-1
position=position+1
firstname, locale, email, custid, password = cursor.fetchone()
print "Sending reminder email to "+str(int(custid))+" "+email