Ejemplo n.º 1
0
def update_profile(fullname, password=None):
	if not fullname:
		return _("Name is required")
	
	webnotes.conn.set_value("Profile", webnotes.session.user, "first_name", fullname)
	webnotes.add_cookies["full_name"] = fullname
		
	if password:
		from webnotes.auth import update_password
		update_password(webnotes.session.user, password)

	return _("Updated")
Ejemplo n.º 2
0
def update_profile(fullname, password=None):
    if not fullname:
        return _("Name is required")

    webnotes.conn.set_value("Profile", webnotes.session.user, "first_name",
                            fullname)
    webnotes.add_cookies["full_name"] = fullname

    if password:
        from webnotes.auth import update_password
        update_password(webnotes.session.user, password)

    return _("Updated")
Ejemplo n.º 3
0
	def update_new_password(self):
		"""update new password if set"""
		if self.doc.new_password:
			from webnotes.auth import update_password
			update_password(self.doc.name, self.doc.new_password)
			
			if not self.is_new:
				self.password_reset_mail(self.doc.new_password)
				webnotes.msgprint("Password updated.")
			else:
				self.send_welcome_mail(self.doc.new_password)
				webnotes.msgprint("New user created. - %s" % self.doc.name)
				
			webnotes.conn.set(self.doc, 'new_password', '')
Ejemplo n.º 4
0
	def update_new_password(self):
		"""update new password if set"""
		if self.doc.new_password:
			from webnotes.auth import update_password
			update_password(self.doc.name, self.doc.new_password)
			
			if self.in_insert:
				webnotes.msgprint("New user created. - %s" % self.doc.name)
				if cint(self.doc.send_invite_email):
					webnotes.msgprint("Sent welcome mail.")
					self.send_welcome_mail(self.doc.new_password)
			else:
				self.password_reset_mail(self.doc.new_password)
				webnotes.msgprint("Password updated.")
				
			webnotes.conn.set(self.doc, 'new_password', '')
Ejemplo n.º 5
0
    def update_new_password(self):
        """update new password if set"""
        if self.doc.new_password:
            from webnotes.auth import update_password
            update_password(self.doc.name, self.doc.new_password)

            if self.in_insert:
                webnotes.msgprint("New user created. - %s" % self.doc.name)
                if cint(self.doc.send_invite_email):
                    webnotes.msgprint("Sent welcome mail.")
                    self.send_welcome_mail(self.doc.new_password)
            else:
                self.password_reset_mail(self.doc.new_password)
                webnotes.msgprint("Password updated.")

            webnotes.conn.set(self.doc, 'new_password', '')
Ejemplo n.º 6
0
 def update_admin_password(self, password):
     from webnotes.auth import update_password
     webnotes.conn.begin()
     update_password("Administrator",
                     getattr(conf, "admin_password", password))
     webnotes.conn.commit()
Ejemplo n.º 7
0
	def update_admin_password(self, password):
		from webnotes.auth import update_password
		webnotes.conn.begin()
		update_password("Administrator", getattr(conf, "admin_password", password))
		webnotes.conn.commit()