Ejemplo n.º 1
0
 public function __construct($properties = array())
 {
     require_once QUICKY_DIR . 'plugins/Captcha/Captcha_draw.class.php';
     $CAPTCHA = new CAPTCHA_draw();
     $CAPTCHA->generate_text();
     if (!isset($properties['type'])) {
         $properties['type'] = 'captcha';
     }
     foreach ($properties as $k => $v) {
         $this->{$k} = $v;
     }
 }
Ejemplo n.º 2
0
 public function __construct($properties = array())
 {
     require_once QUICKY_DIR . 'plugins/Captcha/Captcha_draw.class.php';
     $CAPTCHA = new CAPTCHA_draw();
     $CAPTCHA->generate_text();
     if (!session_id()) {
         session_start();
     }
     if (!isset($_SESSION['captcha'])) {
         $_SESSION['captcha'] = array();
     }
     $this->_imgid = -1;
     while ($this->_imgid == -1 or isset($_SESSION['captcha'][$this->_imgid])) {
         $this->_imgid = rand(0, mt_getrandmax());
     }
     $_SESSION['captcha'][$this->_imgid] = array($CAPTCHA->text, 0);
     foreach ($properties as $k => $v) {
         $this->{$k} = $v;
     }
 }