def GET(self): if not isAdmin(session.user): raise web.seeother('/admin') data = web.input() if 'page' in data and 'title' in data and 'code' in data: make_new_page(data) raise web.seeother('/course_control') new_page = new_page_form() return render.new_page(new_page, data['page'])
def GET(self): if not isAdmin(session.user): raise web.seeother('/admin_login') data = web.input() if 'page' in data and 'title' in data and 'code' in data: process_edit_page(data) raise web.seeother('/course_control') edit_page = edit_page_form(data['page']) return render.edit_page(edit_page, data['page'])
def POST(self): my_signin = admin_signin_form() if not my_signin.validates(): return render.admin_login(session.user, my_signin) else: session.user = my_signin['username'].value raise web.seeother('/admin')
def POST(self): my_signin = signin_form() if not my_signin.validates(): return render.main(session.user, my_signin) else: session.user = my_signin['username'].value raise web.seeother('/summary')
def GET(self): data = web.input() if 'session' in data: session_id = data['session'] session_file = join('..', 'login', 'SSL', 'sessions', session_id) if exists(session_file): f = open(session_file, 'r') text = f.read().split('\n') username = text[0] t = int(text[1]) print "trying to make session with username: "******" time: ", t print "current time: ", int(time() * 1000) if abs(time() * 1000 - t + (60 * 1000)) < 600000: session.user = username raise web.seeother('/magic?page=/summary')
def GET(self): if not isAdmin(session.user): raise web.seeother('/admin_login') script = """function showHideToggle(id) { var obj = document.getElementById("div"+id); var obj1 = document.getElementById("sh"+id); if (obj.style.display == 'none') { obj1.innerHTML = '▼'; obj.style.display = ''; } else { obj1.innerHTML = '▶'; obj.style.display = 'none'; } } """ js_obj = js(script=script) html = (sidebar_css(), js_obj, lesson_layout(content=lesson_content( title="Course Control page", content=getCourseTree(), path=None))) return render.course_control(html)
def GET(self): raise web.seeother('https://inst.eecs.berkeley.edu/~cs61as/fa11/lib')
def GET(self): raise web.seeother('https://inst.eecs.berkeley.edu/~cs61as/complain')
def GET(self): raise web.seeother('http://inst.eecs.berkeley.edu/~cs61as/reader/vol2.html')
def GET(self): raise web.seeother('http://mitpress.mit.edu/sicp/full-text/book/book.html')
def GET(self): web.debug('[USER] %s logged out' % (session.user)) session.kill() raise web.seeother(main_page)
def GET(self): raise web.seeother('/magic?page=/summary')
def GET(self): if not isAdmin(session.user): raise web.seeother('not_accessible') return render.admin(getAdminPage())
def GET(self): if not isAdmin(session.user): raise web.seeother('/admin_login') return render.course_control(getCourseTree())
def GET(self): if not isAdmin(session.user): raise web.seeother('/admin_login') return render.admin(getAdminPage())
def GET(self): my_signin = signin_form() session = web.config.get('_session') if (isStudent(session.user) or isAdmin(session.user)): raise web.seeother('/summary') return render.main(session.user, my_signin)