Roundcube Community Forum

Release Support => Release Discussion => Topic started by: amolmeghe on November 03, 2016, 01:30:27 AM

Title: Roundcube Webmail 1.1.4 ---- Captcha issue
Post by: amolmeghe on November 03, 2016, 01:30:27 AM
Hello,

i am using Roundcube Webmail 1.1.4, i have configured the captcha , however size of the captcha is very small, request you to please update me how to increase the CAPTCHA SIZE.

PFA....

please find the below code for the same.

----------------------------------------------------------------------------------------
$im = @imagecreate(150,20);
   $back = imagecolorallocatealpha($im,255,255,255,127);
   $text = imagecolorallocate($im,233,14,91);
   imagestring($im,20,40,2,$rand,$text);
   imagepng($im);
   $bimg = base64_encode(ob_get_contents());
   imagedestroy($im);      
   ob_end_clean();
   $attr['src'] = 'data:image/gif;base64,'.$bimg;
   $img_captcha = html::img($attr);
   $input_captcha   = new html_inputfield(array('name' => '_captcha', 'id' => 'rcmlogincaptcha'));
   $table->add('title', html::label('captcha', html::quote($this->app->gettext('captcha'))));
   $table->add('captcha',$img_captcha);
   $table->add('title', html::label('rcmlogincaptcha', html::quote($this->app->gettext('captcha'))));

------------------------------------------------------------------------------------------------------------------------------------------------

Thanks in Advance!
Title: Re: Roundcube Webmail 1.1.4 ---- Captcha issue
Post by: amolmeghe on November 07, 2016, 06:41:24 AM
I have sorted out the  issue at my level using imagettftext function.

as below,

$font = '/usr/share/fonts/dejavu/DejaVuSerif-BoldItalic.ttf';

 imagettftext($im,20,0,100,20,$text,$font,$random_text);
$text==color
$random_text==random alphanumeric value
$font== local font type