def POST(self): uname = str(web.input()['userName']) a = owevent.authenticated(owglobal.session.datapath, owglobal.session.host, "Facebook:"+uname) owglobal.server.post_event(a) output.dbg(str(owglobal.session.host)+\ " is authenticated with %s" % uname, self.__class__.__name__) return ''' <html><head><title>Open WiFi: Towards Access Everywhere...</title></head> <body> <center> <h2>Welcome to OpenWiFi<sup>beta</sup>!</h2> <h4>A Stanford Research Project</h4> <table align=centerwidth=600 border=0> <td><tr>Hi %s, hope you will enjoy OpenWiFi! </td></tr> <tr><td> </td></tr> <tr><td> </td></tr> <tr><td> <a href="about">About OpenWiFi</a>   <a href="tos">Terms of Service</a>. </td></tr> </table> </center> </body> </html> ''' % uname
def POST(self): uname = str(web.input()['userName']) a = owevent.authenticated(owglobal.session.datapath, owglobal.session.host, "Facebook:" + uname) owglobal.server.post_event(a) output.dbg(str(owglobal.session.host)+\ " is authenticated with %s" % uname, self.__class__.__name__) return ''' <html><head><title>Open WiFi: Towards Access Everywhere...</title></head> <body> <center> <h2>Welcome to OpenWiFi<sup>beta</sup>!</h2> <h4>A Stanford Research Project</h4> <table align=centerwidth=600 border=0> <td><tr>Hi %s, hope you will enjoy OpenWiFi! </td></tr> <tr><td> </td></tr> <tr><td> </td></tr> <tr><td> <a href="about">About OpenWiFi</a>   <a href="tos">Terms of Service</a>. </td></tr> </table> </center> </body> </html> ''' % uname
def GET(self): """Response to get """ oid = web.webopenid.status() body = ''' <html><head><title>Open WiFi: Towards Access Everywhere...</title></head> <body> <center> <h2>Welcome to OpenWiFi<sup>beta</sup>!</h2> <h4>A Stanford Research Project</h4> ''' if oid: body += self.get_logout() a = owevent.authenticated(owglobal.session.datapath, owglobal.session.host, oid) owglobal.server.post_event(a) output.dbg(str(owglobal.session.host)+\ " is authenticated with %s" % oid, self.__class__.__name__) else: if (owglobal.session.datapath == None or (not isinstance(owglobal.session.datapath, list))): owglobal.session.datapath = owglobal.last_host_redirect[0] owglobal.session.host = owglobal.last_host_redirect[1] body += self.get_login() u = owevent.unauthenticated(owglobal.session.datapath, owglobal.session.host) owglobal.server.post_event(u) body += ''' <br> </td></tr> <tr><td> <a href="about">About OpenWiFi</a>   <a href="tos">Terms of Service</a>. </td></tr> </table> </center> </body> </html> ''' return body