[SOLVED] Remove forgot password link

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

[SOLVED] Remove forgot password link

Post by jsgdmbnhl » Wed Jul 25, 2012 8:45 pm

What is the best way to remove or hide the links "Forgot your password?", "Forgot your username?", and "Don't have an account?"

For some reason, when I go to Joomla, You Are Here says: Home > Your Profile. I thought it should just say Home when I go to the Public page of my site.

Thanks.

poonoodi
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Fri Jul 13, 2012 6:05 am
Location: birjand
Contact:

Re: Remove forgot password link

Post by poonoodi » Wed Jul 25, 2012 9:01 pm

Hi
you can use CB login module
then go to
module manager & edit this module
Lost password----->select yes or no

Regard
only joomlafarsi:http://forum.joomlafarsi.com
---------------------------------------------------------
poonoodi:http://forum.joomlafarsi.com/members/26695-poonoodi

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Wed Jul 25, 2012 9:09 pm

Hello poonoodi: Is there a way to do this without downloading anything? Although it has a .php extension for each of those links, I thought there would be a way to just hide or remove the links. I am aware that Login Form module and Login module both say that these modules display the Forgot Password link.

Thanks.

poonoodi
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Fri Jul 13, 2012 6:05 am
Location: birjand
Contact:

Re: Remove forgot password link

Post by poonoodi » Thu Jul 26, 2012 10:30 pm

hi jsgdmbnhl
found it !
go to : language folder--->en-GB--->mod_login.ini
&edit

Code: Select all

MOD_LOGIN_FORGOT_YOUR_PASSWORD="Forgot your password?"
MOD_LOGIN_FORGOT_YOUR_USERNAME="Forgot your username?"
to

Code: Select all

MOD_LOGIN_FORGOT_YOUR_PASSWORD=""
MOD_LOGIN_FORGOT_YOUR_USERNAME=""
its hide :pop

Regard
only joomlafarsi:http://forum.joomlafarsi.com
---------------------------------------------------------
poonoodi:http://forum.joomlafarsi.com/members/26695-poonoodi

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Fri Jul 27, 2012 2:44 pm

I went to language/en-GB.
I opened en-GB.mod_login.ini
I modified the lines

Code: Select all

MOD_LOGIN_FORGOT_YOUR_PASSWORD="Forgot your password?"
MOD_LOGIN_FORGOT_YOUR_USERNAME="Forgot your username?"
MOD_LOGIN_REGISTER="Create an account"
with

Code: Select all

MOD_LOGIN_FORGOT_YOUR_PASSWORD=""
MOD_LOGIN_FORGOT_YOUR_USERNAME=""
MOD_LOGIN_REGISTER=””
I refreshed my home page and the links did not disappear. I closed by browser windows completely and opened a new browser, but the links did not disappear. I rebooted the server and then attempted to access the website again but the links did not disappear.

I was thinking of editing the html file and removing the entire division containing these links and hoping it doesn't wreck my site.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Fri Jul 27, 2012 4:24 pm

1. You can turn off user registration in the Option button in User Manager.

2. Use an override to remove the links.
http://docs.joomla.org/How_to_override_ ... omla!_core

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Mon Jul 30, 2012 1:09 pm

Per Yngve Berg: All I was hoping to do was to hide those three listed links. I figured it was just as simple as either commenting or removing them from a html file. I did not realize that I was attempting to make changes to the Joomla core. I have been told that making changes to the Joomla core is not a best practice. Is this correct?

I did go to the article you supplied. It took me to Joomla/modules/mod_login/tmpl/default.php. I found this file containing the code to display the "Forgot username/password" links and pass the information. I am not exactly sure which areas to comment out so I can just hide this particular section without breaking the rest of the site. As you may be able to tell, I know nothing about PHP.

Thanks for your continued help.

poonoodi
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Fri Jul 13, 2012 6:05 am
Location: birjand
Contact:

Re: Remove forgot password link

Post by poonoodi » Mon Jul 30, 2012 9:22 pm



It took me to Joomla/modules/mod_login/tmpl/default.php. I found this file containing the code to display the "Forgot username/password" links and pass the information. I am not exactly sure which areas to comment out so I can just hide this particular section without breaking the rest of the site. As you may be able to tell, I know nothing about PHP.

Thanks for your continued help.
in first i had try to edit this file but do not access & dont work
but with edit the language file its solved
but i do not understand why it not work for you !

Regard
only joomlafarsi:http://forum.joomlafarsi.com
---------------------------------------------------------
poonoodi:http://forum.joomlafarsi.com/members/26695-poonoodi

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Mon Jul 30, 2012 9:28 pm

It's line 60-77 (<ul> </ul>)

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Tue Jul 31, 2012 12:39 pm

