view login.py @ 508:64f8666690d8

README update (Logical change 1.149)
author optonline.net!jeffpc
date Fri, 16 Jan 2004 02:53:48 +0000
parents c6d44287810f
children dfeb0c137ffd
line wrap: on
line source

#!/usr/bin/python

#/*
# * AV Admin - Helps to manage an AV department
# *
# * Copyright (C) 2003, 2004 Josef "Jeff" Sipek
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License as published by
# * the Free Software Foundation; either version 2 of the License, or
# * (at your option) any later version.
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# * GNU General Public License for more details.
# *
# * You should have received a copy of the GNU General Public License
# * along with this program; if not, write to the Free Software
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# *
# * $Id$
# */

import av_conn
import av_settings

conn = av_conn.Conn(reqlogin=0)

conn.html.content("text/html")
conn.html.header("Login")
conn.html.heading("Login")

buff = ""
if (not conn.user.isloggedin()):
	buff += conn.parse(av_settings.getSetting(conn,"caution"))
	if (conn.user.TEXTBUF["loginerror"]):
		buff += conn.user.TEXTBUF["loginerror"]
	buff += "<br /><br />\n"
	buff += "<form action=\"" + conn.makeURL("login.py",usesid=0) + "\" method=\"post\">\n"
	buff += "<table class=\"plain\">\n"
	buff += "<tr><td class=\"main\">Username</td><td class=\"main\"><input type=\"text\" name=\"user\" value=\"\" /><input type=\"hidden\" name=\"login\" value=\"yes\" /></td></tr>\n"
	buff += "<tr><td class=\"main\">Password</td><td class=\"main\"><input type=\"password\" name=\"pass\" value=\"\" /></td></tr>\n"
	buff += "<tr><td class=\"main\" colspan=\"2\"><input type=\"submit\" class=\"submit\" value=\"Login\" /></td></tr>\n"
	buff += "</table>\n"
	buff += "</form>\n"
else:
	buff += "<br /><br />You have been successfully logged in."

conn.html.body.set(buff)
conn.html.footer()

print conn.flush()