1
rossb
Login not working except from user.php
  • 2019/10/12 17:00

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


Hi;

Xoops 2.5.9, site: www.rossco.org

I have a login field in my header, themes/xbootstrap/tpl/userbar.tpl , intended to replace / bypass going to user.php. Login using this does not work (no error messages, nada). Login via modules/profile/user.php works fine. What am I missing / doing wrong?

Here's the login image:
Resized Image

Thanks;
Bill

<div style="background: #F1F1F1 url('')">
<
div id="xo-banner" class="commercial" style="height:85px;">
    <
a id="xo-main-logo" class="commercial" href="<{xoAppUrl /}>" title=""><img src="/SecureOffice_Images/rossco.png" alt="<{$xoops_sitename}>" /></a>
    <{if 
$xoops_banner and $xoops_banner != '&nbsp;'}>
        <!-- <{
$xoops_banner}> width="480px" height="60px" -->
        <
iframe src=<{$xoops_url}>/images/banners/xoopsifyIt.gif border="0" scrolling="no" allowtransparency="true" width="480px" height="60px" style="border:0" align="right" alt="http://www.xoops.org/;"> </iframe>
    <{/if}>
</
div>

<
div id="xo-userbar" align="right">
    <{if !
$xoops_isuser}>
        <
form method="post" action="<{xoAppUrl /user.php op=login}>">
            <{
$smarty.const._LOGIN}>&nbsp;
            <
input name="uname" type="text" />&nbsp;&nbsp;<input name="pass" type="password"/>
            <
input type="hidden" name="xoops_redirect" value="<{$smarty.server.REQUEST_URI}>" />

            <{if 
$lang_siteclosemsg}>
                <
input type="hidden" name="xoops_login" value="1" />
            <{/if}>
            <
button type="submit"><img src="/SecureOffice_Images/icons/home.png" height="75%" alt="<{$smarty.const._LOGIN}>" /></button>
            <{if !
$lang_siteclosemsg}>
                &
nbsp;+&nbsp;<a href="<{xoAppUrl /register.php}>" class="register" title="<{$smarty.const._REGISTER}>"><{$smarty.const._REGISTER}></a>&nbsp;&nbsp;
            <{/if}>
        </
form>
    <{else}>
        <{
xoInboxCount assign=pmcount}>
        <
a href="<{xoAppUrl viewpmsg.php}>" title="<{$smarty.const._THEME_INBOX}>">
        <{if 
$pmcount}>
            <
img src="<{$xoops_url}>/SecureOffice_Images/icons/inbox-full.png" alt="<{$pmcount}> <{$smarty.const._THEME_INBOX_NOTREAD}>"/>
        <{else}>
            <
img src="<{$xoops_url}>/SecureOffice_Images/icons/inbox.png" alt="<{$smarty.const._THEME_INBOX}>"/>
        <{/if}>
        </
a>
        <
a href="<{xoAppUrl /notifications.php}>" title="<{$smarty.const._THEME_NOTIFICATIONS}>"><img src="<{$xoops_url}>/SecureOffice_Images/icons/note_view.png" alt="<{$smarty.const._THEME_NOTIFICATIONS}>"/></a>
        <
a href="<{xoAppUrl /user.php}>" title="<{$smarty.const._THEME_PROFILE}>"><img src="<{$xoops_url}>/SecureOffice_Images/icons/profile.png" alt="<{$smarty.const._THEME_PROFILE}>"/></a>

        <{if 
$xoops_isadmin}>
            <
a href="<{xoAppUrl /admin.php}>" title="<{$smarty.const._THEME_ADMINISTRATION}>"><img src="<{$xoops_url}>/SecureOffice_Images/icons/configuration.png" alt="<{$smarty.const._THEME_ADMINISTRATION}>" /></a>
        <{/if}>
        <
a href="<{xoAppUrl /user.php op=logout}>" title="<{$smarty.const._THEME_LOGOUT}>" ><img src="<{$xoops_url}>/SecureOffice_Images/icons/exit.png" alt="<{$smarty.const._THEME_LOGOUT}>"/></a>
    <{/if}>
</
div>
</
div>

2
geekwright
Re: Login not working except from user.php

The query string of 'op=login' should not be part of the action URL. For security reasons, the GET input will be ignored in the POST method form submission. The form should include this instead:
<input type="hidden" name="op" value="login">

3
rossb
Re: Login not working except from user.php
  • 2019/10/13 13:54

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


