I'm in a project with a tight timeframe as usual and we've desided upon Drupal as the community framework.
My problem is easy to describe:
The standard behaviour in Drupal is to let anonymous users register themself via the login block. There is also the option to only let administrators add new users in the administration portion of Drupal.
My wish is to change this behaviour to let only admins AND authenticated users add new users to the community. The authenticated users shall however NOT be able to see the listing of all the other users on the site (as the admin can do in the index.php?q=admin/user/user) and the new users must be approved later on by an admin before actually being activated. An anonymous user shall not be able to register at all (in any way).
The problem spells; how to change this behaviour?
Must I go about and alter some function(s) in the file user.module? Is this even recommended, or is there a better way?
If someone knows the fast way on how to do this right, please don´t hesitate to let me know. I would gladly appreciate it.
I have searched the forum but without luck...
I am also perfectly alright with the looks and behaviour of the node index.php?q=user/register
The only problem is that this node is not accessible when logged in (when authenticated), it´s only accessible when I'm an anoymous user. Is there a way to access it when logged in as well?
Comments
I'm interested
also
Tough question?
To clarify, with authenticated users I mean registered users. This comes in handy when you have a closed community where only registered members should be able to register other new members. This way I will have a log over which user register which for later computing.
Well, I have tried to change the user/register-path in function "user_menu" in user.module so 'access' => TRUE (just an experiment), but the change doesn´t seem to "take"... in fact I can comment away the whole function and it doesn´t seem to matter at all.
Anyone knows why?
Tough question?
To clarify, with authenticated users I mean registered users. This comes in handy when you have a closed community where only registered members should be able to register other new users. This way I will have a log over which user register which for later computing.
Well, I have tried to change the user/register-path in function "user_menu" in user.module so 'access' => TRUE (just an experiment), but the change doesn´t seem to "take"... in fact I can comment away the whole function and it doesn´t seem to matter at all.
Anyone knows why?
I would also be very
I would also be very interested in getting around this but just to quickly answer your question... The reason is because in user_register() function there is this line of code:
This basically says if you aren't admin and are already logged in, redirect to user/%uid... So no matter what the access check is, this will ALWAYS redirect you if those conditions are true... It'd be a lot better if there was a third check (in the if statement) which could be set in the function as a parameter. Or even not hard code what $admin means and let the user specify another access statement.
I'm still looking around for a solution to this (without using a contributed module [such as ucreate] since it is interfering with other modules)... I'll let you know if I find anything of interest/a solution :)
EDIT: I just realised that the original post was made in 2007... Ahhh well, better late than never! ;)