Removing the forgot options from Login

joomlaSometimes you may want to hide the forgotten username and password options from the Login module.  This is particularly useful if you are using an alternative authentication plugin, like gmail, where the authentication happens outside Joomla.  I used Joomla 3.4.4 for this article and the Protostar template.


Login Module

We will start by removing the options from the Login module.

  1. Log into the back end with an administrator account
  2. Go to Extensions > Templates.
  3. Click the template name for the default Site template (eg. Protostar, but not Protostar - Default).
  4. Select the Create Overides tab.
  5. In the Modules section, click mod_login
  6. Select the Editor tab.
  7. Browse to html > mod_login.
  8. Select default.php.
  9. Search for the following content, at the bottom of the file.
 <a href="/<?php echo JRoute::_('index.php?option=com_users&view=remind&Itemid=' . UsersHelperRoute::getRemindRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a>
</li>
<li>
<a href="/<?php echo JRoute::_('index.php?option=com_users&view=reset&Itemid=' . UsersHelperRoute::getResetRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a>

...and change it to the following

  <a href="/<?php //echo JRoute::_('index.php?option=com_users&view=remind&Itemid=' . UsersHelperRoute::getRemindRoute()); ?>">
<?php //echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a>
</li>
<li>
<a href="/<?php //echo JRoute::_('index.php?option=com_users&view=reset&Itemid=' . UsersHelperRoute::getResetRoute()); ?>">
<?php //echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a>

Save your changes, and preview in the front-end.

 

Component

The login page can also appear as a component in the middle of your site, so this section describes how to remove it from there.

  1. Select the Create Overides tab.
  2. In the Components section, click com_users > login
  3. Select the Editor tab.
  4. Browse to html > com_users > login.
  5. Select default_login.php.
  6. Search for the following content, at the bottom of the file.
<div>
<ul class="nav nav-tabs nav-stacked">
<li>
<a href="/<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
</li>
<li>
<a href="/<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?></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::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
</div>

...and change it to the following

<!--
<div>
<ul class="nav nav-tabs nav-stacked">
<li>
<a href="/<?php //echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php //echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
</li>
<li>
<a href="/<?php //echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
<?php //echo JText::_('COM_USERS_LOGIN_REMIND'); ?></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::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
-->

Save your changes, and preview in the front-end

Thanks for visiting.