From 2a42b515b296ecf4838e3d15c877c08447c3ccf1 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 29 Apr 2002 14:53:41 +0000 Subject: [PATCH] =?UTF-8?q?laufende=20=C3=A4nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/cgi-bin/eressea-register.py | 4 ++-- scripts/register/wait-reset.py | 30 +++++++++++++++++------------ scripts/register/warn.py | 4 ++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/scripts/cgi-bin/eressea-register.py b/scripts/cgi-bin/eressea-register.py index 8cd63849e..88eee61d2 100755 --- a/scripts/cgi-bin/eressea-register.py +++ b/scripts/cgi-bin/eressea-register.py @@ -21,8 +21,8 @@ From = "accounts@eressea-pbem.de" locale="de" smtpserver = 'localhost' db=None -game_id=0 # Eressea Main game -tutorial_id=None # 1 to active, None to disable tutorials +game_id=0 # Eressea Main game +tutorial_id=1 # 1 to active, None to disable tutorials # define a new function called Display # it takes one parameter - a string to Display diff --git a/scripts/register/wait-reset.py b/scripts/register/wait-reset.py index 9fac406ff..05297b445 100755 --- a/scripts/register/wait-reset.py +++ b/scripts/register/wait-reset.py @@ -8,30 +8,36 @@ # * Will mark CONFIRMED users as WAITING, and send them another mail. import MySQLdb +import string import re import sys +import os import smtplib dbname=sys.argv[1] date=sys.argv[2] -db=MySQLdb.connect(db=dbname) -cursor=db.cursor() From='accounts@eressea-pbem.de' -MailTemplate="templates/register.mail" smtpserver='localhost' server=smtplib.SMTP(smtpserver) patchdir='/home/eressea/eressea-rsync' game_id=0 +db=MySQLdb.connect(db=dbname) +cursor=db.cursor() +cursor.execute("select name, patch from games where id="+str(game_id)) +game, patch = cursor.fetchone() + +MailTemplate="templates/register.mail."+string.lower(game) + def Patch(): - 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) + global patch + + print "Auswertung für " + game + " Patch Level " + str(int(patch)) while os.access(patchdir+'/patch-'+str(int(patch+1))+'.sql', os.F_OK): patch=patch+1 print " Patching to level "+str(patch) os.system('mysql ' + dbname + ' < ' + patchdir+'/patch-'+str(int(patch))+'.sql') - cursor.execute('update games set patch='+str(int(patch))+' where id='+str(gid)) + cursor.execute('update games set patch='+str(int(patch))+' where id='+str(game_id)) return def Send(email, custid, firstname, password, position, locale): @@ -51,11 +57,9 @@ def Send(email, custid, firstname, password, position, locale): return Patch() -print "must update this. only partially done" -sys.exit(-1) - # 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')") +update=db.cursor() while users: users=users-1 sid = cursor.fetchone()[0] @@ -66,12 +70,14 @@ cursor.execute("update subscriptions set status='EXPIRED' where TO_DAYS(updated) cursor.execute("update subscriptions set status='WAITING' where TO_DAYS(updated) 0: users=users-1 email, uid, games = cursor.fetchone()