import zz ######################content_submission.py, by Tom Hickerson, 04/24/01 ### the goal: create a content submission page, where content can ### be submitted as a caselist (if only the team_id and content_type ### fields are present in a query) or a comment (if list_id is present ### too. Content_type might not be required, but we'll see... ### modified gt-check, lt-check on 04/29/01, tbh conn = Ns.GetConn() db = Ns.DbHandle(Ns.DbPoolDefault(conn.Server())) ############### check for cookie, if none is found, redirect to login page. ############### if one is found, generate who-am-i list based on school affiliated emails school_id = zz.get_cookie('valid_code') if not (school_id): conn.ReturnRedirect('http://10.11.0.129/project/submit/not_logged_in.py') ############################ find if there is a query #### build chunks of html code, then sql statements html_form = '''<html><head><title>Content Submission Page </head></title><body bgcolor=white> <h2>%s Submission</h2> <br> <form method="post" action="content_submission4.py"> <table> %s
html_teams = '''<tr bgcolor=%s> <td><input type=checkbox value="%s" name=selected></td> <td>%s</td> <td>%s</td> <td>%s</td> </tr>''' ### check to see if user is a valid admin; if not, redirect status_sql = ''' SELECT access_level FROM persons WHERE person_id = %s;''' cookie = zz.get_cookie('bosphorous') #db = Ns.DbHandle(Ns.DbPoolDefault(conn.Server())) if (cookie): pass #search = status_sql % (cookie) #admin_res = db.Select(search) #while (db.GetRow(admin_res)==Ns.OK): #if (admin_res[0]=='basic'): #conn.ReturnRedirect('http://10.11.0.129/project/front.py') else: conn.ReturnRedirect('http://10.11.0.129/project/admin/admin_login.py') ########begin to fetch info through sql Selects