diff options
author | xue <> | 2006-02-17 05:19:25 +0000 |
---|---|---|
committer | xue <> | 2006-02-17 05:19:25 +0000 |
commit | 7b38480de52c1d042ea542e2d06913a8c9b645fc (patch) | |
tree | 67ff025fb171a5325ac8fdc75a281ce8a19a2bd5 /framework/Web/UI/TPageStatePersister.php | |
parent | ae1c1995b2fec431afe7cca23b2697e1bef17baf (diff) |
Add TApplicationComponent class and adjusted the relevant classes.
Diffstat (limited to 'framework/Web/UI/TPageStatePersister.php')
-rw-r--r-- | framework/Web/UI/TPageStatePersister.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php index 90af9665..49321ff5 100644 --- a/framework/Web/UI/TPageStatePersister.php +++ b/framework/Web/UI/TPageStatePersister.php @@ -55,13 +55,12 @@ class TPageStatePersister extends TComponent implements IPageStatePersister public function save($state)
{
Prado::trace("Saving state",'System.Web.UI.TPageStatePersister');
- $sm=Prado::getApplication()->getSecurityManager();
if($this->_page->getEnableStateValidation())
- $data=$sm->hashData(Prado::serialize($state));
+ $data=$this->getApplication()->getSecurityManager()->hashData(Prado::serialize($state));
else
$data=Prado::serialize($state);
if($this->_page->getEnableStateEncryption())
- $data=$sm->encrypt($data);
+ $data=$this->getApplication()->getSecurityManager()->encrypt($data);
if(extension_loaded('zlib'))
$data=gzcompress($data);
$this->_page->getClientScript()->registerHiddenField(TPage::FIELD_PAGESTATE,base64_encode($data));
@@ -75,9 +74,7 @@ class TPageStatePersister extends TComponent implements IPageStatePersister public function load()
{
Prado::trace("Loading state",'System.Web.UI.TPageStatePersister');
- $application=Prado::getApplication();
- $sm=$application->getSecurityManager();
- $str=base64_decode($application->getRequest()->itemAt(TPage::FIELD_PAGESTATE));
+ $str=base64_decode($this->getRequest()->itemAt(TPage::FIELD_PAGESTATE));
if($str==='')
return null;
if(extension_loaded('zlib'))
@@ -87,10 +84,10 @@ class TPageStatePersister extends TComponent implements IPageStatePersister if($data!==false)
{
if($this->_page->getEnableStateEncryption())
- $data=$sm->decrypt($data);
+ $data=$this->getApplication()->getSecurityManager()->decrypt($data);
if($this->_page->getEnableStateValidation())
{
- if(($data=$sm->validateData($data))!==false)
+ if(($data=$this->getApplication()->getSecurityManager()->validateData($data))!==false)
return Prado::unserialize($data);
}
else
|