Thanks a lot!
I find this being a good solution:

==in admin.html==
{{=A(("Delete this user"), _href=URL('deleteusr'))}}

==in the controller file==
def deleteusr():
        db(custom_auth_table.username==session.username).delete()
        redirect(URL('admin'))

On Jan 2, 8:19 pm, Jonathan Lundell <[email protected]> wrote:
> On Jan 2, 2011, at 11:10 AM, Arun K.Rajeevan wrote:
>
> > Try this,
> > <a href="#" onclick="ajax('{{=URL('deleteusr')}}',[],''); 
> > window.location.reload();">Delete this
> > user</a>
>
> > I haven't tested, but must work.
>
> If I were coding this for myself, I think I'd self-submit and conditionally 
> do the user-delete and redirect in the original controller.

Reply via email to