예제 #1
0
  def post(self):
    account = self.request.get('account')
    user = self.request.get('user')
    password = self.request.get('password')

    am = lccs.accountmanager(account)
    am.login(user, password)

    ctx = base64.standard_b64encode(pickle.dumps(am, -1))
    self.response.headers.add_header('Set-Cookie', "LCCS=%s" % ctx)

    templateWrite(self.response.out, 'main.html', { 'account' : am.url });
예제 #2
0
파일: lccs_gae.py 프로젝트: nimasoroosh/ics
    def post(self):
        account = self.request.get('account')
        user = self.request.get('user')
        password = self.request.get('password')

        am = lccs.accountmanager(account)
        am.login(user, password)

        ctx = base64.standard_b64encode(pickle.dumps(am, -1))
        self.response.headers.add_header('Set-Cookie', "LCCS=%s" % ctx)

        templateWrite(self.response.out, 'main.html', {'account': am.url})
예제 #3
0
파일: lccs_gae.py 프로젝트: ndcollins/ics
    def post(self):
        account = self.request.get("account")
        user = self.request.get("user")
        password = self.request.get("password")

        am = lccs.accountmanager(account)
        am.login(user, password)

        ctx = base64.standard_b64encode(pickle.dumps(am, -1))
        self.response.headers.add_header("Set-Cookie", "LCCS=%s" % ctx)

        templateWrite(self.response.out, "main.html", {"account": am.url})
예제 #4
0
  def __init__(self):
    self.am = lccs.accountmanager(self.ACCOUNT)
    self.am.login(self.USER, self.PASSWORD)
    self.lastaccess = datetime.now()

    logging.info("connected...")

    try:
      self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_DEALER)
      self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_PLAYERS)
      self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_PLAY)
      self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_STATE)
    except lccs.error:
      # assume the error is because the room doesn't exists yet
      self.am.createRoom(self.ROOM)

    conf = { 
      'itemStorageScheme' : nodeconfiguration.STORAGE_SCHEME_SINGLE_ITEM,
      'publishModel'      : userrole.OWNER,
      'accessModel'       : userrole.VIEWER,
      'sessionDependentItems' : True
    }
    self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_DEALER, conf)

    conf = {
      'itemStorageScheme' : nodeconfiguration.STORAGE_SCHEME_MANUAL,
      'publishModel'      : userrole.OWNER,
      'accessModel'       : userrole.VIEWER,
      'sessionDependentItems' : True
    }
    self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_PLAYERS, conf)

    conf = { 
      'itemStorageScheme' : nodeconfiguration.STORAGE_SCHEME_SINGLE_ITEM, 
      'publishModel'      : self.ROLE_PLAY,
      'accessModel'       : userrole.VIEWER,
      'sessionDependentItems' : True
    }
    self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_PLAY, conf)

    conf = {
      'itemStorageScheme' : nodeconfiguration.STORAGE_SCHEME_SINGLE_ITEM,
      'publishModel'      : userrole.OWNER,
      'accessModel'       : userrole.VIEWER,
      'sessionDependentItems' : True
    }
    self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_STATE, conf)

    self.am.registerHook(self.HOOKURL)
    self.am.subscribeCollection(self.ROOM, "UserManager")
    self.am.subscribeCollection(self.ROOM, self.COLLECTION)
예제 #5
0
    def __init__(self):
        self.am = lccs.accountmanager(self.ACCOUNT)
        self.am.login(self.USER, self.PASSWORD)
        self.lastaccess = datetime.now()

        logging.info("connected...")

        try:
            self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_DEALER)
            self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_PLAYERS)
            self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_PLAY)
            self.am.removeNode(self.ROOM, self.COLLECTION, self.NODE_STATE)
        except lccs.error:
            # assume the error is because the room doesn't exists yet
            self.am.createRoom(self.ROOM)

        conf = {
            'itemStorageScheme': nodeconfiguration.STORAGE_SCHEME_SINGLE_ITEM,
            'publishModel': userrole.OWNER,
            'accessModel': userrole.VIEWER,
            'sessionDependentItems': True
        }
        self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_DEALER, conf)

        conf = {
            'itemStorageScheme': nodeconfiguration.STORAGE_SCHEME_MANUAL,
            'publishModel': userrole.OWNER,
            'accessModel': userrole.VIEWER,
            'sessionDependentItems': True
        }
        self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_PLAYERS, conf)

        conf = {
            'itemStorageScheme': nodeconfiguration.STORAGE_SCHEME_SINGLE_ITEM,
            'publishModel': self.ROLE_PLAY,
            'accessModel': userrole.VIEWER,
            'sessionDependentItems': True
        }
        self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_PLAY, conf)

        conf = {
            'itemStorageScheme': nodeconfiguration.STORAGE_SCHEME_SINGLE_ITEM,
            'publishModel': userrole.OWNER,
            'accessModel': userrole.VIEWER,
            'sessionDependentItems': True
        }
        self.am.createNode(self.ROOM, self.COLLECTION, self.NODE_STATE, conf)

        self.am.registerHook(self.HOOKURL)
        self.am.subscribeCollection(self.ROOM, "UserManager")
        self.am.subscribeCollection(self.ROOM, self.COLLECTION)