示例#1
0
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])
示例#2
0
    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)
示例#3
0
	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)
示例#4
0
    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)