tags:

views:

252

answers:

2

Using Drupal 6 I simply want to disable the user/1/openid page for authenticated users. How?

A: 

The best way (at least IMHO) is to go to the permissions page in the admin section and disable the permission to access that specific feature for your authenticated users.

That way you do not have to use any hooks or additional modules.

FlorianH
there is no special permission to access user's openid pages - if openid is enabled, every user can access her own user/<uid>/openid page.
ax
+2  A: 

By default, only users with the 'administer users' right can access openid pages of other users, so (as FlorianH suggested), you should check if your authenticated users have that right and if so, simply remove it. That way they can only access their own openid page.

If for some (hard to imagine) reason, you really want your authenticated users to have the 'administer users' right and really just block access to 'user/1/openid', you'd have to override the access callback of the 'user/%user/openid' menu path (registered by the openid module) to use a custom callback function of your own.

To do so, you'd need to implement hook_menu_alter(), which will be called with an array of all menu path items registered by any module in your system. In that array, you'd need to find the item defining the 'user/%user/openid' and exchange the function name in the 'access callback' entry from its default 'user_edit_access' to the name of your own custom callback function. In that, you'd return FALSE for the specific page you want to block (probably not for user 1 though), and call the original callback function for all other cases.

Henrik Opel
No - I mean block access to *their own* openid page. But I think what your suggesting would accomplish the same thing, now I've just got to figure out how...
EddyR