Пример #1
0
 public function onLoad()
 {
     parent::onLoad();
     try {
         $captcha = \Amun\Captcha::factory($this->config['amun_captcha']);
         $captcha->serve();
         exit;
     } catch (Exception $e) {
         header('Content-type: image/png');
         $im = imagecreatetruecolor(300, 57);
         $textcolor = imagecolorallocate($im, 0, 0, 0);
         $bgcolor = imagecolorallocate($im, 255, 255, 255);
         imagefill($im, 0, 0, $bgcolor);
         imagestring($im, 3, 4, 4, $e->getMessage(), $textcolor);
         imagepng($im);
         imagedestroy($im);
     }
 }
Пример #2
0
 protected function getRequestParams()
 {
     $params = parent::getRequestParams();
     if (!empty($params['fields'])) {
         $params['fields'] = array_diff($params['fields'], $this->getRestrictedFields());
     }
     return $params;
 }
Пример #3
0
 public function onLoad()
 {
     parent::onLoad();
     $this->fm = $this->getFormManager();
 }