I used nano to use a multi-line comment on lines 60 and 77. All lines between and including the <ul> </ul> are marked blue as commented. It did not hide or remove the "Forgot username" link or the other two links at the login page.

I still have the en-GB.mod_login.ini with the following...

Code: Select all

MOD_LOGIN_FORGOT_YOUR_PASSWORD=""
MOD_LOGIN_FORGOT_YOUR_USERNAME=""
MOD_LOGIN_REGISTER=””
I do not know why it did not work either.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Tue Jul 31, 2012 3:54 pm

Did you do a proper override and placed the file in the html folder of your template?
Have you checked that the template does not already have an override?

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Tue Jul 31, 2012 6:35 pm

I followed the instructions on the link. I am not able to copy the template file. I am not sure why since I am able to locate my template default.php file, use the cp command, and type the full path based on the instructions on the link. It keeps telling me "no such file or directory"

I have tried the following...

Code: Select all

cp /Joomla/htdocs/modules/mod_login/tmpl/default.php ... /Joomla/htdocs/mod_login/html/mod_login/default.php  ... mod_login/html/mod_login/default.php
I am able to open the file using Nano OK. I do not use the dots when trying to do the copy file command.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Tue Jul 31, 2012 7:00 pm

You shall copy the file to the /templates/<your template>/html/mod_login/default.php

You have to create the folders first.

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Wed Sep 05, 2012 1:58 pm

I am back regarding this issue. I gained some experience regarding template overrides.

As much as I read the rest of this post, I'd like to start from scratch again. I removed all changes that were done in this post.

I opened en-GB.mod_login.ini
I changed the lines back to...

Code: Select all

MOD_LOGIN_FORGOT_YOUR_PASSWORD="Forgot your password?"
MOD_LOGIN_FORGOT_YOUR_USERNAME="Forgot your username?"
MOD_LOGIN_REGISTER="Create an account"
I went to Joomla/modules/mod_login/tmpl/default.php.
I removed the commenting from lines 60-77.

I do not know if this matters, but I have one existing template override... /templates/<my template>/html/com_users/login/default_login.php
I am prepared to create folders /templates/<my template>/html/mod_login/
I am prepared to copy the default.php file to the newly created folders.

Please let me know the paths of new folders that need to be created.
Please let know which files need to be copied to the new folders.
Please let me know exactly which lines in the copied files need to be edited.
Please put this information clearly in a new post so I can read it instead of scrolling to reference previous posts in this thread. I think it makes it easier to read with the new post.

Any help is appreciated.

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Wed Sep 05, 2012 3:36 pm

sureshgupta44:
I am actually looking to remove those links/functions from the Login page. I was told I would need to do a template override to remove them. I do not know which code to add/remove/modify that will remove or hide the links/functions. I am hoping someone can submit a post with relatively easy to follow instructions after this post so I can follow it and make the necessary changes.

Users should not be able to go into Joomla and click on "Forgot Your Password?" and reset their password. Their password reset should only occur in Windows/Active Directory.

Users should not click on "Don't Have An Account?" for registering a new Joomla account. Registration will occur when they are authenticated with Active Directory.

"Forgot Your Username?" is irrelevant since their Windows username/password is their Joomla username/password.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Wed Sep 05, 2012 4:45 pm

Have you turned off "Allow New User Registration" in the Options in User Manager.?
That will remove the Register link.

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Wed Sep 05, 2012 4:53 pm

I just turned off "Allow New User Registration". It removed the Register link.

After removing the Register link, will new users still be able to log in successfully if they are authenticated via LDAP/Active Directory?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Wed Sep 05, 2012 6:43 pm

Yes.

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Tue Sep 18, 2012 1:39 pm

OK I am honestly not sure if this is a Template Override or Language Override anymore. I still want to remove "Forgot Your Password" and "Forgot Your Username" links from the Login page.

I know there is en-GB.mod_login.ini with the following:

Code: Select all

MOD_LOGIN_FORGOT_YOUR_PASSWORD="Forgot your password?"
MOD_LOGIN_FORGOT_YOUR_USERNAME="Forgot your username?"
MOD_LOGIN_REGISTER="Create an account"
I also did a grep search for "view=remind" since that is what is displayed in my status bar when I place my pointer over "Forgot Your Password". Unfortunately there are multiple files found with "view=remind", such as:
components/com_users/controllers/remind.php
components/com_users/controllers/user.php
components/com_users/views/login/tmpl/default_login.php
modules/mod_login/tmpl/default.php
templates/rt_afterburner/html/com_users/login/default_login.php

I do not know which of these files I need to copy to do the Override the Output from Joomla Core. Continued help is always appreciated.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Tue Sep 18, 2012 6:00 pm

templates/rt_afterburner/html/com_users/login/default_login.php

