Exemple #1
0
### Blake Asdorian 4/28/01
### /project/admin/admin_logout
########
### This page should set an expired cookie to logout the site administrator


import Ns
import zz

zz.set_cookie("bosphorous", None)

conn = Ns.GetConn()
conn.ReturnRedirect("http://10.11.0.129/project/front.py")
conn.ReturnOK()
Exemple #2
0
<form action="admin_login.py">
<table>
<tr><td>Login Email:</td><td><input type=text name=who size=20></td></tr>
<tr><td>Login Passcode:</td><td><input type=password name=what size=20></td></tr>
</table>
<input type=submit>
</form>
</body></html>'''

query_exists = 0
mail = '*****@*****.**'
passwd = 'ukraine'

try:
	query=conn.GetQuery()
	query_exists = 1
except RuntimeError:
	query_exists = 0

if (query_exists == 1):
	who = query.Get('who')
	what = query.Get('what')
	if ((who==mail) and (what==passwd)):
		zz.set_cookie('bosphorous','straight',1)
		conn.ReturnRedirect('http://10.11.0.129/project/admin/admin2.py')
	else:
		conn.ReturnRedirect('http://10.11.0.129/project/front.py')
else:
	conn.ReturnHtml(200,html_login)