Exemplo n.º 1
0
 def change_pwd(self):
     if c.user:
         user = meta.DBSession.query(Person).filter_by(
                         email=c.user.email.lower()).first()
         c.person = user
         if user.is_authenticated(self.form_result['password']):
             #a = Activity(site_id=user.site_id,person_id=user.id,activity='Changing Password',category='account')
             #a.save()
             add_activity(user,activity='Changing Password',category='account')
             user.set_password(self.form_result['password1'])
             user.save()
             h.add_alert("Your Password was updated")
         else:
             h.add_error("We were not able to verify the \
                 existing password, please try again")
     return render('/account/settings.html')
Exemplo n.º 2
0
 def change_pwd(self,id=0):
     if self.user:
         user = meta.DBSession.query(Person).filter_by(
                         email=self.user.email.lower()).first()
         
         person = user
         if user.hashed_password == None or user.is_authenticated(self.get_argument('password')):
             #a = Activity(site_id=user.site_id,person_id=user.id,activity='Changing Password',category='account')
             #a.save()
             add_activity(user,activity='Changing Password',category='account')
             user.set_password(self.get_argument('password1'))
             user.save()
             self.add_alert("Your Password was updated")
         else:
             self.add_error("We were not able to verify the \
                 existing password, please try again")
     self.render('/user/settings.html',person=person)