Mukul
Posts: 53
|
| Posted: 12/05/2006, 7:22 AM |
|
Hi,
Another Question. hope fully someone will answer.
A combination of countdown time and observer pattern and a main class to check authentication and usertime.
table column contains : usertime=30min &servertime=10min.
I want to change access of all the users after the 30min. so need a server side count down to set a session variable to use in code. ($usertime)
$this->ReadAllowed = true;
$this->Visible = (CCSecurityAccessCheck("1") == "success");
if($this->Visible)
{
$this->ReadAllowed = $this->ReadAllowed && CCUserInGroups(CCGetGroupID(), "1");
$this->InsertAllowed = CCUserInGroups(CCGetGroupID(), $usertime);
$this->UpdateAllowed = CCUserInGroups(CCGetGroupID(), $usertime);
$this->DeleteAllowed = CCUserInGroups(CCGetGroupID(), $usertime);
Thanks,
Mukul
|
 |
 |
klwillis
Posts: 428
|
| Posted: 12/05/2006, 11:23 AM |
|
Before anyone can help you most effectively, explain the correlation in your
table between usertime and servertime.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
 |
 |
Mukul
Posts: 53
|
| Posted: 12/05/2006, 7:34 PM |
|
Hi Kevin,
The application is to be divided into 2 period. (access times)
1. In the period called UserTime. All the users can do actions as per their rights in all the pages.
2. In the period called Server time. The users can only view all pages but cannot add/update/delete.
There is a serverside countdown timer, which will countdown 30 min and after that set a flag $usertime to 0 meaning it is servertime where certain actions are to be done and after 10min again set $usertime to 1 meaning it is usertime.
Observer pattern is required as change in this flag should change the state of the observer and thus the access.
hope the explanation is sufficient.
----------------------------
Mukul
|
 |
 |
Michael Mikkelsen
|
| Posted: 12/07/2006, 8:47 AM |
|
You will probably want to store a time stamp in the database in your user table and then you read the timestamp and calculate how many mins have passed and compare that to the usertime and server time variables in the database. You can do these calculations in the SQL or in your php code.
|
|
|
 |
|