Ejemplo n.º 1
0
 def POST(self):
     i = web.input()
     f = forms.forgot_password()
     if not f.validates(i):
         return render.forgot_password(f)
     else:
         from infogami.infobase.client import ClientException
         try:
             delegate.admin_login()
             d = web.ctx.site.get_reset_code(i.email)
         except ClientException, e:
             f.note = str(e)
             web.ctx.headers = []
             return render.forgot_password(f)
         else:
Ejemplo n.º 2
0
 def POST(self):
     i = web.input()
     f = forms.forgot_password()
     if not f.validates(i):
         return render.forgot_password(f)
     else:
         from infogami.infobase.client import ClientException
         try:
             delegate.admin_login()
             d = web.ctx.site.get_reset_code(i.email)
         except ClientException, e:
             f.note = str(e)
             web.ctx.headers = []
             return render.forgot_password(f)
         else:
Ejemplo n.º 3
0
    def POST(self):
        i = web.input()
        f = forms.forgot_password()
        if not f.validates(i):
            return render.forgot_password(f)
        else:
            from infogami.infobase.client import ClientException
            try:
                delegate.admin_login()
                d = web.ctx.site.get_reset_code(i.email)
            except ClientException as e:
                f.note = str(e)
                web.ctx.headers = []
                return render.forgot_password(f)
            else:
                # clear the cookie set by delegate.admin_login
                # Otherwise user will be able to work as admin user.
                web.ctx.headers = []

            msg = render.password_mailer(web.ctx.home, d.username, d.code)
            web.sendmail(config.from_address, i.email, msg.subject.strip(), str(msg))
            return render.passwordsent(i.email)
Ejemplo n.º 4
0
 def GET(self):
     f = forms.forgot_password()
     return render.forgot_password(f)
Ejemplo n.º 5
0
 def GET(self):
     f = forms.forgot_password()
     return render.forgot_password(f)