Page 1 of 1
Frontendusers & Customcontent was working, now not working.
Posted: Mon Jul 31, 2006 10:35 pm
by kevin360
I'm not sure what's going on but my frontendusers and customcontent isn't working anymore. I was adding more users and when I tested one of the new users with their password it wouldn't work. Then I tried out my original test user and that still worked. So I decided I'd just delete all the users (it was only three) and start fresh again. Well after starting fresh none of the users have worked. I know I'm entering the username and password correctly because if you put in a correct username but wrong password you get "Login failed - Invalid username or password?" When I put in the right password it just comes back to the login page. Before I'd have to refresh and then it'd load the correct page, now it doesn't even do that. Here's the page content I'm using:
{cms_module module="CustomContent"}
{if $customcontent_loggedin eq 1}
{else}
{cms_module module="FrontEndUsers" form="login"}
{/if}
Is there anyway to turn on some debugging to figure out what's going on?
Re: Frontendusers & Customcontent was working, now not working.
Posted: Mon Jul 31, 2006 11:53 pm
by kevin360
Ok, I've played around with it some more and found something interesting. Using the same syntax check from above, the very first user I create from a fresh install of the two modules will work. The second user I create will not work. It's only the first user that will go through ok. So then I deleted the first user so there would only be the second user I created. That didn't work either. Delete that user so there are none in the system, create a new user, but that one won't work. If I uninstall the modules and then reinstall them then the first user created will work again.
Re: Frontendusers & Customcontent was working, now not working.
Posted: Tue Aug 01, 2006 12:49 am
by kevin360
Alright, responding to myself again! But I've been testing it out and looking at the database and I've figured some stuff out that I haven't seen documented elsewhere.
First if you use the smarty tag variable way to check things you can print out what the smarty tags contain by putting things like these on your page:
{$customcontent_loggedin}
{$customcontent_groups}
{$customcontent_groupcount}
From putting that in I learned that the _loggedin variable is actually returning the user_id from the database for the username. So if you do a check like this:
{if $customcontent_loggedin eq 1}
it will ONLY match to the username that has a user_id of 1. If what you really want to do is check to see if anyone is logged in then do this:
{if $customcontent_loggedin != "0"}
This will match on any username that can login because any username that can login will have a user_id of non-zero.
The "groups" variable places a comma at the end of the string, so just comparing to see if the string matches with the name of the group you setup won't work. For example, if you had two groups - group1 and group2 and the user was assigned to both groups then printing out the _groups would give:
group1,group2,
If someone knows of a way to check for a substring in there so you could look to see if the user belonged to at least "group1" that'd be great! So far I haven't been able to figure that out yet.
Re: Frontendusers & Customcontent was working, now not working.
Posted: Wed Sep 06, 2006 12:04 am
by greypanda
It's even worse. You can end up with stuff like this after you do a logout:
Your Login name is nobody
Your IP is 192.168.1.96
Your login status is
Your groupcount is
You belong to groups:
This is seriously broken since you have to check a bunch of different conditions to see if the user is actually logged in.
Re: Frontendusers & Customcontent was working, now not working.
Posted: Wed Sep 06, 2006 2:22 am
by calguy1000
I just fell into this trap again, because I wasn't thinking.
if you have custom content on a page, stuff that is dependant on the current user, you should always mark the page as non-cachable in the admin section of the page editor.
After doing this, logging out, and logging in with two or three users entered into feusers worked perfectly for me every time
Now I gotta change the comments in the feusers help, ugh.