Account Expires field is not working ??

6 posts by 3 authors in: Forums > CMS Builder
Last Post: December 29, 2011   (RSS)

By kovali - December 28, 2011

Hi,

I have setup a CMSB website with the website membership and e-mail on approved plugin, everything is working fine with members signing up and they get their login password after they have been approved. However, all membership accounts should automatically expire after 30 days, this is were I have this problem:

In admin, I select the date that a new user account should expire (ie. 30 days after registration) and I deselect the checkbox - Never Expires / Ignore Account Expiry (account never expires) - , this should stop the member from logging in to the website after 30 days... but it doesn´t, they can still login after the date that I put in the Account Expires field.

I never had to make use of the Account Expires field in other CMSB websites before so I don´t have much experience with it...

Can someone help me with this please, what could be wrong here ?? Thanks in advance !!

Happy holidays :-)

Re: [kovali] Account Expires field is not working ??

By (Deleted User) - December 28, 2011

Hi Kovali,

A quick test to make sure everything is alright would be to create a brand new account and set the expiry to yesterday (for example) and then try logging in.

If it allows you to log in (and you've definitely un-checked "Ignore Account Expiry (account never expires)") then we'll need to take a look at that.

Conversely, if the account does show as expired then it becomes a case of trial and error to find the cause!

Hope this helps,

Tom

Re: [Tom P] Account Expires field is not working ??

By kovali - December 28, 2011

Hi Tom,

Thx for the reply, I did some tests and found out that when I set the expiry to yesterday I get the expired message allright when trying to login into the CMS Admin Login Page, but on the other hand I can still login into the actual website front-end, page: user-login.php, and get access to the membership pages/files... Did I forget something here ?? Is there a way to have the expired message show up on the actual website pages (like in the CMS Login) because that´s what is most important to me now ofcourse.

Thx for your help.

Re: [kovali] Account Expires field is not working ??

By kovali - December 29, 2011

it looks like the Approved checkbox overrides the Account Expires field...

Re: [kovali] Account Expires field is not working ??

By kovali - December 29, 2011

Problem solved!

In websiteMembership.php I had to uncomment line 82, like this:

// error checking - logoff expired and disabled users
if (@$user['disabled']) { alert(t("Your account has been disabled.")); }
if (@$user['isExpired']) { alert(t("Your account has expired.")); } // future: maybe we should add an expires url where user gets redirect when their account has expired? For subscription renewal

Now I finaly get the "Your account has expired" message when the expiry date has been reached...

Happy Newyear everyone!