Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 20th, 2012  |  syntax: None  |  size: 0.73 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. require_once 'Not_Zend/CsrfProtect.php';
  4.  
  5. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  6. {
  7.         public function init()
  8.         {
  9.                 throw new exception('hi');
  10.                 Zend_Session::start();
  11.         }
  12.        
  13.         protected function _initCSRF()
  14.         {
  15.                 $fc = Zend_Controller_Front::getInstance();
  16.                 $csrfnono = new CU_Controller_Plugin_CsrfProtect(array(
  17.                                 'expiryTime' => 60, //will make the CSRF key expire in 60 seconds. Defaults to 5 minutes
  18.                                 'keyName' => 'csrfnono' //will make the CSRF form element be called "safetycheck". Defaults to "csrf"
  19.                 ));
  20.                 $fc->registerPlugin($csrfnono);
  21.         }
  22.        
  23.         protected function _initDbAdapter()
  24.         {
  25.                 $db = new Zend_Config($this->getOptions('db'));
  26.                 Zend_Registry::set('DbAdapter', $db);
  27.         }
  28. }