Thanks @geekwright

For some reason (wearing too many hats), I'm still not getting it. Same result: nada when attempting to login. Here's the exact code, modified per my understanding of your suggestion:

<{if !$xoops_isuser}>
        <
input type="hidden" name="op" value="login"/>
            <{
$smarty.const._LOGIN}>&nbsp;
            <
input name="uname" type="text" />&nbsp;&nbsp;<input name="pass" type="password"/>
            <
input type="hidden" name="xoops_redirect" value="<{$smarty.server.REQUEST_URI}>" />

            <{if 
$lang_siteclosemsg}>
                <
input type="hidden" name="xoops_login" value="1" />
            <{/if}>
            <
button type="submit"><img src="/SecureOffice_Images/icons/home.png" height="75%" alt="<{$smarty.const._LOGIN}>" /></button>
            <{if !
$lang_siteclosemsg}>
                &
nbsp;+&nbsp;<a href="<{xoAppUrl /register.php}>" class="register" title="<{$smarty.const._REGISTER}>"><{$smarty.const._REGISTER}></a>&nbsp;&nbsp;
            <{/if}>
        </
form>
    <{else}>


Thanks;
Bill

4
geekwright
Re: Login not working except from user.php

Sorry I wasn't clear. Looks like the only change needed should be to add the form tag back:
<{if !$xoops_isuser}>
        <
form method="post" action="<{xoAppUrl /user.php}>">
        <
input type="hidden" name="op" value="login"/>
...

5
rossb
Re: Login not working except from user.php
  • 2019/10/13 18:49

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


Thanks @geekwright

There must be something else. Still nada response. Already have debug on (no errs). Is there some instrumentation or debugging I can add to get to the root of this? Can you try the code, your site?

Regards;
Bill

Current (exactly as suggested):

<{if !$xoops_isuser}>
        <
form method="post" action="<{xoAppUrl /user.php}>">
        <
input type="hidden" name="op" value="login"/>
            <{
$smarty.const._LOGIN}>&nbsp;
            <
input name="uname" type="text" />&nbsp;&nbsp;<input name="pass" type="password"/>
            <
input type="hidden" name="xoops_redirect" value="<{$smarty.server.REQUEST_URI}>" />

            <{if 
$lang_siteclosemsg}>
                <
input type="hidden" name="xoops_login" value="1" />
            <{/if}>
            <
button type="submit"><img src="/SecureOffice_Images/icons/home.png" height="75%" alt="<{$smarty.const._LOGIN}>" /$
            <{if !
$lang_siteclosemsg}>
                &
nbsp;+&nbsp;<a href="<{xoAppUrl /register.php}>" class="register" title="<{$smarty.const._REGISTER}>"><{$smar$
            <{/if}>
        </
form>
    <{else}>

6
geekwright
Re: Login not working except from user.php

I took the code from your login form, transported it to a test site, and it works.

When I try on your site (with a dummy name,) I can see it go through the expected steps.
- post to user.php
- redirect from user.php to modules/profile/user.php
- load modules/profile/user.php (due to login failing)

(Just for reference, the network section of Google Chrome's developer tools was my tool of choice for watching what was happening.)

That all looks correct. What is missing is a message.

The default message mechanism is a interstitial message box with a "click here if it doesn't reload" message. It is possible that your theme is interfering with that.

The more commonly used message delivery is a temporary overlay bubble. This can be enabled in admin under:
preferences -> system options -> general settings -> Use jGrowl redirect

With that option enabled you should be able to see the message that is redirecting to the final user.php page.

7
rossb
Re: Login not working except from user.php
  • 2019/10/14 20:47

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


Thanks geekwright;

You have already gone above and beyond. To see the failure, you will have to be a real user.

Already using jGrowl redirect. As you state: likely my theme interfering.
will try Google Chrome's developer tools
bottom line: got some learning to do, to debug this.
for now, will just replace login control with a link to login, since I am focused on updating content, major release, new features will keep me busy for at least a week.

Regards;
Bill

8
rossb
Re: Login not working except from user.php
  • 2019/10/15 16:46

  • rossb

  • Just popping in

  • Posts: 77

  • Since: 2006/8/28


Damn; xoops_session corrupt; repaired. All good now:)

9
geekwright
Re: Login not working except from user.php

That is great news! Thanks for the update.

Login

Who's Online

135 user(s) are online (54 user(s) are browsing Support Forums)


Members: 0


Guests: 135


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits