开发者

removing create new account tab from login page in drupal 7

开发者 https://www.devze.com 2023-03-05 10:51 出处:网络
Drupal login page, while going from url ?q=user shows you login form and it also shows Change password and Create new account tabs .

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开发者_JAVA技巧 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?


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.


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.


The Tab Tamer module will do this. Just make sure you choose hidden and not disabled, otherwise users will get access denied errors.


Home>administration>configuration>people> who can register accounts> select administrators only


To remove the "Register Tab" in login page for visitors, go to Administration>>Account Settings>> select the administrator to create the account. Save the changes. By doing this, only "Admin" can create the accounts. Users cannot see the "Register" Tab.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号