Page 1 of 1
Login Welcome Page Bug
Posted:
May 7th, 2011, 1:27 pm
by wesleysoccer
Ok..So When you set the login welcome page at
http://www.example.com/%%current_user_login%% and set your Members options page to any page, you will not be able to access your homepage when not logged in...I've tested for over two hours with different themes and no plugins running but S2member...I can send you a demo if you want...would love a fix
Thanks.
This was without any plugins installed and using the default wp twenty ten theme and using the latest version of wp 3.1.2
url:
http://www.estore.muntzdesigns.com - demo site
Any help would be awesome!
Re: Login Welcome Page Bug
Posted:
May 7th, 2011, 2:50 pm
by Cristián Lávaque
It's great that you did more tests and were able to define the problem more clearly.
I wonder if s2Member takes
http://www.example.com as a possible Login Welcome Page too in case the replacement code is empty... That would explain the sending to the Membership Options Page, since the Login Welcome one is protected by default.
Could you change your portal so that instead of
/username it's
/user/username and see if that fixes your homepage problem?
Re: Login Welcome Page Bug
Posted:
May 7th, 2011, 6:00 pm
by wesleysoccer
I can but this is not how the video explained it...plus how would I set the welcome page in general options: (
http://www.vinitasalomeblog.com/demo/%%current_user_login%%)...Plus I can't change my portal pages to /user/username (not able to do so)... Let me know,
please inform the developer of the issue...I will test and get right back but right now there is an issue...need a fix.
Re: Login Welcome Page Bug
Posted:
May 7th, 2011, 7:52 pm
by wesleysoccer
Update Client Portal: The homepage issue was fixed with the following like you stated above...The Welcome page is set like:
http://www.example.com/user/%%current_user_login%% - The video does not state this?
Next Question: At the Current User Login Welcome Page, I need to add a link to a second page just for that current logged in user...how can I link to that page using the current_user_login and custom capabilities?
For example the second page is a gallery page...How would I link to that page?
Re: Login Welcome Page Bug
Posted:
May 7th, 2011, 9:05 pm
by Cristián Lávaque
I'm glad it solved your homepage problem.
You posted about the gallery link in another thread, let's keep it there. I remember answering it, but if I missed something, please remind me or give me more details. Thanks!
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 4:25 pm
by Jason Caldwell
Thanks for reporting this important issue.
~ and thanks for bringing this to my attention Cristián.
Yes, this is a bug ( of sorts ). s2Member will attempt to resolve the Replacement Codes in your Special Redirection URL. If the Redirection URL contains only one Replacement Code for %%current_user_login%% and that Replacement Code resolves to being empty, it makes s2Member think the Home Page is the Login Welcome Page; and thus, s2Member protects it.
@TODO: default %%current_user_login%% and other Replacement Codes to generic values when they would otherwise resolve to null? Cristián, do you have any thoughts on this?
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 4:32 pm
by Cristián Lávaque
I don't know if a default will work ideally. I'd probably just document the replacement codes better explaining this behavior, and the Login Welcome Page explaining what'll happen if set to the homepage or some other special one that could result in unexpected behavior. What do you think?
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 4:40 pm
by Jason Caldwell
Yes, I agree with you. Defaulting these to generic values is actually just introducing more confusion. Yes, improved documentation is always a good idea. Perhaps we also need a secondary routine to prevent s2Member from resolving any Special Redirection URL to the home page too. Just to prevent this particular issue from occurring? All other aspects of s2Member assume the Home Page is NOT going to be protected. In fact, apart from this newly reported bug, the only other way to protect the Home Page, is by using the URI Restrictions trick of adding a single ( / ) mark.
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 5:03 pm
by Cristián Lávaque
Cool.
I don't know if someone will want to protect the homepage, though, so I would not make it impossible.
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 5:08 pm
by Jason Caldwell
Gotchya. Completely agree. Aside from this newly reported bug, the only way to protect the Home Page, is by protecting the entire site using a single slash in one of the URI Restriction boxes. We may add other techniques in the future, but in light of this new bug, I think we'll add an additional routine to guard against Home Page protection occurring inadvertently through a Special Redirection URL.
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 5:13 pm
by Cristián Lávaque
Got it.
Yeah, we don't want it to happen unknowingly, for sure.
Instead of having the routime prevent, it could just warn when saving the new setting, then let the admin decide if he changes or leaves it. Would this be more difficult?
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 5:16 pm
by Cristián Lávaque
Or going back to the default value idea: it could be possible to set a page for the Login Welcome Page and also a Special URL, so that if the replacement code doesn't have a valid value, it defaults to the page chosen.
Edit: Nevermind, the deafult page works well for an invalid URL, but not for invalid replacement code values cause they could still be in a valid URL (e.g.
http://example.com/?optional=%%replacement_code%%)
Re: Login Welcome Page Bug
Posted:
May 10th, 2011, 6:13 pm
by wesleysoccer
Thanks for all the feedback guys...I'm going to do a screencast soon for using wordpress as a client portal...I just completed one project for my client (photography portal) and will be using s2member to another client soon (another client portal). I have everything working real smooth with login and recognizing specific usernames throughout the site using the same links for all users..Thanks so much guys...There are not to many options for a client portal with wordpress (if any)...Except for using like four plugins...too much...
Re: Login Welcome Page Bug
Posted:
May 11th, 2011, 8:34 am
by wesleysoccer
Another little issue that I have discovered when using the portal...When the "admin" is setting up pages and set the custom capabilities, the admin is unable to view the page edits...this is because they are "admin" not the "username" set at custom capabilities...Thanks guys.
Re: Login Welcome Page Bug
Posted:
May 11th, 2011, 11:52 am
by Cristián Lávaque
An admin doesn't have any access restriction applied to him by s2Member. You probably are seeing a cache copy of the page instead of the changed one.
Re: Login Welcome Page Bug
Posted:
May 11th, 2011, 12:10 pm
by wesleysoccer
yeah...want's the page is set with custom capabilities for the portal you are unable to view the page...ugh..I cleared cache and still you can't view page as admin....
Re: Login Welcome Page Bug
Posted:
May 11th, 2011, 12:33 pm
by Cristián Lávaque
OK, that's really strange. Let's wait for Jason to comment then.
Re: Login Welcome Page Bug
Posted:
May 11th, 2011, 5:51 pm
by drbyte
If you setup the theme to use a custom capability levels 0 to 4 (current_user_can(capability)) then the admin will not be able to see it.
Will not work
current_user_can(access_s2member_level0) or 1, 2, 3, 4
Will Work
is_user_logged_in
You can use multiple Conditionals && is_admin() or is_super_admin
If you are not using any of the above directly in your theme then create another admin user and try to log in and see if your see the changes.
If you are getting a full white page then you might want to check some pages including your .htaccess
Another, if permalinks are used, then you might want to hit the Save Changes button couple of times..it might just be a small hiccup
Sam
Re: Login Welcome Page Bug
Posted:
May 11th, 2011, 7:22 pm
by wesleysoccer
Thanks for the information ..I will take a look..When I try to view the page after edits I get directed to members option page,,,Thanks.