Actions

Difference between revisions of "Why do you get a Token Error when you confirm a password reset?"

From Joomla! Documentation

(Where should that be placed within the file?)
Line 26: Line 26:
 
== Where should that be placed within the file? ==
 
== Where should that be placed within the file? ==
  
In the RocketTheme Gantry layouts, the new label and field is placed below the "Confirm your Account" literal and above the existing token field. When you are complete, the form should loook like [http://community.joomla.org/index.php?option=com_user&view=reset&layout=confirm this].
+
In this specific layout, the new label and field is placed below the "Confirm your Account" literal and above the existing token field. When you are complete, the form should look like [http://community.joomla.org/index.php?option=com_user&view=reset&layout=confirm this].
  
 
<source lang="php">
 
<source lang="php">
 
<div class="user">
 
<div class="user">
  
<h1 class="rt-pagetitle">
+
<h1 class="pagetitle">
 
<?php echo JText::_('Confirm your Account'); ?>
 
<?php echo JText::_('Confirm your Account'); ?>
 
</h1>
 
</h1>

Revision as of 10:50, 30 April 2010

If you are getting a Token Error when confirming a password reset after upgrading to Joomla! 1.5.16, or later, and if you are using Template Overrides for the com_user Component, reset view, and confirm layout, then you must manually change your layout file to include a new username field. Adding that field will fix the token error.

How can I tell if I need to make this change?

On your Joomla! installation, see if you have a file a templates/current-template-name/html/com_user/reset/confirm.php file.

Note: substitute the actual name of your template for current-template-name.

If the confirm.php file exists at that location, then you need to make certain the new username field has been added.

If you do not have this file, then this issue does not relate to you.

What specifically must be added to the file?

All Template Overrides can be different, so this is an example of how you would apply this fix using RocketTheme's Gantry Layouts. If you created your own layouts or used layouts from someone else, your changes may be slightly different.

A label and field for username must be added to the form, as pictured below:

<div>
        <label for="username" class="hasTip" title="<?php echo JText::_('RESET_PASSWORD_USERNAME_TIP_TITLE'); ?>::<?php echo JText::_('RESET_PASSWORD_USERNAME_TIP_TEXT'); ?>"><?php echo JText::_('User Name'); ?>:</label>
        <input id="username" name="username" type="text" class="required" size="36" />
</div>

Where should that be placed within the file?

In this specific layout, the new label and field is placed below the "Confirm your Account" literal and above the existing token field. When you are complete, the form should look like this.

<div class="user">
 
        <h1 class="pagetitle">
                <?php echo JText::_('Confirm your Account'); ?>
        </h1>
 
        <p>
                <?php echo JText::_('RESET_PASSWORD_CONFIRM_DESCRIPTION'); ?>
        </p>
 
        <form action="<?php echo JRoute::_( 'index.php?option=com_user&task=confirmreset' ); ?>" method="post" class="josForm form-validate">
        <fieldset>
                <legend><?php echo JText::_('Confirm your Account'); ?></legend>
 
                <div>
                        <label for="username" class="hasTip" title="<?php echo JText::_('RESET_PASSWORD_USERNAME_TIP_TITLE'); ?>::<?php echo JText::_('RESET_PASSWORD_USERNAME_TIP_TEXT'); ?>"><?php echo JText::_('User Name'); ?>:</label>
                        <input id="username" name="username" type="text" class="required" size="36" />
                </div>
 
                <div>
                        <label for="token" class="hasTip" title="<?php echo JText::_('RESET_PASSWORD_TOKEN_TIP_TITLE'); ?>::<?php echo JText::_('RESET_PASSWORD_TOKEN_TIP_TEXT'); ?>"><?php echo JText::_('Token'); ?>:</label>
                        <input id="token" name="token" type="text" class="required" size="36" />
                </div>
                <div class="readon">
                        <button type="submit" class="button"><?php echo JText::_('Submit'); ?></button>
                </div>
 
        </fieldset>
        <?php echo JHTML::_( 'form.token' ); ?>
        </form>
</div>