Exemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->provider = new CaptchaBuilder($this->generatePhrase());
     if (!empty($this->backgroundColor)) {
         list($red, $green, $blue) = $this->backgroundColor;
         $this->provider->setBackgroundColor($red, $green, $blue);
     }
 }
Exemplo n.º 2
0
 public function init()
 {
     parent::init();
     if (empty($this->backgroundColor)) {
         $this->backgroundColor = [mt_rand(220, 255), mt_rand(220, 255), mt_rand(220, 255)];
     }
     list($red, $green, $blue) = $this->backgroundColor;
     $this->provider = new Securimage(['image_width' => $this->width, 'image_height' => $this->height, 'image_bg_color' => new Securimage_Color($red, $green, $blue), 'code_length' => $this->length ?: mt_rand(5, 7), 'charset' => $this->alphabet, 'no_session' => true, 'no_exit' => true, 'send_headers' => false]);
 }
Exemplo n.º 3
0
 public function init()
 {
     parent::init();
     if (empty($this->length)) {
         $this->length = mt_rand(5, 7);
     }
     if (empty($this->foregroundColor)) {
         $this->foregroundColor = [mt_rand(0, 80), mt_rand(0, 80), mt_rand(0, 80)];
     }
     if (empty($this->backgroundColor)) {
         $this->backgroundColor = [mt_rand(220, 255), mt_rand(220, 255), mt_rand(220, 255)];
     }
 }