def startSession(self,user=None): if not user: user = getSetting('last_user') if not user: return if self.session.username == user: return user,token = self.getUserToken(user) if not user: return False if not token: return False self.session.setUserToken(user, token) self.session.startSession() self.session.getNotebooks() return True
def getUserToken(self,user): token = getSetting('token_%s' % user) if not token: return False return user,token