CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Change access to view after certain time.

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.