getCAPTCHA() public static method

Returns a new or the current CAPTCHA string.
public static getCAPTCHA ( boolean $new = false ) : string
$new boolean If true, a new CAPTCHA is created and returned. The current, to-be-confirmed string otherwise.
return string A CAPTCHA string.
Esempio n. 1
0
 public function validate(&$vars, $canAutoFill = false)
 {
     global $conf;
     if (!parent::validate($vars, $canAutoFill)) {
         if (!$GLOBALS['registry']->getAuth() && !empty($conf['guests']['captcha'])) {
             $vars->remove('captcha');
             $this->removeVariable($varname = 'captcha');
             $this->insertVariableBefore('newcomment', _("Spam protection"), 'captcha', 'figlet', true, null, null, array(Whups::getCAPTCHA(true), $conf['guests']['figlet_font']));
         }
         return false;
     }
     return true;
 }