Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • emwebmaster Friend
    #168052

    I was having this problem today…. while viewing on the iPhone layout, if a user tried to logout they were sent to a blank page with the words “Invalid Token”. I poked around on these forums for a solution, but ended up finding one myself.

    After comparing the PHP code for the default (desktop) version of the ja-login code with the mobile version of it, I noticed a discrepancy. After adding the missing code, everything now seems to work.

    I admit, this is only a hack, and may not be the best solution from proper-coding standards, but here it is:

    1) Go to login.php found at plugins/system/jat3/jat3/base-themes/default/blocks/iphone

    Under line 25 insert this code
    [PHP]<?php echo JHtml::_(‘form.token’); ?>[/PHP]

    Your finished code, from lines 18 to 27, should look like this:
    [PHP]
    <form action=”<?php echo JRoute::_(‘index.php’, true); ?>” method=”post” id=”login-form”>
    <?php echo JText::sprintf( ‘MOD_LOGIN_HINAME’, $user->get(‘name’) ); ?>
    <div align=”center”>
    <input type=”submit” name=”Submit” class=”button” value=”<?php echo JText::_( ‘JLOGOUT’); ?>” />
    </div>
    <input type=”hidden” name=”option” value=”com_users” />
    <input type=”hidden” name=”task” value=”user.logout” />
    <input type=”hidden” name=”return” value=”<?php echo $return; ?>” />
    <?php echo JHtml::_(‘form.token’); ?>
    </form>
    [/PHP]

    I welcome any devs or programmers to weigh in on this tip, and verify if it also works for them. So far, it works for me.

    jooservices Friend
    #420436

    it’s good fix but better to override the file login.php first by copying it to templates/your_tpl/blocks/iphone/
    and this will not be lost when you upgrade T3.
    Thanks
    Viet Vu

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  jooservices 13 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum