Jump to content

User expiration


thlinna
 Share

Recommended Posts

How could I implement an expiration date for user? It's a kind of sleak version of subscription management, but my purpose is to limit user to access page as long as he pays for the service. What'd be the easiest solution for proof of concept other than managing them by hand? 

Thanks in advance.

Link to comment
Share on other sites

Should probably be noted that this depends a bit on whether you want to disable their entire account after the subscription is over (in which case you should follow Adrian's suggestion or take a closer look at Login Scheduler) or if you actually prefer to keep the account usable and only deny access to specific pages. In other words, is the subscription an "all-or-nothing thing" or can one user subscribe to different types of content?

One solution to the latter need would be storing pairs of users + subscription lengths in a Repeater field attached to the page they are subscribed to. Instead of Repeater you could use a PageTable field – or Table, if you don't mind the commercial aspect of ProFields – and instead of the subscription target you could store said data on the user account.

There are many solutions, and the best one depends on your specific needs :)

  • Like 2
Link to comment
Share on other sites

For one site I did this...

Created two roles - member and pro-member (pro-member is user with active subscription, with permission to view certain pro-only pages).

Added expiry field to user template, as adrian suggested.

Users can register for free - they get the basic member role with permission to post comments, limited view permission, etc.

If a member purchases a (non-renewing) subscription via PayPal:

  • pro-member role is given to user
  • expiry date is set according the duration they purchased and pro-member role is given to user

Daily Lazy Cron job:

  • checks for users with subscription expiring in next three days and emails a reminder to renew subscription
  • removes pro-member role from users with expired subscription
  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...