Skip to content
Commits on Source (2)
......@@ -313,6 +313,9 @@ def deleteUser(peopleList):
print("Something went wrong deleting the LDAP entry, quitting! NO CHNAGES MADE")
sys.exit(9)
# delete their useradd ldif file
subprocess.call(['sudo', 'rm', "-v", "/home/useradd/useradd." + username + ".ldif"])
# move their homedir to the deleted folder
subprocess.call(['sudo', 'mv', "-f", userLDAPinfo[0][1]["homeDirectory"][0], persondir+"/homedir"])
......@@ -342,6 +345,8 @@ def deleteUser(peopleList):
cur = DBconn.cursor()
# delete from doorcards first
cur.execute("DELETE FROM doorcards WHERE uid=%(uid)s",{"uid" : str(userDBinfo[0][0])})
# delete from printer table
cur.execute("DELETE FROM printer WHERE username=%(user)s",{"user" : username})
# delete from members table
cur.execute("DELETE FROM members WHERE username=%(user)s",{"user" : username})
# add their some details to the oldmembers table
......