robov
(Robov99)
July 4, 2016, 6:58am
1
I am building a membership site with different access levels.
Currently I am struggeling with the design of when a user upgrades (or their membership expires and a downgrade is needed).
One of the designs I am thinking of is having a cronjob check if they need to be downgraded
One other solution could be is to have an expiry on the auth-assignment record…
What suggestions do you have, how would you implement this ?
samdark
(Alexander Makarov)
July 4, 2016, 11:26am
2
Membership expiry is OK to do via cronjob. Upgrade should be done immediately since users will go check it right away.
robov
(Robov99)
July 4, 2016, 2:40pm
3
Thanks… I was hoping to avoid cron so that if cron failed for whatever reason, the user is still expiring
samdark
(Alexander Makarov)
July 4, 2016, 3:54pm
4
Another way is to store expiration date in a column of a user table and check it every time user does what’s to be restricted. This way there will be no lag and cron isn’t needed.