FrontEndUsers must login twice before getting main page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
rvan
New Member
New Member
Posts: 9
Joined: Wed Oct 17, 2007 10:59 am

FrontEndUsers must login twice before getting main page

Post by rvan »

CMSMS 1.6.3
Banners 2.2.1
CustomContent 1.5.3
FrontEndUsers 1.6.9

Users go to URL and get login prompt -> enter correct information -> submit and get login prompt -> enter correct information -> submit and go to proper default page.

template piece:
{if $ccuser->ipmatches('IP,IPrange1,IPs...')}
{content}
{elseif $ccuser->loggedin()}
{cms_module module='FrontEndUsers' form='silent'}
{content}
{else}
  Please login to view this page

  {cms_module module='FrontEndUsers'}
{/if}

If user is in proper IP range or single IP they get in without issue. Incorrect login information works correctly as well.
Users are always prompted twice for login information. There is not any FEU on page options. The template is the only place FEU and content are called out.

UPDATE:
I have zero cache-able pages.

Do not understand calguy: The 2 content tags are inside an if/elseif/else. Is there an issue with CMSMS logic that we all should be made aware of?
I have downloaded and read the documentation you provided on your website. Unfortunately I did not find anything that would change my approach for this site. Anyone intending to use FEU should read the doc.
Last edited by rvan on Sat Aug 15, 2009 4:11 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: FrontEndUsers must login twice before getting main page

Post by calguy1000 »

don't put {content} into your template twice, it may cause all kinds of problems.

in your case, revise your logic to have an or statement, and nested if statement if necessary.

Also,  you may get some help out of the newly released document here:
http://calguy1000.com/downloads.html
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: FrontEndUsers must login twice before getting main page

Post by Nullig »

Make sure the pages that use that template are not cacheable.

Nullig
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: FrontEndUsers must login twice before getting main page

Post by Jeff »

First, when replying to other people use the reply button DON'T just edit your post. It is very hard to read.

Your logic is faulty. If they are logged in and from IP show them content X else still show them content X.

That doesn't make any sense.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FrontEndUsers must login twice before getting main page

Post by jmcgin51 »

I'm with ajprog - I don't understand your logic.

What browser are you using to test this?  I see a similar issue with having to log in twice, but it only happens with FireFox.
rvan
New Member
New Member
Posts: 9
Joined: Wed Oct 17, 2007 10:59 am

Re: FrontEndUsers must login twice before getting main page

Post by rvan »

There is no fault in the logic if you follow it correctly.
1st if: If you are within an allowed IP range or specific IP's then there is no login prompted and you go directly to content.
2nd if: You failed IP test and therefore must login. Login correctly and go to content else back to login screen displaying incorrect name or password.
else: You attempted to get beyond index.php and are not logged in.

I see no logic fault here. In fact this all worked well until 1.5.1 and I upgraded to 1.6.3 as I was unavailable to update this site until recently. Something after 1.5.1 broke and I am attempting to get it to work again. This site has no displayable pages to the general public other than the login screen.

And I apologize for the embedded comments in my original post.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: FrontEndUsers must login twice before getting main page

Post by calguy1000 »

if there is no public content on any page except the login page, then why not do something very simple like:

Code: Select all

{if !$ccuser->ipmatches(...) and !$ccuser->loggedin()}
  {redirect_page page='login'}
{/if}
Your login page can use a different page template if you wish, where {content} is displayed unconditionally
and bob's your uncle.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
rvan
New Member
New Member
Posts: 9
Joined: Wed Oct 17, 2007 10:59 am

Re: FrontEndUsers must login twice before getting main page

Post by rvan »

Template logic changed to:
{if $ccuser->ipmatches('IP,IPrange1,IPs...') | $ccuser->loggedin()}
  {content}
{else}
  Please login to view this page

  {cms_module module='FrontEndUsers'}
{/if}

Users are still having to input two valid logins to gain entry.
Post Reply

Return to “Modules/Add-Ons”