latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Demote User after on site Action or TASK

Home Forums Community Forum Demote User after on site Action or TASK

This topic contains 3 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years, 1 month ago.

Topic Author Topic
Posted: Sunday Nov 18th, 2012 at 3:52 am #31915
Juan Vanegas
Username: juanjo

Hello again guys, sorry for seek your knowledge once again :S
Let me explain a bit what im trying to do here, in my s2member installation have the regular time base subscription ( 1moth , 3moth, etc ), but i need to setup anACTION BASE subscription as well, meaning, after the users get the membership with this particular membership type ( action base one ) they will have unlimited access to the site, but instead of demoting them after certain period of time, i need to demote them after performing an task or action ( saving a project to the data base to be especific ), so as soon as the project is save the user will be demoted to SUBSCRIBER and they will no longer have access to a especific areas of the site, some sort of ONE TIME USE MEMBERSHIP if you will

Thats tha basic idea, so i thinking was to GET THE USER LEVEL in the application ( this is the restricted area of the site ), pass the LEVEL to the Application processor wich save the data in to DB, and if the user LEVEL and the CCAP are from the ONE TIME USE MEMBERSHIP then ill change the CURRENT USER LELVE in the DB to SUBSCRIBER LEVEL therefor this user will no longer have access to the APPLICATION ( restricted area ) after saving a project.

few question arice from this approach (already try it did not work )
– First and most importing one, is this approach functional at all ? meaning can i achieve my goal going this way, and if so, what happends to the AUTO EOT ?? ( wich its setup to demote the user to SUBSCRIBER), currently this SUBSCRIPTION its set up as ONE DAY SUBSCRIPTION,

– Is there any other way to do this ?? ( demote user to a specific lelvel after performing a task or action )

As always thks guys for your always helpful advices BYE

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Monday Nov 19th, 2012 at 8:13 am #31966

Hi Juan.

You could do one of two things: set an EOT time so the Auto EOT Behavior gets triggered immediately, or you can change the user role.

This article tells you about changing the role with PHP: Knowledge Base » Changing Roles/Capabilities via PHP

[hilite mono]"s2member_auto_eot_time"[/hilite] can be updated via PHP, probably using [hilite mono]update_user_option[/hilite]. http://codex.wordpress.org/Function_Reference/update_user_option

I hope that helps. :)

Posted: Wednesday Nov 28th, 2012 at 6:51 pm #32840
Juan Vanegas
Username: juanjo

Thks so.. much Cristian worked beautifully

Posted: Friday Nov 30th, 2012 at 6:39 am #32974

Great! Thanks for the update. :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.