Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing create new account tab from login page in drupal 7

Drupal login page, while going from url ?q=user shows you login form and it also shows Change password and Create new account tabs . I want to remove the Create new account option/tab from there and also I do not want user to access registration page even via url: ?q=user/register.

Anyone?

like image 319
Mujtaba Haider Avatar asked May 13 '11 11:05

Mujtaba Haider


People also ask

How do I enable user moderation in Drupal?

Configuring Content Moderation To enable the module, go to Extend -> Content Moderation module and Click on Install. Here, you can see a default workflow called “Editorial” that gets created when you enable the module. You can edit the existing “Editorial” workflow or create a new workflow by clicking on Add Workflow.

What is user management in Drupal?

User Management manages the information of the user, which allows creating or deleting the user, changing passwords, time and roles.


2 Answers

To hide the Create new account tab in the /user path, you can insert the following in your module code:

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

This hides the tab but still allows for /user/register to be accessed.

like image 141
nmc Avatar answered Oct 08 '22 23:10

nmc


Open the Configuration admin menu, and under the People heading click Account Settings. Under the heading Who can register accounts? select Administrators only and then save the settings.

like image 38
Finbarr Avatar answered Oct 09 '22 00:10

Finbarr