def style_change(**args): """update last_whiteboard, pen_font, pen_color""" from lib.chai import sess for key in args: if key not in ('name', '_method'): db.setvalue('user', sess['user'], key, args[key])
def request_reset_password(self): """generate a reset password id and mail the password to the user""" import hashlib, time from lib.chai import db, emailer import conf resetid = hashlib.sha224(str(time.time())).hexdigest() db.setvalue("user", self.obj["name"], "reset_password_id", resetid) d = { "fullname": self.obj.get("fullname", None) or self.obj["name"], "url": conf.app_url + "#reset_password/" + resetid, } emailer.send(recipients=[self.obj["email"]], subject="Password Reset", message=reset_email_message % d)
def request_reset_password(self): """generate a reset password id and mail the password to the user""" import hashlib, time from lib.chai import db, emailer import conf resetid = hashlib.sha224(str(time.time())).hexdigest() db.setvalue('user', self.obj['name'], 'reset_password_id', resetid) d = { 'fullname': self.obj.get('fullname',None) or self.obj['name'], 'url': conf.app_url + '#reset_password/' + resetid } emailer.send(recipients=[self.obj['email']], subject="Password Reset", message=reset_email_message % d)
def before_get(self): """update whiteboard setting in user""" from lib.chai import db, sess db.setvalue("user", sess["user"], "last_whiteboard", self.obj["name"], commit=True)