Пример #1
0
 public function onBeforeFormSave(Oops_Form_Notification $notification)
 {
     $request = $notification->getInfo();
     $passedValue = strval($request[$this->_requestKey]);
     if (strlen($passedValue)) {
         require_once 'Oops/Kcaptcha/Storage.php';
         $captchaStorage = new Oops_Kcaptcha_Storage();
         /**
          * Here we could pass second argument to captcha checker in irder to keep value in storage
          * If so we could skip showing captcha on other form form errors
          */
         if ($captchaStorage->Check($this->_requestKey)) {
             return;
         }
     }
     $notification->Cancel("Captcha error", $this->_requestKey);
 }
Пример #2
0
 function saveKeyString()
 {
     require_once 'Oops/Kcaptcha/Storage.php';
     $storage = new Oops_Kcaptcha_Storage();
     $storage->Store($this->keystring);
 }