コード例 #1
0
ファイル: publicweb.py プロジェクト: rcarmo/divmod.org
    def fromRequest(cls, store, request):
        """
        Return a L{LoginPage} which will present the user with a login prompt.

        @type store: L{Store}
        @param store: A I{site} store.

        @type request: L{nevow.inevow.IRequest}
        @param request: The HTTP request which encountered a need for
            authentication.  This will be effectively re-issued after login
            succeeds.

        @return: A L{LoginPage} and the remaining segments to be processed.
        """
        location = URL.fromRequest(request)
        segments = location.pathList(unquote=True, copy=False)
        segments.append(request.postpath[0])
        return cls(store, segments, request.args)
コード例 #2
0
ファイル: publicweb.py プロジェクト: jonathanj/mantissa
    def fromRequest(cls, store, request):
        """
        Return a L{LoginPage} which will present the user with a login prompt.

        @type store: L{Store}
        @param store: A I{site} store.

        @type request: L{nevow.inevow.IRequest}
        @param request: The HTTP request which encountered a need for
            authentication.  This will be effectively re-issued after login
            succeeds.

        @return: A L{LoginPage} and the remaining segments to be processed.
        """
        location = URL.fromRequest(request)
        segments = location.pathList(unquote=True, copy=False)
        segments.append(request.postpath[0])
        return cls(store, segments, request.args)
コード例 #3
0
ファイル: adminpage.py プロジェクト: fusionapp/mantissa
 def produceResource(self, request, segments, viewer):
     if segments == tuple([self.redirectFrom]):
         return (URL.fromRequest(request).child(self.redirectTo), ())
コード例 #4
0
 def produceResource(self, request, segments, viewer):
     if segments == tuple([self.redirectFrom]):
         return (URL.fromRequest(request).child(self.redirectTo), ())