Monday, November 21, 2011

web2py: hide register link on page

The following code will hide the link but also disable the function to register user completely even you create the record from appadmin menu.

auth.settings.actions_disabled=['register']

So here's how I do...

# all we need is login
auth.settings.actions_disabled=['change_password','request_reset_password','retrieve_username','profile']
if request.controller != 'appadmin':
    auth.settings.actions_disabled +=['register']

In this way, it's disabled for users but not admin.

No comments:

Post a Comment