Ejemplo n.º 1
0
    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>&nbsp</td></tr>
        <tr><td>&nbsp</td></tr>
        <tr><td>
        <a href="about">About OpenWiFi</a>&nbsp&nbsp
        <a href="tos">Terms of Service</a>.
        </td></tr>
        </table>   
        </center>
        </body>
        </html>
''' % uname
Ejemplo n.º 2
0
    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>&nbsp</td></tr>
        <tr><td>&nbsp</td></tr>
        <tr><td>
        <a href="about">About OpenWiFi</a>&nbsp&nbsp
        <a href="tos">Terms of Service</a>.
        </td></tr>
        </table>   
        </center>
        </body>
        </html>
''' % uname
Ejemplo n.º 3
0
    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>&nbsp&nbsp
        <a href="tos">Terms of Service</a>.
        </td></tr>
        </table>
        </center>   
        </body>
        </html>
        '''
        
        return body
Ejemplo n.º 4
0
    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>&nbsp&nbsp
        <a href="tos">Terms of Service</a>.
        </td></tr>
        </table>
        </center>   
        </body>
        </html>
        '''

        return body