Пример #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);
     }
 }
Пример #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]);
 }
Пример #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)];
     }
 }