-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeleteAgent.cgi
More file actions
31 lines (27 loc) · 856 Bytes
/
Copy pathdeleteAgent.cgi
File metadata and controls
31 lines (27 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/local/bin/python
# -*- coding: latin-1 -*-
import cgitb
cgitb.enable()
import cgi
from MemberList import MemberList
from ErrorPage import ErrorPage
from PersonReg import PersonReg
'''A smaller version of "saveChanges.cgi". Deletes one or many agents depending
on from which page (form) it is cgi is called.'''
register = PersonReg("database.db")
form = cgi.FieldStorage()
button_type = form.getfirst("button")
try:
if button_type == "2":
singleAgent = form.getfirst('id')
register.deleteAgent(singleAgent)
else:
checkboxvals = form.getlist('checkid')
register.deleteAgents(checkboxvals)
print 'Content-type: text/html\r\n'
page = MemberList("Member List")
page.renderPage()
except:
print 'Content-type: text/html\r\n'
page = ErrorPage("Invalid data")
page.renderPage()