Esempio n. 1
0
 def getid(self):
     if not self.contact.has_key("id"):
         userid = rhnSQL.Sequence("web_contact_id_seq")()
         self.contact.data["id"] = userid  # kind of illegal, but hey!
     else:
         userid = self.contact["id"]
     return userid
Esempio n. 2
0
 def generate(self, duration=None, web_user_id=None):
     # Grabs a session ID
     self.session_id = rhnSQL.Sequence('pxt_id_seq').next()
     self.duration = int(duration or CFG.SESSION_LIFETIME)
     self.web_user_id(web_user_id)
     return self