eccolo

On Sat, Jul 25, 2009 at 3:42 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:

>
> Can you please email it to me?
>
> Massimo
>
> On Jul 19, 2:14 pm, "Sebastian E. Ovide" <sebastianov...@gmail.com>
> wrote:
> > just in case it could be useful:
> >
> > Index: tools.py
> > ===================================================================
> > --- tools.py    (revision 1140)
> > +++ tools.py    (working copy)
> > @@ -396,6 +396,7 @@
> >          self.messages.invalid_email = 'Invalid email'
> >          self.messages.invalid_login = 'Invalid login'
> >          self.messages.invalid_user = 'Invalid user'
> > +        self.messages.invalid_password = 'Invalid password'
> >          self.messages.is_empty = "Cannot be empty"
> >          self.messages.mismatched_password = "Password fields don't
> match"
> >          self.messages.verify_email = \
> > @@ -1173,7 +1174,8 @@
> >              label=self.messages.old_password,
> >              requires=validators(
> >                       self.settings.table_user[passfield].requires,
> > -                     IS_IN_DB(s, '%s.%s' % (usern, passfield)))),
> > +                     IS_IN_DB(s, '%s.%s' % (usern,passfield),
> > +
> > error_message=self.messages.invalid_password))),
> >              sql.SQLField('new_password', 'password',
> >              label=self.messages.new_password,
> >              requires=self.settings.table_user[passfield].requires),
> >
> > Sebastian E. Ovide
> >
> > Sent from Dublin, Ireland
> >
> > On Sun, Jul 19, 2009 at 7:28 PM,
> > sebastianovide+...@gmail.com <sebastianovide%2b...@gmail.com><
> sebastianovide%2b...@gmail.com <sebastianovide%252b...@gmail.com>>
> >
> > <sebastianov...@gmail.com> wrote:
> >
> > > I have just tried and it is working fine for mismatched_password....
> >
> > > but in case the old password is wrong the message is still "value not
> > > in database!"
> >
> > > On Jun 25, 4:25 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > Try the trunk and the following customizations:
> >
> > > >         auth.messages.invalid_email = 'Invalid email'
> > > >         auth.messages.invalid_login = 'Invalid login'
> > > >         auth.messages.invalid_user = 'Invalid user'
> > > >         auth.messages.is_empty = "Cannot be empty"
> > > >         auth.messages.mismatched_password = "Password fields don't
> > > > match"
> >
> > > > Massimo
> >
> > > > On Jun 25, 7:35 am, "Sebastian E. Ovide" <sebastianov...@gmail.com>
> > > > wrote:
> >
> > > > > Hi,
> >
> > > > > Using Auth.change_password I noticed that if the 2 password do not
> > > match
> > > > > web2py is giving the message "invalid expression!" and if the
> password
> > > is
> > > > > not valid the message is "value not in database!". Is it possible
> to
> > > change
> > > > > those strings with some more user friendly ones ?
> >
> > > > > thanks
> >
> > > > > Sebastian E. Ovide
> >
>


-- 

Sebastian E. Ovide


Sent from Dublin, Ireland

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

### Eclipse Workspace Patch 1.0
#P web2py
Index: gluon/tools.py
===================================================================
--- gluon/tools.py      (revision 1140)
+++ gluon/tools.py      (working copy)
@@ -396,6 +396,7 @@
         self.messages.invalid_email = 'Invalid email'
         self.messages.invalid_login = 'Invalid login'
         self.messages.invalid_user = 'Invalid user'
+        self.messages.invalid_password = 'Invalid password'
         self.messages.is_empty = "Cannot be empty"
         self.messages.mismatched_password = "Password fields don't match"
         self.messages.verify_email = \
@@ -621,7 +622,7 @@
         elif 'email' in keys:
             username = 'email'
         else:
-            raise SyntaxError, "user must have username of email"
+            raise SyntaxError, "user must have username or email"
         table_user = self.settings.table_user
         passfield = self.settings.password_field
         users = self.db(table_user[username] == keys[username]).select()
@@ -1173,7 +1174,8 @@
             label=self.messages.old_password,
             requires=validators(
                      self.settings.table_user[passfield].requires,
-                     IS_IN_DB(s, '%s.%s' % (usern, passfield)))),
+                     IS_IN_DB(s, '%s.%s' % (usern,passfield),
+                              error_message=self.messages.invalid_password))),
             sql.SQLField('new_password', 'password',
             label=self.messages.new_password,
             requires=self.settings.table_user[passfield].requires),
@@ -1402,7 +1404,7 @@
         def decorator(action):
 
             def f(*a, **b):
-                if not self.basic() and not not self.is_logged_in():
+                if not self.basic() and not self.is_logged_in():
                     args = self.environment.request.args
                     redirect(self.settings.login_url + \
                                  '?_next='+urllib.quote(self.url(args=args)))
@@ -1643,6 +1645,7 @@
         self.settings.download_url = self.url('download')
         self.settings.create_onvalidation = None
         self.settings.update_onvalidation = None
+        self.settings.delete_onvalidation = None
         self.settings.create_onaccept = None
         self.settings.update_onaccept = None
         self.settings.update_ondelete = None
@@ -1881,6 +1884,8 @@
             message = self.messages.record_deleted
         record = table[record_id]
         if record:
+            if self.settings.delete_onvalidation:
+                self.settings.delete_onvalidation(record)
             del table[record_id]
             if self.settings.delete_onaccept:
                 self.settings.delete_onaccept(record)

Reply via email to