From ae1c1995b2fec431afe7cca23b2697e1bef17baf Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 17 Feb 2006 04:28:06 +0000 Subject: moved shortcut methods from TComponent to TControl. --- framework/Web/UI/TPageStatePersister.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'framework/Web/UI/TPageStatePersister.php') diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php index 49321ff5..90af9665 100644 --- a/framework/Web/UI/TPageStatePersister.php +++ b/framework/Web/UI/TPageStatePersister.php @@ -55,12 +55,13 @@ 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=$this->getApplication()->getSecurityManager()->hashData(Prado::serialize($state)); + $data=$sm->hashData(Prado::serialize($state)); else $data=Prado::serialize($state); if($this->_page->getEnableStateEncryption()) - $data=$this->getApplication()->getSecurityManager()->encrypt($data); + $data=$sm->encrypt($data); if(extension_loaded('zlib')) $data=gzcompress($data); $this->_page->getClientScript()->registerHiddenField(TPage::FIELD_PAGESTATE,base64_encode($data)); @@ -74,7 +75,9 @@ class TPageStatePersister extends TComponent implements IPageStatePersister public function load() { Prado::trace("Loading state",'System.Web.UI.TPageStatePersister'); - $str=base64_decode($this->getRequest()->itemAt(TPage::FIELD_PAGESTATE)); + $application=Prado::getApplication(); + $sm=$application->getSecurityManager(); + $str=base64_decode($application->getRequest()->itemAt(TPage::FIELD_PAGESTATE)); if($str==='') return null; if(extension_loaded('zlib')) @@ -84,10 +87,10 @@ class TPageStatePersister extends TComponent implements IPageStatePersister if($data!==false) { if($this->_page->getEnableStateEncryption()) - $data=$this->getApplication()->getSecurityManager()->decrypt($data); + $data=$sm->decrypt($data); if($this->_page->getEnableStateValidation()) { - if(($data=$this->getApplication()->getSecurityManager()->validateData($data))!==false) + if(($data=$sm->validateData($data))!==false) return Prado::unserialize($data); } else -- cgit v1.2.3