forked from github/server
ban-skript, neue parteien
This commit is contained in:
parent
3b0030bc61
commit
28ebdd637b
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import MySQLdb
|
||||||
|
import sys
|
||||||
|
|
||||||
|
dbname=sys.argv[1]
|
||||||
|
db=MySQLdb.connect(db=dbname)
|
||||||
|
|
||||||
|
cursor=db.cursor()
|
||||||
|
bans = cursor.execute("select user, users.email, users.status, userips.ip from bannedips, users, userips where users.status!='BANNED' and users.id=userips.user and userips.ip=bannedips.ip")
|
||||||
|
bc = db.cursor()
|
||||||
|
while bans:
|
||||||
|
bans=bans-1
|
||||||
|
user, email, status, ip = cursor.fetchone()
|
||||||
|
if status!='ACTIVE':
|
||||||
|
bc.execute("update users set status='BANNED' where id="+str(int(user)))
|
||||||
|
else:
|
||||||
|
print email + " is active, and playing from banned ip "+ip
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import MySQLdb
|
||||||
|
import sys
|
||||||
|
|
||||||
|
dbname=sys.argv[1]
|
||||||
|
maxnum=int(sys.argv[2])
|
||||||
|
|
||||||
|
query = "select distinct u.email, s.race, u.locale from users u, 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' order by u.id"
|
||||||
|
db=MySQLdb.connect(db=dbname)
|
||||||
|
cursor = db.cursor()
|
||||||
|
num=cursor.execute(query)
|
||||||
|
if num>maxnum:
|
||||||
|
num=maxnum
|
||||||
|
while num:
|
||||||
|
num=num-1
|
||||||
|
email, race, locale = cursor.fetchone()
|
||||||
|
print email+" "+race+" "+locale+" 0"
|
|
@ -0,0 +1,3 @@
|
||||||
|
select distinct u.email, s.race, u.locale from users u, 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' order by u.id;
|
Loading…
Reference in New Issue