Here:

class MyAuth(Auth):
    def __init__(self, environment, T, db = None):
        "Initialise parent class & make any necessary modifications"
        Auth.__init__(self,environment,db)
        self.messages.logged_in = T("Logged in")
        self.messages.email_sent = T("Email sent")
        self.messages.email_verified = T("Email verified")
        self.messages.logged_out = T("Logged out")
        self.messages.registration_successful = T("Registration
successful")
        self.messages.invalid_email = T("Invalid email")
        self.messages.invalid_login = T("Invalid login")
        self.messages.verify_email_subject = T("Password verify")
        self.messages.username_sent = T("Your username was emailed to
you")
        self.messages.new_password_sent = T("A new password was
emailed to you")
        self.messages.password_changed = T("Password changed")
        self.messages.retrieve_username=str(T("Your username is"))+": %
(username)s"
        self.messages.retrieve_username_subject="Username retrieve"
        self.messages.retrieve_password=str(T("Your password is"))+": %
(password)s"
        self.messages.retrieve_password_subject = T("Password
retrieve")
        self.messages.profile_updated = T("Profile updated")


auth=MyAuth(globals(), T, db)              # authentication/
authorization
auth.settings.hmac_key='[value here]'
auth.settings.on_failed_authorization = URL(r=request, c='default',
f='user', args='not_authorized')
auth.settings.login_url = URL(r=request, c='default', f='user',
args='login')
auth.define_tables()                         # creates all needed
tables

And here is the default controller action:
def user():
    return dict(form=auth())

The View is pretty much the default:
{{extend 'layout.html'}}
<h2>{{=request.args(0).replace('_',' ').capitalize()}}</h2>
{{=form}}
{{if request.args(0)=='login':}}
<a href="{{=URL(r=request,args='register')}}">register</a><br />
<a href="{{=URL(r=request,args='retrieve_password')}}">lost password</
a><br />
{{pass}}

Thanks,
Winston


On Sep 7, 2:17 am, "mr.freeze" <[email protected]> wrote:
> Can you post your auth declaration (minus any sensitive data) and
> controller form code?
>
> On Sep 6, 2:35 pm, eddwinston <[email protected]> wrote:
>
> > Hi,
>
> > In my page, if I submits a form, the data is saved in the database but
> > if I hit F5 it saved that same data in the database again. Then I have
> > multiple submit. How do I stop this from happening?
>
> > Also I was trying out authentication in web2py and after registering a
> > user, the user is automatically signed  in. But if i log the user out
> > and try to login using the login form, nothing happens. Any idea why
> > this is happening?
>
> > Thanks
> > Winston
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to