Page 1 of 1

FrontEndUsers must login twice before getting main page

Posted: Sat Aug 15, 2009 12:39 am
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.

Re: FrontEndUsers must login twice before getting main page

Posted: Sat Aug 15, 2009 12:44 am
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

Re: FrontEndUsers must login twice before getting main page

Posted: Sat Aug 15, 2009 2:01 am
by Nullig
Make sure the pages that use that template are not cacheable.

Nullig

Re: FrontEndUsers must login twice before getting main page

Posted: Sat Aug 15, 2009 4:39 am
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.

Re: FrontEndUsers must login twice before getting main page

Posted: Sat Aug 15, 2009 5:51 am
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.

Re: FrontEndUsers must login twice before getting main page

Posted: Sat Aug 15, 2009 6:37 pm
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.

Re: FrontEndUsers must login twice before getting main page

Posted: Sat Aug 15, 2009 6:44 pm
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.

Re: FrontEndUsers must login twice before getting main page

Posted: Sun Aug 16, 2009 8:19 pm
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.