I love this module but there is one problem:

When users jump to a registration path the can make an account with the right roles, but when they are on the form they have the possibility to click on the "Create new account" button, when they do so immediately the normal create account form will be displayed, a new account on this form will let them make one with no role!

Please hide this tab or better prevent the normal way for not logged in users or only the site admin can..

Thanks in advance...
N

Comments

nielsvoo’s picture

Oke, by adding this to user.module it will be fixed also but prevent make it possible is better...

function user_menu_alter(&$item) {
// Hide the "Create new account" tab
$item['user/register']['type'] = MENU_CALLBACK;
}

Do not forget to flush the site caches otherwise it will not work..

N

grasmash’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Closed (fixed)

Very good point. I've just pushed a changed to the dev branch that addresses this issue. It has required changing the pattern for constructing registration paths.

Now, when you create a new registration path, this module will generate:
/[path-setting] (loads [path-setting]/login)
/[path-setting]/login
/[path-setting]/register
/path-setting]/password

Try it out and let me know if you have any issues.

digitopo’s picture

Anyone know of a way to disable or create a redirect on the default user/register page?

I've got two registration paths working, and although I've removed all the links for users to go to the default drupal user registration, I can't seem to get rid of the page itself.

Basically I don't want anyone to type in /user/register in their browser and create an account. I've tried to place a redirect on the user/register page by using the URL redirect module but it doesn't seem to be taking effect.

nielsvoo’s picture

Simple,

- add this module to your site: Path Access
- go to admin/config/people/pathaccess
- click on edit next to the anonymous user
- Add user/register to the textbox
- click save

Done!

brayo4’s picture

if you just want to get rid of the tab i found this module useful... http://drupal.org/project/tabtamer

nielsvoo’s picture

Dear Brayo,

I don't think this is a good approach because this doesn't prevent users with a direct path to the normal reg page creating a normal account. Because Drupal is widely used there are a lot of people knowing the standard reg creation path.

N

alfaguru’s picture

If you want to remove or tweak a menu entry created by another module, the correct way to do it is to use hook_menu_alter().

brayo4’s picture

Hello N,
i used this module (http://drupal.org/project/itweak_login) to redirect from /user/register path to another path. its seems to be working for me without any issues. Thx for the info......

oystercrackher’s picture

@nielsvoo

What version of Path Access were you using in your comment above in #4? I've tried that and it does not appear to be working with the 7.x-dev version. I have tried clearing cache after saving the changes. Several others have the same issue; attaching the related link here: http://drupal.org/node/261760#comment-6520342.

Any ideas? I'm not a coder, is there another module that will remove access to the user/register path and tab?

Looking forward to your reply.

Thanks
Melissa

grasmash’s picture

Priority: Critical » Minor

You can just use a custom module to either unset or deny access to the user/register path.

/**
 * Implements hook_menu_alter().
 */
function yourmodule_menu_alter(&$items) {
  $items['user/register']['access callback'] = FALSE;
}

Or

/**
 * Implements hook_menu_alter().
 */
function yourmodule_menu_alter(&$items) {
  unset($items['user/register']);
}
oystercrackher’s picture

Great! Thank you so much! :)

Axagthoth’s picture

Hi nielsvoo,

I tried your solution but it doesn't work for me. Maybe there's another way to just hide the default Create account tab? Completely restricting acces to /user/register works, but it isn't what I want to achieve, as blocking that path hides all of the account creation tabs, not just the default one.

nielsvoo’s picture

my version is 7.x-1.x-dev and works!!

Pascal.s’s picture

Issue summary: View changes

I started to install iTweak module when i realize i don't need it. Just go to URL aliases and create a new alias from "user/register" to wathever link you want it to point.

hfortune’s picture

I wanted to add to this, despite it being closed, in case someone else runs across this and is in need of help.

I tried several of the options here without much luck. I already am using a lot of modules and installing one simply to remove access to one page seemed like overkill.

In the end, I simply created a page and set it at the ?=user/register link. I put my two links for the profile registrations there.

It really is more to stop the spammers than anything -- despite all my efforts AND captcha, I am still getting ten to twenty spam registrations a day on a site that only in development. Spammers are clearly just typing that ?=user/register at the end of every domain name hoping to get into a drupal install -- without even caring what drupal site they get on (Mine doesn't even have a lick of content on it yet!)

Just wanted to post this here for someone else looking for a quick answer to this problem that doesn't involve adding more modules or changing any files.

matt.rad’s picture

Thanks for #15. I did bascially what hfortune suggested, but left the node with alias user/register unpublished. Default registration is now in accessible to spammers, as unauthenticated users get an "Access denied" message.

dlz21’s picture

Just a heads up. Recently worked on a site in which they did the same(#15 & #16). They wanted to go back to 'user/register'. It was not until I found this post that I realized what was going on..