Esempio n. 1
0
 function check_CAPTCHA($type)
 {
     if (parent::check_passthru($type)) {
         return 0;
     }
     if ($_POST['CAPTCHA']) {
         $a = trim($_POST['CAPTCHAanswer']);
         if ($a == '42') {
             return 0;
         }
         return 1;
     }
     return 3;
 }
Esempio n. 2
0
 function check_CAPTCHA($type)
 {
     if (parent::check_passthru($type)) {
         return 0;
     }
     if ($_POST['CAPTCHA']) {
         $seed = $_POST['CAPTCHAquestionid'];
         $calc = $this->math_gen($seed);
         $ans = $_POST['CAPTCHAanswer'];
         eval('$res = ' . $calc . ';');
         if ($ans == $res) {
             return 0;
         } else {
             return 1;
         }
     }
     return 3;
 }
Esempio n. 3
0
 function check_CAPTCHA($type)
 {
     if (parent::check_passthru($type)) {
         return 0;
     }
     if ($_POST['CAPTCHA']) {
         $c_qid = isset($_POST['CAPTCHAquestionid']) ? $_POST['CAPTCHAquestionid'] : -1;
         $c_ans = $_POST['CAPTCHAanswer'];
         if (preg_match('/^[0-9]+$/', $c_qid) && $c_qid >= 0) {
             $c_qid = $c_qid % count($this->questions);
             if ($c_ans == $this->questions[$c_qid]['char']) {
                 return 0;
             } else {
                 return 1;
             }
         } else {
             return 2;
         }
     }
     return 3;
 }