Your template already have an override.

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Tue Sep 18, 2012 7:19 pm

Well, I was able to make some changes in the /templates/rt_afterburner/html/com_users/login/default_login.php. They are not the changes I was looking to make. I have screen shots attached.

Screen shot 1 shows the Login page with the comment symbols. I do not know why they appeared there. Screen shot 2 shows file default_login.php lines 60-77 commented out as previously stated.

I do not know why this does not work as needed.
You do not have the required permissions to view the files attached to this post.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28323
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Remove forgot password link

Post by Per Yngve Berg » Tue Sep 18, 2012 7:51 pm

You have put php comments inside html code.
Php code must be between "<?php" and "?>"

User avatar
dagger2002
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 162
Joined: Wed Mar 26, 2008 4:22 pm
Location: So. Cal

Re: Remove forgot password link

Post by dagger2002 » Tue Sep 18, 2012 7:56 pm

the comment symbols are showing because it looks like you are not within php tags.

Code: Select all

<?php
/*
<ul>
	<li>
		<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ">
		<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); </a>
	</li>
	<li>
		<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ">
		<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); </a>
	</li>
	<?php
	$usersConfig = JComponentHelper::getParams('com_users');
	if ($usersConfig->get('allowUserRegistration')) : 
	<li>
		<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ">
			<?php echo JText::_('MOD_LOGIN_REGISTER'); </a>
	</li>
	<?php endif; 
</ul>
*/
?>
[*]Note[/b] that all of the closing php tags were removed. If I dont do this on my server I normally get an error. But if you want to turn this back on later then you will have to put the closing tags back in.

Hope this helps

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: Remove forgot password link

Post by jsgdmbnhl » Tue Sep 18, 2012 8:17 pm

SUCCESS!

On account of me not knowing what I am doing with PHP code, I had to google the actual syntax since I initially literally tried "<?php"....."?>" saved it, and refreshed my Login page. It did not do anything.

I then tried the <?php......?> without any HTML tags, saved, and refreshed my login page again. It turned a nice white screen and it seemed like I came so very close to unintentionally blowing up my Joomla site.

I then followed exactly what the screen shot looked like, saved, and refreshed the Login page. The "Forgot Your Username" and Forgot Your Password" are not showing anymore.

Screen shots are worth a thousand words.
Many thanks to you Per Yngve Berg and thanks to you dagger2002 for providing that final missing piece.

User avatar
dagger2002
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 162
Joined: Wed Mar 26, 2008 4:22 pm
Location: So. Cal

Re: Remove forgot password link

Post by dagger2002 » Tue Sep 18, 2012 8:25 pm

Glad i could Help

roqcm
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Oct 23, 2012 3:28 pm

Re: [SOLVED] Remove forgot password link

Post by roqcm » Tue Oct 23, 2012 3:36 pm

We have a similar problem, but we're trying to remove the 'Forgot Password, Forgot Username' etc from the Failed Login screen. ie, the page that you get redirected to when the user enters the wrong credentials. We overrode and commented out the block of html code that contains the links in the components/com_users directory as dagger2002 suggested. That removes the links from the 'main' login screen, but it doesn't seen to have any affect on the failed login screen. Does anyone has any suggestions on how to override that? They seem to be pulling from different locations.

BJDan
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Aug 29, 2011 6:54 pm

Re:Same here

Post by BJDan » Tue Oct 23, 2012 5:13 pm

Failed Login shows different links and we could not override.

jsgdmbnhl
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 156
Joined: Thu Jul 05, 2012 4:32 pm

Re: [SOLVED] Remove forgot password link

Post by jsgdmbnhl » Tue Oct 23, 2012 7:12 pm

Hello roqcm and BJDan :
I tested the Failed Login page. I confirmed that my Main Login page and my Failed Login page are the same page:
.../index.php/component/users/?view=login

When you attempt to login for the first time on your Main Login page, what is the URL listed?
What is the URL after you get to the Failed Login page?

I will try to help but Joomla troubleshooting is not exactly one of my strengths.

BJDan
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Aug 29, 2011 6:54 pm

Re: [SOLVED] Remove forgot password link

Post by BJDan » Wed Oct 24, 2012 7:53 pm

Thanks for your post; now I understand how it works. I speak from the login-module. If the log in fails via the module, it is redirected to the components view, that is different and has again the forgot-links.

BJDan
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Aug 29, 2011 6:54 pm

Re: [SOLVED] Remove forgot password link

Post by BJDan » Wed Oct 24, 2012 8:03 pm

Tried it out now and it works. So it is necessary to have an override for the module mod_login and a second override in the template html/com_users/login/default_login.php
Thanks again for pointing it out.


Locked

Return to “General Questions/New to Joomla! 2.5”