Commit 5277a6c9 authored by Imran Hussain's avatar Imran Hussain
Browse files

Also disable apache vhosts when deleting people

parent c13c14cc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -264,6 +264,11 @@ def deleteUser(peopleList):
		# move their mail to the deleted folder
		subprocess.call(['sudo', 'mv', "-f", mboxdir+username, persondir+"/mbox"])

		# if they have a apcahe vhost kill it
		if os.path.exists("/etc/apache2/sites-enabled/" + username + ".conf")
			subprocess.call(['sudo', 'a2dissite', username + ".conf"])
			subprocess.call(['sudo', 'systemctl', "reload", "apache2.service"])

		# remove them from the printer
		# pkusers --delete imranh
		subprocess.call(['sudo', 'pkusers', "--delete", username])