Example #1
0
 /**
  *	Handles the advertisement action after the form is posted.
  *	@return void
  */
 public function adAction()
 {
     if ($this->_request->isPost()) {
         if ($this->_form->isValid($this->_request->getParams())) {
             $ads = $this->_ad->fetchAds($this->_request->getPost(), $this->view->Doctype());
             $this->view->form = $this->_form->selectAd($ads);
         } else {
             Kizano_Misc::flash("There was an error processing your request. " . "Please correct the errors below and resubmit your form.");
             $this->_helper->redirector->gotoUrl('/ads/form/');
         }
     } else {
         $this->_helper->redirector->gotoUrl('/ads/form/');
     }
 }
Example #2
0
 function isXSRF()
 {
     if (isset($_SESSION['token'])) {
         if (!isset($_COOKIE['cracker']) || !isset($_ENV['_REQ']['chip']) && !isset($_POST['custom'])) {
             define('XSRF', true, true);
             return true;
         }
         if ($_SESSION['token'] != $_COOKIE['cracker'] . (isset($_POST['custom']) ? $_POST['custom'] : $_ENV['_REQ']['chip'])) {
             define('XSRF', true, true);
             return true;
         }
         setCookie('cracker', false, 1, WEB_ROOT, $_SERVER['HTTP_HOST'], isset($_SERVER['HTTPS']), true);
         Kizano_Misc::_null($_SESSION['token']);
     }
     return false;
 }
Example #3
0
 /**
  *	Initializes the sessions for storing user data over multiple page requests
  *	return array
  */
 protected function _initSession()
 {
     $this->bootstrap('view');
     $sess = $this->getResource('session');
     $session = new Zend_Session_Namespace($sess->name, true);
     $this->_setResource('session', $session);
     Zend_Registry::getInstance()->set('session', $session);
     $this->view->flash = Kizano_Misc::getFlash();
     return $this->getResource('session');
 }