Esempio n. 1
0
 public function showCaptcha()
 {
     include JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'securimage' . DIRECTORY_SEPARATOR . 'securimage.php';
     $img = new securimage();
     $mod_jinc = JRequest::getString('mod_jinc', 'false');
     $mod_jinc = trim($mod_jinc);
     if ($mod_jinc == 'true') {
         $img->image_width = 125;
         $img->image_height = 30;
         $img->code_length = rand(4, 4);
         $img->setSessionPrefix('mod_jinc');
     } else {
         $img->image_width = 250;
         $img->image_height = 40;
         $img->code_length = rand(5, 6);
     }
     $img->perturbation = 0.7;
     $img->image_bg_color = new Securimage_Color("#ffffff");
     $img->use_transparent_text = true;
     $img->text_transparency_percentage = 45;
     // 100 = completely transparent
     $img->num_lines = 2;
     $img->image_signature = '';
     $img->text_color = new Securimage_Color("#333366");
     $img->line_color = new Securimage_Color("#FFFFCC");
     $img->show('');
     // alternate use:  $img->show('/path/to/background_image.jpg');
 }