def doFooter(): print "<div class=\"footer\">" print toHtml(libMain.get("product")) + " • " print "<a href=\"/cgi-bin/index.py\">Home</a> •"; print "<a href=\"/help/\">Help</a> •"; print "<a href=\"%s\">About</a> •" % (libMain.get("productURL"),) print "</div>"; print "</body></html>\n"
def userBox(): owner = libMain.get("owner") product = libMain.get("product") print "<div class='user' style='background-color:"+defconColour()+"'>" print "<div><i>"+toHtml(owner)+"</i>'s "+toHtml(product)+"</div>" print "<div>User [unknown] <a href='#'>Logout</a></div>" print "<div>Defcon <a href='admin.py'>5</a></div>" print "<div><a href='#'>Activity</a></div>" print "</div>"
def doHeader(title): user = libUser.getUser() owner = libMain.get("owner") product = libMain.get("product") urlLogout = libUser.getUrlLogout() print "Content-type: text/html; charset=UTF-8\n\n" print "<html><head><title>" + toHtml(title) + " - "+ toHtml(owner) + "'s "+toHtml(product)+"</title>" print print "<link rel=\"stylesheet\" href=\"/media/styles.css\" type=\"text/css\" />" print "</head><body>"; userBox(); print "<h1>"+title+"</h1>"
#!/usr/bin/env python # -*- coding: utf-8 -*- import cgitb cgitb.enable() import libMain import libView; libView.doHeader(libMain.get("product")) print "<p><a href=\"docs.py?path=/\">Documents</a></p>" print "<p><a href=\"links.py\">Bookmarks</a></p>" libView.doFooter();