Example #1
0
 function validate($session_id)
 {
     $item = new AMP_Form_Element_Captcha(AMP_Registry::getDbcon(), $session_id);
     if ($item->hasData()) {
         return $item->getCaptcha();
     }
     return false;
 }
Example #2
0
 function create($session_id, $captcha_value)
 {
     $dbcon = AMP_Registry::getDbcon();
     $item = new AMP_Form_Element_Captcha($dbcon);
     AMP_Form_Element_Captcha::delete($session_id);
     $item_data = array('session' => $session_id, 'captcha' => $captcha_value);
     $item->setData($item_data);
     $result = $item->save();
     if ($result) {
         return $item->id;
     }
     return false;
 }