Exemple #1
0
 def post(self):
     self.require_setting('bcrypt_salt', 'bcrypt for Password')
     usr = self.get_argument("usr", default = "")
     pwd = self.get_argument("pwd", default = "")
     email = self.get_argument("email", default = "")
     error = []
     error.extend(self.check_username(usr.lower(), queryDB = True))
     error.extend(self.check_password(pwd))
     error.extend(self.check_email(email, queryDB = True))
     if error:
         self.render("signup.html", locals())
         return
     member = Member()
     member.username = usr
     member.username_lower = usr.lower()
     member.password = bcrypt.hashpw(pwd, self.settings['bcrypt_salt'])
     member.email = email
     member.gravatar_link = self.get_gravatar_url(email)
     member.create = datetime.datetime.now()
     self.db.add(member)
     self.db.commit()
     auth = self.create_auth(member.id)
     self.set_secure_cookie('auth', auth.secret)
     self.set_secure_cookie('uid', str(auth.member_id))
     self.redirect('/')
Exemple #2
0
 def post(self):
     self.require_setting('bcrypt_salt', 'bcrypt for Password')
     usr = self.get_argument("usr", default="")
     pwd = self.get_argument("pwd", default="")
     email = self.get_argument("email", default="")
     error = []
     error.extend(self.check_username(usr.lower(), queryDB=True))
     error.extend(self.check_password(pwd))
     error.extend(self.check_email(email, queryDB=True))
     if error:
         self.render("signup.html", locals())
         return
     member = Member()
     member.username = usr
     member.username_lower = usr.lower()
     member.password = bcrypt.hashpw(pwd, self.settings['bcrypt_salt'])
     member.email = email
     member.gravatar_link = self.get_gravatar_url(email)
     member.create = datetime.datetime.now()
     self.db.add(member)
     self.db.commit()
     auth = self.create_auth(member.id)
     self.set_secure_cookie('auth', auth.secret)
     self.set_secure_cookie('uid', str(auth.member_id))
     self.redirect('/')
Exemple #3
0
 def post(self):
     usr = binascii.b2a_hex(uuid.uuid4().bytes)[3:10]
     pwd = binascii.b2a_hex(uuid.uuid4().bytes)[3:10]
     email = usr + "@gmail.com"
     error = []
     error.extend(self.check_username(usr.lower(), queryDB = True))
     error.extend(self.check_password(pwd))
     error.extend(self.check_email(email, queryDB = True))
     if error:
         self.render("signup.html", locals())
         return
     member = Member()
     member.username = usr
     member.username_lower = usr.lower()
     member.password = bcrypt.hashpw(pwd, self.settings['bcrypt_salt'])
     member.email = email
     member.gravatar_link = self.get_gravatar_url(email)
     member.create = datetime.datetime.now()
     self.db.add(member)
     self.db.commit()
     auth = self.create_auth(member.id)
     self.set_secure_cookie('auth', auth.secret)
     self.set_secure_cookie('uid', str(auth.member_id))
     self.redirect('/')
Exemple #4
0
 def post(self):
     usr = binascii.b2a_hex(uuid.uuid4().bytes)[3:10]
     pwd = binascii.b2a_hex(uuid.uuid4().bytes)[3:10]
     email = usr + "@gmail.com"
     error = []
     error.extend(self.check_username(usr.lower(), queryDB=True))
     error.extend(self.check_password(pwd))
     error.extend(self.check_email(email, queryDB=True))
     if error:
         self.render("signup.html", locals())
         return
     member = Member()
     member.username = usr
     member.username_lower = usr.lower()
     member.password = bcrypt.hashpw(pwd, self.settings['bcrypt_salt'])
     member.email = email
     member.gravatar_link = self.get_gravatar_url(email)
     member.create = datetime.datetime.now()
     self.db.add(member)
     self.db.commit()
     auth = self.create_auth(member.id)
     self.set_secure_cookie('auth', auth.secret)
     self.set_secure_cookie('uid', str(auth.member_id))
     self.redirect('/')