This topic is locked
[SOLVED]

 Validity period of membership (user ID)

3/27/2014 2:21:36 PM
PHPRunner General questions
F
F5447 author

Hi All,
I am new to PHPRunner event, and would like to have advice on how to write a customized event on

... function BeforeLogin($username, $password, $message, $pageObject)
I would like to use this function to detect validity period of a member. I have a enddate field in my user table, and I would like to check if user.enddate is beyond current date (NOW), then I would like to unset user login, and redirect to a page to tell user that his validity period is over.
Kindly advise.
Thanks and regards,

F5447

Sergey Kornilov admin 3/28/2014

I would suggest to use AfterSuccessfulLogin event so you do not have to perform login validation. In this case your code will be relatively simple.

if (time()>strtotime($data["enddate"])) {

session_unset();

header("Location: somepage.php");

exit();

}


More info:

http://xlinesoft.com/phprunner/docs/after_successful_login.htm