PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

How to disable login redirect

s2Member Plugin. A Membership plugin for WordPress®.

How to disable login redirect

Postby davidcom » November 24th, 2011, 3:43 am

I just posted a question on how to disable login customization. I figured I should start a separate thread for this question.

I've just started testing out this plugin. So far it looks promising. In this post, I'd like to ask if there's any way of disabling s2member's login. I read the long infamous thread "Login Redirect Not Working - Need Help Fast" and watched the video that was produced to discuss it. I found that thread because I too was using Peter's Login Redirect.

Here's what I'm currently trying to accomplish - I have a language teaching website with certain pages that are only for certain clients (students). So I need to be able to create user categories for students and have them redirected to a certain page when logging in. S2M accomplishes that.

However, I also have teachers that need to be able to login and have access to ALL pages of all students. From what I can gather, when creating user accounts for the teachers, I can give them "contributor" status and they will have access to all levels of S2M restricted pages. Is that correct?

For teachers, when they log in, I need them to be directed to a special "Teacher" landing page. However, under normal Wordpress configuration, when they log in, they are taken to the dashboard because of their "Contributor" status. These are teachers that have absolutely no need to be in the dashboard (or even know that a dashboard exists). This is where Peter's Login Redirect was so great, because it allowed me to redirect Wordpress user levels (Contributor, Editor, Admin, etc.) and it even allow me to control where users will land based on their user name.

Does S2M have this functionality. Or is there a workaround or more efficient way to accomplish this in S2M?

Thank you in advance.
User avatar
davidcom
Registered User
Registered User
 
Posts: 5
Joined: November 23, 2011

Re: How to disable login redirect

Postby Eduan » November 24th, 2011, 8:01 am

Why don't you make the teachers a level higher? That way they don't go to the dashboard but they can access every page.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: How to disable login redirect

Postby Raam Dev » November 25th, 2011, 1:09 am

Hi davidcom,

What Eduan is referring to is the cumulative affect of s2Member Membership Levels. That means that anyone with a Level 4 membership will have access to all the pages available to Levels 0, 1, 2, and 3.

So, you could have your teachers assigned to Level 4 and all the students assigned to a lower level. When a teacher logs in, they would be able to see everything the students have access to (plus anything restricted to Level 4 Members).

If you're using the free version of s2Member and you already use all 4 levels for students, keep in mind that s2Member Pro offers an unlimited number of membership levels.

Using a standard s2Member Membership Level to give teachers access to all the student material would automatically redirect them away from the dashboard (that's assuming you have Redirect members away set to Yes in WP Admin -> s2Member -> General Options -> Member Profile Modifications).

Does that sound like it would work for you?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: How to disable login redirect

Postby davidcom » November 25th, 2011, 4:06 am

Hi Raam Dev and Eduan,

Thanks for the input. Yes, that makes sense. A question, I've got 10 teachers. If I set all their levels to 4, and then later, I purchase the pro version and add 5 more levels for more students, will I have to go into each of the teachers' profiles and change them all individually to the new highest level? Is there a "global top level" where, if you're set to it, you will always remain at the highest level, regardless of how many new levels you create in the future?
User avatar
davidcom
Registered User
Registered User
 
Posts: 5
Joined: November 23, 2011

Re: How to disable login redirect

Postby Eduan » November 25th, 2011, 7:41 am

I suggest you take a look at Custom Capabilities, which are an advanced but very powerful and pretty easy way to control access.
Here's the video by Jason Caldwell (Lead Developer):
http://www.s2member.com/custom-capabilities-video/

Hope this helps.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: How to disable login redirect

Postby Raam Dev » November 27th, 2011, 1:07 pm

davidcom,

There is no "global top level" in the context you described. If you use the technique I described, you will need to change all your teachers to a higher level after upgrading to s2Member Pro. With s2Member Pro, you get unlimited levels, so you could set all your teachers to Level 100 if you think that will give you enough room for growth.

As Eduan mentioned, Custom Capabilities can also be used to achieve what you want and it's definitely the "right way" to do it, but it will require a bit more work on your end.

If you used Custom Capabilities to control access, you wouldn't be able to use Category Restrictions the way you currently use them. What you'd need to do is set all students at one level and all teachers at another level, and then use Custom Capabilities to determine what content the students should see. Because the teachers are at a higher level, they will automatically have access to everything the students can access.

As an example, you'd have a Custom Capability for each type of student: "studentEnglish", "studentFrench", etc. Then you'd use the s2Member Conditionals (WP Admin -> s2Member -> API / Scripting) to determine what content the students should see depending on their Custom Capability.

You might use something like this:

[s2If current_user_can(access_s2member_ccap_studentEnglish)]
Content for English Students
[/s2If]
[s2If current_user_can(access_s2member_ccap_studentFrench)]
Content for French Students
[/s2If]


(See Example #5 in Simple/Shortcode Conditionals).

You can manually add Custom Capabilities to existing accounts by editing the user account, or Custom Capabilities can automatically be added during the registration process.

You'd need to have a separate form or checkout button for each type of student and a separate one for the teachers. Each form/button would be configured to apply the "teacher", or "studentEnglish", or "studentFrench" Custom Capability to their account.

This is certainly a more extensible system, but as I mentioned earlier, it would require a bit more work in the short-term for you.

Eduan already mentioned the Custom Capabilities video. If you decide to use this system, you'll also want to check out the Advanced Conditionals video: http://www.s2member.com/advanced-conditionals-video/
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron