示例#1
0
 def check(self, app, environ, start_response):
     url = request.path
     fields = dict(request.GET)
     if fields.has_key('hash'):
         dburl = URLHash.find_by_hash(fields['hash']).url
         if dburl is not None:
             if url.startswith(dburl):
                 return app(environ, start_response)
     raise NotAuthorizedError("You are not authorised to view this page")
示例#2
0
文件: auth.py 项目: Ivoz/zookeepr
 def check(self, app, environ, start_response):
     url = request.path
     fields = dict(request.GET)
     if fields.has_key('hash'):
         dburl = URLHash.find_by_hash(fields['hash']).url
         if dburl is not None:
             if url.startswith(dburl):
                 return app(environ, start_response)
     raise NotAuthorizedError(
         "You are not authorised to view this page"
     )
示例#3
0
    def lookup(self, hash):
        c.hash = URLHash.find_by_hash(hash)
        if c.hash is None:
            abort(404, "Sorry, Invalid Hash.")

        return self.transfer(url=c.hash.url)
示例#4
0
    def lookup(self, hash):
        c.hash = URLHash.find_by_hash(hash)
        if c.hash is None:
            abort(404, "Sorry, Invalid Hash.")

        return self.transfer(url=c.hash.url)