Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (27 sloc) 781 Bytes
import memcache
from PHPUnserialize import *
from conf import *
class SessionInspector():
def __init__(self):
global prefix, auth_key
self.prefix = prefix
self.auth_key = auth_key
def getData(self, key):
raise NotImplementedError("getData is an abstract method")
def isauth(self, key):
data = self.getData(key)
if not data:
return False
session = PHPUnserialize().session_decode(data)
return session[self.auth_key]
return False
class SessionInspectorMemcache(SessionInspector):
def __init__(self):
global sessServers = memcache.Client(sessServers, debug=0)
def getData(self, key):
return + key)
Something went wrong with that request. Please try again.