74 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
75 $this->Chars =
'0123456789';
107 $Image = imagecreatetruecolor( $Width , $Height );
109 $BackgroundColor = imagecolorallocate( $Image , 255 , 255 , 255 );
111 imagefill( $Image , 0 , 0 , $BackgroundColor);
115 catch( Exception $e )
147 $FontFile = dirname( __FILE__ ).
'/res/font/albonic.ttf';
151 $Color = imagecolorallocate( $Image , 255 , 0 , 0 );
152 $NumChars = strlen( $this->Chars );
154 return( array( $FontFile , $CharAlign , $Start , $Interval , $Color , $NumChars ) );
156 catch( Exception $e )
191 list( $FontFile , $Align , $Start , $Interval , $Color , $Count ) = $this->
get_font_settings( $Image );
193 for( $i = 0 ; $i < 5 ; $i++ )
195 $Char = $this->Chars[ rand( 0 , $Count - 1 ) ];
196 $FontSize = rand( 15 , 25 );
197 $CharAngle = rand( -10 , 10 );
199 $Image , $FontSize , $CharAngle , $Start , $Align , $Color , $FontFile , $Char
205 return( array( $Image , $Str ) );
207 catch( Exception $e )
239 $SessionName =
'captcha';
241 if( $Options->get_setting(
'captcha_name' ,
false ) !== false )
243 if( $Options->get_setting(
'captcha_name' ) ==
'auto' )
245 $SessionName = $Options->get_setting(
'captcha_name' );
250 $this->Security->get_srv(
'SCRIPT_NAME' ,
'string' ).
251 $this->Security->get_srv(
'QUERY_STRING' ,
'string' )
256 return( $SessionName );
258 catch( Exception $e )
294 return( @$_SESSION[ $this->
get_sesion_name( $Options ) ] == $InputCaptcha );
296 catch( Exception $e )
324 if( function_exists(
"imagepng" ) )
326 header(
"Content-type: image/png" );
329 elseif( function_exists(
"imagegif" ) )
331 header(
"Content-type: image/gif" );
334 elseif( function_exists(
"imagejpeg" ) )
336 header(
"Content-type: image/jpeg" );
340 imagedestroy( $Image );
342 catch( Exception $e )
384 catch( Exception $e )