hello mate,
I wonder  because I noticed that in auth, when the user fails to login
(enter a fake username and password) there is no error message
returned...

Here is a small code

######### Model
auth.settings.table_user = db.define_table(
    db.Field('email', length=128,default=''),
    db.Field('password', 'password', readable=False,label='Password',
requires=CRYPT()),
    migrate=False)
db.auth_user.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, '%s.email'
                                 %
auth.settings.table_user._tablename)]

######### Controller
def login():
   return dict(loginform = auth.login() )

######### View
<h2> {{if loginform.errors.email:}} Email {{=loginform.errors.email}}
{{pass}} </h2>
<h2> {{if loginform.errors.password:}} Password
{{=loginform.errors.password}}{{pass}}  </h2>
<h2> {{if loginform.errors.error_message :}} Invalid {{pass}}  </h2>

<br/>
<br/>
      {{=loginform.custom.begin}}
      <table>
        <tr>
          <td>Emailing:</td>
          <td>{{=loginform.custom.widget.email}}</td>
        </tr>
        <tr>
          <td>Password:</td>
          <td>{{=loginform.custom.widget.password}}</td>
        </tr>
        <tr>
          <td>{{=loginform.custom.submit}}</td>
              <td></td>
            </tr>
      </table>
      {{=loginform.custom.end}}



I when to capture the error message of the failure using
"form.error.XXX" not through session.flash...

Please let me know if you have any hints...

Yannick P.

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.


Reply via email to