[PHP] Date/Time Logic

2003-02-19 Thread Pushpinder Singh Garcha
Hello  Everyone,

My php/mysql application needs to keep track of the first time that a 
User logs on to the site. Afterwards the User should be allowed either  
3 days / 3 months/1 year of access to the site. Once the stipulated 
time period is over the system should invalidate the login of the user. 
The Admin/ User should get email notification about this. The 
notification part is easy the hard part to figure out is how to be able 
to keep and tab on the Time Period stipulated for a user.

Thanks in advance
Pushpinder Singh Garcha
_
Web Architect


Re: [PHP] Date/Time Logic

2003-02-19 Thread Brent Baisley
It sounds like you're asking for triggers, which are available yet. But 
you could setup a cron job to run every night to update the database. It 
would be no different than doing a nightly dump for backup. You could 
even have it email you the accounts that were closed and those that will 
be closing in the next week or two.

If that won't work for you, then you can just have the user login kick 
of the disabling code. It would still restrict access, but wouldn't give 
you the timely notification you're asking for.

On Wednesday, February 19, 2003, at 12:46 PM, Pushpinder Singh Garcha 
wrote:

Hello  Everyone,

My php/mysql application needs to keep track of the first time that a 
User logs on to the site. Afterwards the User should be allowed either  
3 days / 3 months/1 year of access to the site. Once the stipulated 
time period is over the system should invalidate the login of the user. 
The Admin/ User should get email notification about this. The 
notification part is easy the hard part to figure out is how to be able 
to keep and tab on the Time Period stipulated for a user.

Thanks in advance
Pushpinder Singh Garcha
_
Web Architect

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date/Time Logic

2003-02-19 Thread Justin French
I assume you talking about a logged in, validated user -- because there's no
way to prevent a user from deleting their cookies, or changing their IP, or
using a different computer to access the site.

My only suggestion is that you create a user/pass login system, maintain it
with sessions, and make the site members-only.

As part of the sign-up process, keep a timestamp of when they joined, and
each time they log-in, check that their stamp is within the limits set.

Next time they login after that date, you can use their login as the trigger
to:

a) set the account to invalid
b) send the admin a report email
c) update any other data and tables
d) prompt the user to buy more time, or whatever


By keeping timestamps of when they signed up, when they last logged in, you
can also build reports about who has logged in, who is about to run out of
time, who needs a reminder email sent about buying more time, and even run
some garbage cleanout stuff, so that users who have expired, and haven't
shown up in 2 months get auto-deleted or whatever.


Some of it could be done with cron jobs, or you could just choose to run a
script from your browser daily/weekly/yearly to trigger the processing.


Justin


on 20/02/03 5:50 AM, Brent Baisley ([EMAIL PROTECTED]) wrote:

 It sounds like you're asking for triggers, which are available yet. But
 you could setup a cron job to run every night to update the database. It
 would be no different than doing a nightly dump for backup. You could
 even have it email you the accounts that were closed and those that will
 be closing in the next week or two.
 
 If that won't work for you, then you can just have the user login kick
 of the disabling code. It would still restrict access, but wouldn't give
 you the timely notification you're asking for.
 
 On Wednesday, February 19, 2003, at 12:46 PM, Pushpinder Singh Garcha
 wrote:
 
 Hello  Everyone,
 
 My php/mysql application needs to keep track of the first time that a
 User logs on to the site. Afterwards the User should be allowed either
 3 days / 3 months/1 year of access to the site. Once the stipulated
 time period is over the system should invalidate the login of the user.
 The Admin/ User should get email notification about this. The
 notification part is easy the hard part to figure out is how to be able
 to keep and tab on the Time Period stipulated for a user.
 
 Thanks in advance
 Pushpinder Singh Garcha
 _
 Web Architect
 
 --
 Brent Baisley
 Systems Architect
 Landover Associates, Inc.
 Search  Advisory Services for Advanced Technology Environments
 p: 212.759.6400/800.759.0577
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php