Commit 08b447be authored by Imran Hussain's avatar Imran Hussain
Browse files

Delete function now complete! (feature parity of php scripts)

parent bdcdca45
......@@ -227,7 +227,17 @@ def deleteUser(peopleList):
subprocess.call(['sudo', '/usr/lib/mailman/bin/remove_members', "users", userDBinfo[0][3]]) #main email
subprocess.call(['sudo', '/usr/lib/mailman/bin/remove_members', "users", userDBinfo[0][6]+"@swan.ac.uk"]) # iss email
#time to delete them from the db :(
cur = DBconn.cursor()
#delete from doorcards first
cur.execute("DELETE FROM doorcards WHERE uid=%(uid)s",{"uid" : userDBinfo[0][0]})
#delete from members table
cur.execute("DELETE FROM members WHERE username=%(user)s",{"user" : person[0]})
#add their some details to the oldmembers table
cur.execute("INSERT into oldmembers (username,realname) VALUES (%(user)s,%(realname)s)",{"user" : username,"realname" : userDBinfo[0][2]})
DBconn.commit()
cur.close()
def reminderMenu():
print("")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment