Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By onejam on
Hi,
does anyone know how i can disable the 'request new password' link in the login box?
thanks,
Comments
Public registration settings
Public registration settings in "User Settings"
/admin/user/settings
Ray Smith
http://RaymondSmith.com
Ray Smith
http://RaymondSmith.com
I have set it to 'Only site
I have set it to 'Only site administrators can create new user accounts.' but this does not remove the request for a password link or the page.
thanks,
---------- Personal blog | tutorials | photography -----------
Freelance web designer/developer: duvien.com
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
Use CSS
In your the CSS for your theme, try this:
That should hide all the links under the login form, not just the password one -- but since you're not using the "Create New Account" option anyway...
Yes, that works fine,
Yes, that works fine, however if i go to url: /user, there is a tab which still has the 'request a password'. is there no way to completely disable this. Also how does one override forms in template on Drupal 6 so it can be custom styled on it's own. There seems to be ways to override search form and comment form but not login form?
---------- Personal blog | tutorials | photography -----------
Freelance web designer/developer: duvien.com
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
Well, you could go into
Well, you could go into user.module and find/disable that bit of code, but hacking core is a really bad practice.
And in theory, you should be able to override that function in either your theme or a custom module. That's real coding, though, and definitely out of my depth -- sorry...
Thanks, i know, i don't like
Thanks, i know, i don't like working with forms in Drupal. It's never an easy tasks. Something Drupal should really look into. But having said that it's complicated even for PHP developers to make it easy for themers to style any forms.
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
noreqnewpass
The following module is able to do that http://drupal.org/project/noreqnewpass
Snippet to add to template.php
As this comes up so high in the search results I thought I would add this snippet... This will hide all the links in the User Login block.
Add something like the following to template.php (or a custom module):
View the print_r output to see the form build - you can add additional cases to the switch statement to alter other forms.
See here hook_form_alter and here Forms API Reference.
removing request new password tab
An other solution is to put this in your page.tpl.php just before the render($tabs) line. Works fine on Drupal 7 :
instead of $tabs['#primary'][1] we have to use 2
Patch
In case anyone is still looking for this:
https://www.drupal.org/node/2356655
In Drupal 7?
Does this feature is available in Drupal 7? I've tried everything in user settings page.. but could not give me a solution.
Try in template.php
This work for me in Drupal 7.
In your theme's template.php file, add:
Replace: "yourTheme" with the name of your theme.
Please note that hiding the
Please note that hiding the link is not sufficient. The page to change it will still be accessible.
Your better option is to use module NoReqNewPass as stated by Francewhoa
In Drupal 8 with an RewriteRule in .htaccess
By adding this RewriteRule in the .htaccess (Apache 2.4 for QSD) of the Drupal 8 root folder, all requests URL of password resetting are redirected to the login form:
RewriteRule ^user/password.* /user/login [QSD,L,R=302]
D7 hook_menu_alter
If you don't need the full, configurable module, you may simply use:
function MODULE_menu_alter(&$items) {
$items['user/password']['access callback'] = FALSE;
}