noalyss Version-9
Public Member Functions | Data Fields
Securimage Class Reference
+ Collaboration diagram for Securimage:

Public Member Functions

 __construct ()
 Class constructor. More...
 
 addSignature ()
 Print signature text on image. More...
 
 allocateColors ()
 Allocate all colors that will be used in the CAPTCHA image. More...
 
 check ($code)
 Validate the code entered by the user. More...
 
 checkCode ()
 Check if the user entered code was correct. More...
 
 clearCodeFromDatabase ()
 Delete a code from the database by ip address hash. More...
 
 createCode ()
 Create a code and save to the session. More...
 
 distortedCopy ()
 Warp text from temporary image onto final image. More...
 
 doImage ()
 Generate and output the image. More...
 
 drawLines ()
 Draw random curvy lines over the image
Modified code from HKCaptcha. More...
 
 drawWord ()
 Draw the CAPTCHA code over the image. More...
 
 frand ()
 Generate random number less than 1. More...
 
 generateCode ($len)
 Generate a code. More...
 
 generateMP3 ($letters)
 Generate an mp3 file by concatenating individual files. More...
 
 generateWAV ($letters)
 Generate a wav file by concatenating individual files. More...
 
 getAudibleCode ($format='wav')
 Get WAV or MP3 file data of the spoken code. More...
 
 getBackgroundFromDirectory ()
 Return the full path to a random gif, jpg, or png from the background directory. More...
 
 getCode ()
 Get the captcha code. More...
 
 getCodeFromDatabase ()
 Get stored captcha code from sqlite database based on ip address hash. More...
 
 getIPHash ()
 Get hashed IP address of remote user. More...
 
 isCodeExpired ($creation_time)
 Check a code to see if it is expired based on creation time. More...
 
 openDatabase ()
 Open SQLite database. More...
 
 output ()
 Output image to the browser. More...
 
 outputAudioFile ()
 Output audio file with HTTP headers to browser. More...
 
 purgeOldCodesFromDatabase ()
 Purge codes over a day old from database. More...
 
 readCodeFromFile ()
 Reads a word list file to get a code. More...
 
 saveCodeToDatabase ()
 Save captcha code to sqlite database. More...
 
 saveData ()
 Save the code in the session. More...
 
 scrambleAudioData (&$data, $format)
 Randomly modify the audio data to scramble sound and prevent binary recognition. More...
 
 setAudioPath ($audio_directory)
 Set the path to the audio directory. More...
 
 setBackground ()
 Set the background of the CAPTCHA image. More...
 
 show ($background_image="")
 Generate a code and output the image to the browser. More...
 
 validate ()
 Validate the code to the user code. More...
 

Data Fields

 $audio_format
 
 $audio_path
 
 $background_directory = null
 
 $bgimg
 
 $charset
 
 $code
 
 $code_entered
 
 $code_length
 
 $correct_code
 
 $draw_lines_over_text
 
 $expiry_time
 
 $gd_font_file
 
 $gd_font_size
 
 $gdbgcolor
 
 $gdlinecolor
 
 $gdmulticolor
 
 $gdsignaturecolor
 
 $gdtextcolor
 
 $im
 
 $image_bg_color
 
 $image_height
 
 $image_signature
 
 $image_type
 
 $image_width
 
 $iscale
 
 $line_color
 
 $multi_text_color
 
 $num_lines
 
 $perturbation
 
 $session_name = ''
 
 $signature_color
 
 $sqlite_database
 
 $sqlite_handle
 
 $text_angle_maximum
 
 $text_angle_minimum
 
 $text_color
 
 $text_transparency_percentage
 
 $text_x_start
 
 $tmpimg
 
 $ttf_file
 
 $use_gd_font
 
 $use_multi_text
 
 $use_sqlite_db
 Use an SQLite database for storing codes as a backup to sessions. More...
 
 $use_transparent_text
 
 $use_wordlist = false
 
 $wordlist_file
 

Detailed Description

Definition at line 107 of file securimage.php.

Constructor & Destructor Documentation

◆ __construct()

Securimage::__construct ( )

Class constructor.


Because the class uses sessions, this will attempt to start a session if there is no previous one.
If you do not start a session before calling the class, the constructor must be called before any output is sent to the browser.

$securimage = new Securimage();

Definition at line 506 of file securimage.php.

507 {
508 // Initialize session or attach to existing
509 if ( session_id() == '' ) { // no session has been started yet, which is needed for validation
510 if (trim($this->session_name) != '') {
511 session_name($this->session_name); // set session name if provided
512 }
513 session_start();
514 }
515
516 // Set Default Values
517 $this->image_width = 230;
518 $this->image_height = 80;
519 $this->image_type = SI_IMAGE_PNG;
520
521 $this->code_length = 6;
522 $this->charset = 'ABCDEFGHKLMNPRSTUVWYZabcdefghklmnprstuvwyz23456789';
523 $this->wordlist_file = './words/words.txt';
524 $this->use_wordlist = false;
525
526 $this->gd_font_file = 'gdfonts/automatic.gdf';
527 $this->use_gd_font = false;
528 $this->gd_font_size = 24;
529 $this->text_x_start = 15;
530
531 $this->ttf_file = './AHGBold.ttf';
532
533 $this->perturbation = 0.75;
534 $this->iscale = 5;
535 $this->text_angle_minimum = 0;
536 $this->text_angle_maximum = 0;
537
538 $this->image_bg_color = new Securimage_Color(0xff, 0xff, 0xff);
539 $this->text_color = new Securimage_Color(0x3d, 0x3d, 0x3d);
540 $this->multi_text_color = array(new Securimage_Color(0x0, 0x20, 0xCC),
541 new Securimage_Color(0x0, 0x30, 0xEE),
542 new Securimage_color(0x0, 0x40, 0xCC),
543 new Securimage_Color(0x0, 0x50, 0xEE),
544 new Securimage_Color(0x0, 0x60, 0xCC));
545 $this->use_multi_text = false;
546
547 $this->use_transparent_text = false;
549
550 $this->num_lines = 10;
551 $this->line_color = new Securimage_Color(0x3d, 0x3d, 0x3d);
552 $this->draw_lines_over_text = true;
553
554 $this->image_signature = '';
555 $this->signature_color = new Securimage_Color(0x20, 0x50, 0xCC);
556 $this->signature_font = './AHGBold.ttf';
557
558 $this->audio_path = './audio/';
559 $this->audio_format = 'mp3';
560 $this->session_name = '';
561 $this->expiry_time = 900;
562
563 $this->sqlite_database = 'database/securimage.sqlite';
564 $this->use_sqlite_db = false;
565
566 $this->sqlite_handle = false;
567 }
$img audio_format
$img image_height
$img use_multi_text
$img text_transparency_percentage
$img image_type
$img num_lines
$img perturbation
$img line_color
$img image_width
$img code_length
$img text_angle_minimum
$img image_signature
$img use_transparent_text
$img multi_text_color
$img text_angle_maximum
$img image_bg_color
$img signature_color
$img use_wordlist

References audio_format, code_length, image_bg_color, image_height, image_signature, image_type, image_width, line_color, multi_text_color, num_lines, perturbation, signature_color, text_angle_maximum, text_angle_minimum, text_color, text_transparency_percentage, use_multi_text, use_transparent_text, and use_wordlist.

Member Function Documentation

◆ addSignature()

Securimage::addSignature ( )

Print signature text on image.

Since
2.0 @access private

Definition at line 1376 of file securimage.php.

1377 {
1378 if ($this->use_gd_font) {
1379 imagestring($this->im, 5, $this->image_width - (strlen($this->image_signature) * 10), $this->image_height - 20, $this->image_signature, $this->gdsignaturecolor);
1380 } else {
1381
1382 $bbox = imagettfbbox(10, 0, $this->signature_font, $this->image_signature);
1383 $textlen = $bbox[2] - $bbox[0];
1384 $x = $this->image_width - $textlen - 5;
1385 $y = $this->image_height - 3;
1386
1387 imagettftext($this->im, 10, 0, $x, $y, $this->gdsignaturecolor, $this->signature_font, $this->image_signature);
1388 }
1389 }

References image_height, image_signature, and image_width.

Referenced by doImage().

◆ allocateColors()

Securimage::allocateColors ( )

Allocate all colors that will be used in the CAPTCHA image.

Since
2.0.1 @access private

Definition at line 692 of file securimage.php.

693 {
694 // allocate bg color first for imagecreate
695 $this->gdbgcolor = imagecolorallocate($this->im, $this->image_bg_color->r??0, $this->image_bg_color->g??0, $this->image_bg_color->b??0);
696
697 $this->text_color->r=$this->text_color->r??rand(0,255);
698 $this->text_color->g=$this->text_color->g??rand(0,255);
699 $this->text_color->b=$this->text_color->b??rand(0,255);
700 $this->line_color->r=$this->line_color->r??rand(0,255);
701 $this->line_color->g=$this->line_color->g??rand(0,255);
702 $this->line_color->b=$this->line_color->b??rand(0,255);
703
704
705
706 $alpha = intval($this->text_transparency_percentage / 100 * 127);
707
708 if ($this->use_transparent_text == true) {
709 $this->gdtextcolor = imagecolorallocatealpha($this->im, $this->text_color->r, $this->text_color->g, $this->text_color->b, $alpha);
710 $this->gdlinecolor = imagecolorallocatealpha($this->im, $this->line_color->r, $this->line_color->g, $this->line_color->b, $alpha);
711 } elseif ( $this->text_color != null ) {
712 $this->gdtextcolor = imagecolorallocate($this->im, $this->text_color->r, $this->text_color->g, $this->text_color->b);
713 $this->gdlinecolor = imagecolorallocate($this->im, $this->line_color->r, $this->line_color->g, $this->line_color->b);
714 } else {
715 $red=rand(0,255);
716 $green=rand(0,255);
717 $blue=rand(0,255);
718 $this->gdtextcolor = imagecolorallocate($this->im, $red, $green,$blue);
719 $this->gdlinecolor = imagecolorallocate($this->im, $red, $green, $blue);
720 }
721
722 $this->gdsignaturecolor = imagecolorallocate($this->im, $this->signature_color->r??0, $this->signature_color->g??0, $this->signature_color->b??0);
723
724 if ($this->use_multi_text == true) {
725 $this->gdmulticolor = array();
726
727 foreach($this->multi_text_color??[] as $color) {
728 $color->r=$color->r??rand(0,255);
729 $color->g= $color->g??rand(0,255);
730 $color->b=$color->b??rand(0,255);
731 if ($this->use_transparent_text == true) {
732 $this->gdmulticolor[] = imagecolorallocatealpha($this->im, $color->r, $color->g, $color->b, $alpha);
733 } else {
734 $this->gdmulticolor[] = imagecolorallocate($this->im, $color->r, $color->g, $color->b);
735 }
736 }
737 }
738 }
if( $delta< 0) elseif( $delta==0)

References $color, elseif, image_bg_color, line_color, multi_text_color, signature_color, text_color, text_transparency_percentage, use_multi_text, and use_transparent_text.

Referenced by doImage().

◆ check()

Securimage::check (   $code)

Validate the code entered by the user.

$code = $_POST['code']; if ($securimage->check($code) == false) { die("Sorry, the code entered did not match."); } else { $valid = true; }

Parameters
string$codeThe code the user entered
Returns
boolean true if the code was correct, false if not

Definition at line 605 of file securimage.php.

606 {
607 $this->code_entered = $code;
608 $this->validate();
609 return $this->correct_code;
610 }
validate()
Validate the code to the user code.

References $code, $correct_code, and validate().

+ Here is the call graph for this function:

◆ checkCode()

Securimage::checkCode ( )

Check if the user entered code was correct.

@access private

Returns
boolean

Definition at line 1215 of file securimage.php.

1216 {
1217 return $this->correct_code;
1218 }

References $correct_code.

◆ clearCodeFromDatabase()

Securimage::clearCodeFromDatabase ( )

Delete a code from the database by ip address hash.

@access private

Since
2.0.1

Definition at line 1486 of file securimage.php.

1487 {
1488 if ($this->sqlite_handle !== false) {
1489 $ip = $this->getIPHash();
1490
1491 sqlite_query($this->sqlite_handle, "DELETE FROM codes WHERE iphash = '$ip'");
1492 }
1493 }
getIPHash()
Get hashed IP address of remote user.

References getIPHash().

Referenced by validate().

+ Here is the call graph for this function:

◆ createCode()

Securimage::createCode ( )

Create a code and save to the session.

@access private

Since
1.0.1

Definition at line 996 of file securimage.php.

997 {
998 $this->code = false;
999
1000 if ($this->use_wordlist && is_readable($this->wordlist_file)) {
1001 $this->code = $this->readCodeFromFile();
1002 }
1003
1004 if ($this->code == false) {
1005 $this->code = $this->generateCode($this->code_length);
1006 }
1007
1008 $this->saveData();
1009 }
saveData()
Save the code in the session.
generateCode($len)
Generate a code.
readCodeFromFile()
Reads a word list file to get a code.

References code_length, generateCode(), readCodeFromFile(), saveData(), and use_wordlist.

Referenced by doImage(), and getAudibleCode().

+ Here is the call graph for this function:

◆ distortedCopy()

Securimage::distortedCopy ( )

Warp text from temporary image onto final image.


Modified for securimage

@access private

Since
2.0
Author
Han-Kwang Nienhuys modified

Definition at line 936 of file securimage.php.

937 {
938 $numpoles = 3; // distortion factor
939
940 // make array of poles AKA attractor points
941 for ($i = 0; $i < $numpoles; ++$i) {
942 $px[$i] = rand((int) ($this->image_width * 0.3), (int)( $this->image_width * 0.7));
943 $py[$i] = rand((int) ($this->image_height * 0.3),(int) ($this->image_height * 0.7));
944 $rad[$i] = rand((int) ($this->image_width * 0.4), (int) ($this->image_width * 0.7));
945 $tmp = -$this->frand() * 0.15 - 0.15;
946 $amp[$i] = $this->perturbation * $tmp;
947 }
948
949 $bgCol = imagecolorat($this->tmpimg, 0, 0);
950 $width2 = $this->iscale * $this->image_width;
951 $height2 = $this->iscale * $this->image_height;
952
953 imagepalettecopy($this->im, $this->tmpimg); // copy palette to final image so text colors come across
954
955 // loop over $img pixels, take pixels from $tmpimg with distortion field
956 for ($ix = 0; $ix < $this->image_width; ++$ix) {
957 for ($iy = 0; $iy < $this->image_height; ++$iy) {
958 $x = $ix;
959 $y = $iy;
960
961 for ($i = 0; $i < $numpoles; ++$i) {
962 $dx = $ix - $px[$i];
963 $dy = $iy - $py[$i];
964 if ($dx == 0 && $dy == 0) continue;
965
966 $r = sqrt($dx * $dx + $dy * $dy);
967 if ($r > $rad[$i]) continue;
968
969 $rscale = $amp[$i] * sin(3.14 * $r / $rad[$i]);
970 $x += $dx * $rscale;
971 $y += $dy * $rscale;
972 }
973
974 $c = $bgCol;
975 $x *= $this->iscale;
976 $y *= $this->iscale;
977
978 if ($x >= 0 && $x < $width2 && $y >= 0 && $y < $height2) {
979 $c = imagecolorat($this->tmpimg, (int) $x,(int) $y);
980 }
981
982 if ($c != $bgCol) { // only copy pixels of letters to preserve any background image
983 imagesetpixel($this->im, $ix, $iy, $c);
984 }
985 }
986 }
987 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$rad
frand()
Generate random number less than 1.
$ix
Definition: dashboard.php:68

References $i, $image_height, $image_width, $iscale, $ix, $r, $rad, $tmp, frand(), image_height, image_width, and perturbation.

Referenced by doImage().

+ Here is the call graph for this function:

◆ doImage()

Securimage::doImage ( )

Generate and output the image.

@access private

Definition at line 652 of file securimage.php.

653 {
654 if ($this->use_gd_font == true || $this->iscale == null || $this->iscale == 0) {
655 $this->iscale = 1;
656 }
657 if($this->use_transparent_text == true || $this->bgimg != "") {
658 $this->im = imagecreatetruecolor($this->image_width, $this->image_height);
659 $this->tmpimg = imagecreatetruecolor($this->image_width * $this->iscale, $this->image_height * $this->iscale);
660
661 } else { //no transparency
662 $this->im = imagecreate($this->image_width, $this->image_height);
663 $this->tmpimg = imagecreate($this->image_width * $this->iscale, $this->image_height * $this->iscale);
664 }
665
666 $this->allocateColors();
667 imagepalettecopy($this->tmpimg, $this->im);
668
669 $this->setBackground();
670
671 $this->createCode();
672
673 if (!$this->draw_lines_over_text && $this->num_lines > 0) $this->drawLines();
674
675 $this->drawWord();
676 if ($this->use_gd_font == false && is_readable($this->ttf_file)) $this->distortedCopy();
677
678 if ($this->draw_lines_over_text && $this->num_lines > 0) $this->drawLines();
679
680 if (trim($this->image_signature) != '') $this->addSignature();
681
682 $this->output();
683
684 }
drawLines()
Draw random curvy lines over the image Modified code from HKCaptcha.
Definition: securimage.php:813
output()
Output image to the browser.
allocateColors()
Allocate all colors that will be used in the CAPTCHA image.
Definition: securimage.php:692
drawWord()
Draw the CAPTCHA code over the image.
Definition: securimage.php:853
createCode()
Create a code and save to the session.
Definition: securimage.php:996
distortedCopy()
Warp text from temporary image onto final image.
Definition: securimage.php:936
setBackground()
Set the background of the CAPTCHA image.
Definition: securimage.php:746
addSignature()
Print signature text on image.
$img bgimg

References addSignature(), allocateColors(), bgimg, createCode(), distortedCopy(), drawLines(), drawWord(), image_height, image_signature, image_width, num_lines, output(), setBackground(), and use_transparent_text.

Referenced by show().

+ Here is the call graph for this function:

◆ drawLines()

Securimage::drawLines ( )

Draw random curvy lines over the image
Modified code from HKCaptcha.

Since
2.0 @access private

Definition at line 813 of file securimage.php.

814 {
815 for ($line = 0; $line < $this->num_lines; ++$line) {
816 $x = $this->image_width * (1 + $line) / ($this->num_lines + 1);
817 $x += (0.5 - $this->frand()) * $this->image_width / $this->num_lines;
818 $y = rand($this->image_height * 0.1, $this->image_height * 0.9);
819
820 $theta = ($this->frand()-0.5) * M_PI * 0.7;
822 $len = rand($w * 0.4, $w * 0.7);
823 $lwid = rand(0, 2);
824
825 $k = $this->frand() * 0.6 + 0.2;
826 $k = $k * $k * 0.5;
827 $phi = $this->frand() * 6.28;
828 $step = 0.5;
829 $dx = $step * cos($theta);
830 $dy = $step * sin($theta);
831 $n = $len / $step;
832 $amp = 1.5 * $this->frand() / ($k + 5.0 / $len);
833 $x0 = $x - 0.5 * $len * cos($theta);
834 $y0 = $y - 0.5 * $len * sin($theta);
835
836 $ldx = round(-$dy * $lwid);
837 $ldy = round($dx * $lwid);
838
839 for ($i = 0; $i < $n; ++$i) {
840 $x = $x0 + $i * $dx + $amp * $dy * sin($k * $i * $step + $phi);
841 $y = $y0 + $i * $dy - $amp * $dx * sin($k * $i * $step + $phi);
842 imagefilledrectangle($this->im, $x, $y, $x + $lwid, $y + $lwid, $this->gdlinecolor);
843 }
844 }
845 }
foreach($array as $idx=> $m) $w

References $i, $image_width, $line, $num_lines, $step, $w, frand(), image_height, and image_width.

Referenced by doImage().

+ Here is the call graph for this function:

◆ drawWord()

Securimage::drawWord ( )

Draw the CAPTCHA code over the image.

@access private

Definition at line 853 of file securimage.php.

854 {
855 $width2 = $this->image_width * $this->iscale;
856 $height2 = $this->image_height * $this->iscale;
857
858 if ($this->use_gd_font == true || !is_readable($this->ttf_file??"")) {
859 if (!is_int($this->gd_font_file)) { //is a file name
860 $font = @imageloadfont($this->gd_font_file??"");
861 if ($font == false) {
862 trigger_error("Failed to load GD Font file {$this->gd_font_file} ", E_USER_WARNING);
863 return;
864 }
865 } else { //gd font identifier
866 $font = $this->gd_font_file;
867 }
868
869 imagestring($this->im, $font, $this->text_x_start, ($this->image_height / 2) - ($this->gd_font_size / 2), $this->code, $this->gdtextcolor);
870 } else { //ttf font
871 $font_size = $height2 * .35;
872 $bb = imagettfbbox($font_size, 0, $this->ttf_file, $this->code);
873 $tx = $bb[4] - $bb[0];
874 $ty = $bb[5] - $bb[1];
875 $x = floor($width2 / 2 - $tx / 2 - $bb[0]);
876 $y = round($height2 / 2 - $ty / 2 - $bb[1]);
877
878 $strlen = strlen($this->code);
879 if (!is_array($this->multi_text_color)) $this->use_multi_text = false;
880
881
882 if ($this->use_multi_text == false && $this->text_angle_minimum == 0 && $this->text_angle_maximum == 0) { // no angled or multi-color characters
883 imagettftext($this->tmpimg, $font_size, 0, $x, $y, $this->gdtextcolor, $this->ttf_file, $this->code);
884 } else {
885 for($i = 0; $i < $strlen; ++$i) {
886 $angle = rand($this->text_angle_minimum, $this->text_angle_maximum);
887 $y = rand($y - 5, $y + 5);
888 if ($this->use_multi_text == true) {
889 $font_color = $this->gdmulticolor[rand(0, sizeof($this->gdmulticolor) - 1)];
890 } else {
891 $font_color = $this->gdtextcolor;
892 }
893
894 $ch = $this->code[$i];
895
896 imagettftext($this->tmpimg, $font_size, $angle, $x, $y, $font_color, $this->ttf_file, $ch);
897
898 // estimate character widths to increment $x without creating spaces that are too large or too small
899 // these are best estimates to align text but may vary between fonts
900 // for optimal character widths, do not use multiple text colors or character angles and the complete string will be written by imagettftext
901 if (strpos('abcdeghknopqsuvxyz', $ch) !== false) {
902 $min_x = $font_size - ($this->iscale * 6);
903 $max_x = $font_size - ($this->iscale * 6);
904 } else if (strpos('ilI1', $ch) !== false) {
905 $min_x = $font_size / 5;
906 $max_x = $font_size / 3;
907 } else if (strpos('fjrt', $ch) !== false) {
908 $min_x = $font_size - ($this->iscale * 12);
909 $max_x = $font_size - ($this->iscale * 12);
910 } else if ($ch == 'wm') {
911 $min_x = $font_size;
912 $max_x = $font_size + ($this->iscale * 3);
913 } else { // numbers, capitals or unicode
914 $min_x = $font_size + ($this->iscale * 2);
915 $max_x = $font_size + ($this->iscale * 5);
916 }
917
918 $x += rand((int)$min_x,(int) $max_x);
919 } //for loop
920 } // angled or multi-color
921 } //else ttf font
922 //$this->im = $this->tmpimg;
923 //$this->output();
924 } //function

References $gd_font_file, $gdtextcolor, $i, $iscale, image_height, image_width, multi_text_color, text_angle_maximum, text_angle_minimum, and use_multi_text.

Referenced by doImage().

◆ frand()

Securimage::frand ( )

Generate random number less than 1.

Since
2.0 @access private
Returns
float

Definition at line 1364 of file securimage.php.

1365 {
1366 return 0.0001*rand(0,9999);
1367 }

Referenced by distortedCopy(), and drawLines().

◆ generateCode()

Securimage::generateCode (   $len)

Generate a code.

@access private

Parameters
int$lenThe code length
Returns
string

Definition at line 1018 of file securimage.php.

1019 {
1020 $code = '';
1021
1022 for($i = 1, $cslen = strlen($this->charset??""); $i <= $len; ++$i) {
1023 $code .= $this->charset[rand(0, $cslen - 1)];
1024 }
1025 return $code;
1026 }

References $code, and $i.

Referenced by createCode().

◆ generateMP3()

Securimage::generateMP3 (   $letters)

Generate an mp3 file by concatenating individual files.

Since
1.0.4 @access private
Parameters
array$lettersArray of letters to build a file from
Returns
string MP3 file data

Definition at line 1336 of file securimage.php.

1337 {
1338 $data_len = 0;
1339 $files = array();
1340 $out_data = '';
1341
1342 foreach ($letters as $letter) {
1343 $filename = $this->audio_path . strtoupper($letter) . '.mp3';
1344
1345 $fp = fopen($filename, 'rb');
1346 $data = fread($fp, filesize($filename)); // read file in
1347
1348 $this->scrambleAudioData($data, 'mp3');
1349 $out_data .= $data;
1350
1351 fclose($fp);
1352 }
1353
1354
1355 return $out_data;
1356 }
scrambleAudioData(&$data, $format)
Randomly modify the audio data to scramble sound and prevent binary recognition.

References $data, $letter, and scrambleAudioData().

Referenced by getAudibleCode().

+ Here is the call graph for this function:

◆ generateWAV()

Securimage::generateWAV (   $letters)

Generate a wav file by concatenating individual files.

Since
1.0.1 @access private
Parameters
array$lettersArray of letters to build a file from
Returns
string WAV file data

Definition at line 1228 of file securimage.php.

1229 {
1230 $data_len = 0;
1231 $files = array();
1232 $out_data = '';
1233
1234 foreach ($letters as $letter) {
1235 $filename = $this->audio_path . strtoupper($letter) . '.wav';
1236
1237 $fp = fopen($filename, 'rb');
1238
1239 $file = array();
1240
1241 $data = fread($fp, filesize($filename)); // read file in
1242
1243 $header = substr($data, 0, 36);
1244 $body = substr($data, 44);
1245
1246
1247 $data = unpack('NChunkID/VChunkSize/NFormat/NSubChunk1ID/VSubChunk1Size/vAudioFormat/vNumChannels/VSampleRate/VByteRate/vBlockAlign/vBitsPerSample', $header);
1248
1249 $file['sub_chunk1_id'] = $data['SubChunk1ID'];
1250 $file['bits_per_sample'] = $data['BitsPerSample'];
1251 $file['channels'] = $data['NumChannels'];
1252 $file['format'] = $data['AudioFormat'];
1253 $file['sample_rate'] = $data['SampleRate'];
1254 $file['size'] = $data['ChunkSize'] + 8;
1255 $file['data'] = $body;
1256
1257 if ( ($p = strpos($file['data'], 'LIST')) !== false) {
1258 // If the LIST data is not at the end of the file, this will probably break your sound file
1259 $info = substr($file['data'], $p + 4, 8);
1260 $data = unpack('Vlength/Vjunk', $info);
1261 $file['data'] = substr($file['data'], 0, $p);
1262 $file['size'] = $file['size'] - (strlen($file['data']) - $p);
1263 }
1264
1265 $files[] = $file;
1266 $data = null;
1267 $header = null;
1268 $body = null;
1269
1270 $data_len += strlen($file['data']);
1271
1272 fclose($fp);
1273 }
1274
1275 $out_data = '';
1276 for($i = 0; $i < sizeof($files); ++$i) {
1277 if ($i == 0) { // output header
1278 $out_data .= pack('C4VC8', ord('R'), ord('I'), ord('F'), ord('F'), $data_len + 36, ord('W'), ord('A'), ord('V'), ord('E'), ord('f'), ord('m'), ord('t'), ord(' '));
1279
1280 $out_data .= pack('VvvVVvv',
1281 16,
1282 $files[$i]['format'],
1283 $files[$i]['channels'],
1284 $files[$i]['sample_rate'],
1285 $files[$i]['sample_rate'] * (($files[$i]['bits_per_sample'] * $files[$i]['channels']) / 8),
1286 ($files[$i]['bits_per_sample'] * $files[$i]['channels']) / 8,
1287 $files[$i]['bits_per_sample'] );
1288
1289 $out_data .= pack('C4', ord('d'), ord('a'), ord('t'), ord('a'));
1290
1291 $out_data .= pack('V', $data_len);
1292 }
1293
1294 $out_data .= $files[$i]['data'];
1295 }
1296
1297 $this->scrambleAudioData($out_data, 'wav');
1298 return $out_data;
1299 }
$p
Definition: array.php:34
if(count($a_accounting)==0) $header

References $data, $file, $header, $i, $letter, $p, and scrambleAudioData().

Referenced by getAudibleCode().

+ Here is the call graph for this function:

◆ getAudibleCode()

Securimage::getAudibleCode (   $format = 'wav')

Get WAV or MP3 file data of the spoken code.


This is appropriate for output to the browser as audio/x-wav or audio/mpeg

Since
1.0.1
Returns
string WAV or MP3 data

Definition at line 1104 of file securimage.php.

1105 {
1106 $letters = array();
1107 $code = $this->getCode();
1108
1109 if ($code == '') {
1110 $this->createCode();
1111 $code = $this->getCode();
1112 }
1113
1114 for($i = 0; $i < strlen($code); ++$i) {
1115 $letters[] = $code[$i];
1116 }
1117
1118 if ($format == 'mp3') {
1119 return $this->generateMP3($letters);
1120 } else {
1121 return $this->generateWAV($letters);
1122 }
1123 }
generateMP3($letters)
Generate an mp3 file by concatenating individual files.
generateWAV($letters)
Generate a wav file by concatenating individual files.
getCode()
Get the captcha code.

References $code, $i, createCode(), generateMP3(), generateWAV(), and getCode().

Referenced by outputAudioFile().

+ Here is the call graph for this function:

◆ getBackgroundFromDirectory()

Securimage::getBackgroundFromDirectory ( )

Return the full path to a random gif, jpg, or png from the background directory.

@access private

See also
Securimage::$background_directory
Returns
mixed false if none found, string $path if found

Definition at line 786 of file securimage.php.

787 {
788 $images = array();
789
790 if ($dh = opendir($this->background_directory)) {
791 while (($file = readdir($dh)) !== false) {
792 if (preg_match('/(jpg|gif|png)$/i', $file)) $images[] = $file;
793 }
794
795 closedir($dh);
796
797 if (sizeof($images) > 0) {
798 return rtrim($this->background_directory, '/') . '/' . $images[rand(0, sizeof($images)-1)];
799 }
800 }
801
802 return false;
803 }
$img background_directory

References $file, and background_directory.

Referenced by setBackground().

◆ getCode()

Securimage::getCode ( )

Get the captcha code.

Since
1.0.1
Returns
string

Definition at line 1198 of file securimage.php.

1199 {
1200 if (isset($_SESSION['securimage_code_value']) && !empty($_SESSION['securimage_code_value'])) {
1201 return strtolower($_SESSION['securimage_code_value']);
1202 } else {
1203 if ($this->sqlite_handle == false) $this->openDatabase();
1204
1205 return $this->getCodeFromDatabase(); // attempt to get from database, returns empty string if sqlite is not available or disabled
1206 }
1207 }
getCodeFromDatabase()
Get stored captcha code from sqlite database based on ip address hash.
openDatabase()
Open SQLite database.

References getCodeFromDatabase(), and openDatabase().

Referenced by getAudibleCode().

+ Here is the call graph for this function:

◆ getCodeFromDatabase()

Securimage::getCodeFromDatabase ( )

Get stored captcha code from sqlite database based on ip address hash.

@access private

Since
2.0.1
Returns
string captcha code

Definition at line 1460 of file securimage.php.

1461 {
1462 $code = '';
1463
1464 if ($this->use_sqlite_db && $this->sqlite_handle !== false) {
1465 $ip = $this->getIPHash();
1466
1467 $res = sqlite_query($this->sqlite_handle, "SELECT * FROM codes WHERE iphash = '$ip'");
1468 if ($res && sqlite_num_rows($res) > 0) {
1469 $res = sqlite_fetch_array($res);
1470
1471 if ($this->isCodeExpired($res['created']) == false) {
1472 $code = $res['code'];
1473 }
1474 }
1475 }
1476
1477 return $code;
1478 }
isCodeExpired($creation_time)
Check a code to see if it is expired based on creation time.

References $code, $res, getIPHash(), and isCodeExpired().

Referenced by getCode(), and validate().

+ Here is the call graph for this function:

◆ getIPHash()

Securimage::getIPHash ( )

Get hashed IP address of remote user.

@access private

Since
2.0.1
Returns
string

Definition at line 1398 of file securimage.php.

1399 {
1400 return strtolower(md5($_SERVER['REMOTE_ADDR']));
1401 }

Referenced by clearCodeFromDatabase(), getCodeFromDatabase(), and saveCodeToDatabase().

◆ isCodeExpired()

Securimage::isCodeExpired (   $creation_time)

Check a code to see if it is expired based on creation time.

@access private

Since
2.0.1
Parameters
$creation_timeunix timestamp of code creation time
Returns
bool true if code has expired, false if not

Definition at line 1519 of file securimage.php.

1520 {
1521 $expired = true;
1522
1523 if (!is_numeric($this->expiry_time) || $this->expiry_time < 1) {
1524 $expired = false;
1525 } else if (time() - $creation_time < $this->expiry_time) {
1526 $expired = false;
1527 }
1528
1529 return $expired;
1530 }

Referenced by getCodeFromDatabase(), and validate().

◆ openDatabase()

Securimage::openDatabase ( )

Open SQLite database.

@access private

Since
2.0.1
Returns
bool true if database was opened successfully

Definition at line 1410 of file securimage.php.

1411 {
1412 $this->sqlite_handle = false;
1413
1414 if ($this->use_sqlite_db && function_exists('sqlite_open')) {
1415 $this->sqlite_handle = sqlite_open($this->sqlite_database, 0666, $error);
1416
1417 if ($this->sqlite_handle !== false) {
1418 $res = sqlite_query($this->sqlite_handle, "PRAGMA table_info(codes)");
1419 if (sqlite_num_rows($res) == 0) {
1420 sqlite_query($this->sqlite_handle, "CREATE TABLE codes (iphash VARCHAR(32) PRIMARY KEY, code VARCHAR(32) NOT NULL, created INTEGER)");
1421 }
1422 }
1423
1424 return $this->sqlite_handle != false;
1425 }
1426
1427 return $this->sqlite_handle;
1428 }

References $error, $res, and $sqlite_handle.

Referenced by getCode(), saveCodeToDatabase(), and validate().

◆ output()

Securimage::output ( )

Output image to the browser.

@access private

Definition at line 1066 of file securimage.php.

1067 {
1068 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
1069 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
1070 header("Cache-Control: no-store, no-cache, must-revalidate");
1071 header("Cache-Control: post-check=0, pre-check=0", false);
1072 header("Pragma: no-cache");
1073
1074 switch($this->image_type)
1075 {
1076 case SI_IMAGE_JPEG:
1077 header("Content-Type: image/jpeg");
1078 imagejpeg($this->im, null, 90);
1079 break;
1080
1081 case SI_IMAGE_GIF:
1082 header("Content-Type: image/gif");
1083 imagegif($this->im);
1084 break;
1085
1086 default:
1087 header("Content-Type: image/png");
1088 imagepng($this->im);
1089 break;
1090 }
1091
1092 imagedestroy($this->im);
1093 exit;
1094 }
for($e=0; $e< count($afiche); $e++) exit

References exit, and image_type.

Referenced by doImage().

◆ outputAudioFile()

Securimage::outputAudioFile ( )

Output audio file with HTTP headers to browser.

$sound = new Securimage(); $sound->audio_format = 'mp3'; $sound->outputAudioFile();

Since
2.0

Definition at line 623 of file securimage.php.

624 {
625 if (strtolower($this->audio_format) == 'wav') {
626 header('Content-type: audio/x-wav');
627 $ext = 'wav';
628 } else {
629 header('Content-type: audio/mpeg'); // default to mp3
630 $ext = 'mp3';
631 }
632
633 header("Content-Disposition: attachment; filename=\"securimage_audio.{$ext}\"");
634 header('Cache-Control: no-store, no-cache, must-revalidate');
635 header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
636 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
637
638 $audio = $this->getAudibleCode($ext);
639
640 header('Content-Length: ' . strlen($audio));
641
642 echo $audio;
643 exit;
644 }
getAudibleCode($format='wav')
Get WAV or MP3 file data of the spoken code.

References $ext, audio_format, exit, and getAudibleCode().

+ Here is the call graph for this function:

◆ purgeOldCodesFromDatabase()

Securimage::purgeOldCodesFromDatabase ( )

Purge codes over a day old from database.

@access private

Since
2.0.1

Definition at line 1501 of file securimage.php.

1502 {
1503 if ($this->use_sqlite_db && $this->sqlite_handle !== false) {
1504 $now = time();
1505 $limit = (!is_numeric($this->expiry_time) || $this->expiry_time < 1) ? 86400 : $this->expiry_time;
1506
1507 sqlite_query($this->sqlite_handle, "DELETE FROM codes WHERE $now - created > $limit");
1508 }
1509 }

References $limit.

◆ readCodeFromFile()

Securimage::readCodeFromFile ( )

Reads a word list file to get a code.

@access private

Since
1.0.2
Returns
mixed false on failure, a word on success

Definition at line 1035 of file securimage.php.

1036 {
1037 $fp = @fopen($this->wordlist_file, 'rb');
1038 if (!$fp) return false;
1039
1040 $fsize = filesize($this->wordlist_file);
1041 if ($fsize < 32) return false; // too small of a list to be effective
1042
1043 if ($fsize < 128) {
1044 $max = $fsize; // still pretty small but changes the range of seeking
1045 } else {
1046 $max = 128;
1047 }
1048
1049 fseek($fp, rand(0, $fsize - $max), SEEK_SET);
1050 $data = fread($fp, 128); // read a random 128 bytes from file
1051 fclose($fp);
1052 $data = preg_replace("/\r?\n/", "\n", $data);
1053
1054 $start = strpos($data, "\n", rand(0, 100)) + 1; // random start position
1055 $end = strpos($data, "\n", $start); // find end of word
1056
1057 return strtolower(substr($data, $start, $end - $start)); // return substring in 128 bytes
1058 }

References $data, $end, $max, and $start.

Referenced by createCode().

◆ saveCodeToDatabase()

Securimage::saveCodeToDatabase ( )

Save captcha code to sqlite database.

@access private

Since
2.0.1
Returns
bool true if code was saved, false if not

Definition at line 1437 of file securimage.php.

1438 {
1439 $success = false;
1440
1441 $this->openDatabase();
1442
1443 if ($this->use_sqlite_db && $this->sqlite_handle !== false) {
1444 $ip = $this->getIPHash();
1445 $time = time();
1446 $code = $_SESSION['securimage_code_value']; // hash code for security - if cookies are disabled the session still exists at this point
1447 $success = sqlite_query($this->sqlite_handle, "INSERT OR REPLACE INTO codes(iphash, code, created) VALUES('$ip', '$code', $time)");
1448 }
1449
1450 return $success !== false;
1451 }

References $code, getIPHash(), and openDatabase().

Referenced by saveData().

+ Here is the call graph for this function:

◆ saveData()

Securimage::saveData ( )

Save the code in the session.

@access private

Definition at line 1147 of file securimage.php.

1148 {
1149 $_SESSION['securimage_code_value'] = strtolower($this->code);
1150 $_SESSION['securimage_code_ctime'] = time();
1151
1152 $this->saveCodeToDatabase();
1153 }
saveCodeToDatabase()
Save captcha code to sqlite database.

References saveCodeToDatabase().

Referenced by createCode().

+ Here is the call graph for this function:

◆ scrambleAudioData()

Securimage::scrambleAudioData ( $data,
  $format 
)

Randomly modify the audio data to scramble sound and prevent binary recognition.


Take care not to "break" the audio file by leaving the header data intact.

Since
2.0 @access private
Parameters
$dataSound data in mp3 of wav format

Definition at line 1309 of file securimage.php.

1310 {
1311 if ($format == 'wav') {
1312 $start = strpos($data, 'data') + 4; // look for "data" indicator
1313 if ($start === false) $start = 44; // if not found assume 44 byte header
1314 } else { // mp3
1315 $start = 4; // 4 byte (32 bit) frame header
1316 }
1317
1318 $start += rand(1, 64); // randomize starting offset
1319 $datalen = strlen($data) - $start - 256; // leave last 256 bytes unchanged
1320
1321 for ($i = $start; $i < $datalen; $i += 64) {
1322 $ch = ord($data[$i]);
1323 if ($ch < 9 || $ch > 119) continue;
1324
1325 $data[$i] = chr($ch + rand(-8, 8));
1326 }
1327 }

References $data, $i, and $start.

Referenced by generateMP3(), and generateWAV().

◆ setAudioPath()

Securimage::setAudioPath (   $audio_directory)

Set the path to the audio directory.


Since
1.0.4
Returns
bool true if the directory exists and is readble, false if not

Definition at line 1131 of file securimage.php.

1132 {
1133 if (is_dir($audio_directory) && is_readable($audio_directory)) {
1134 $this->audio_path = $audio_directory;
1135 return true;
1136 } else {
1137 return false;
1138 }
1139 }

◆ setBackground()

Securimage::setBackground ( )

Set the background of the CAPTCHA image.

@access private

Definition at line 746 of file securimage.php.

747 {
748 imagefilledrectangle($this->im, 0, 0, $this->image_width * $this->iscale, $this->image_height * $this->iscale, $this->gdbgcolor);
749 imagefilledrectangle($this->tmpimg, 0, 0, $this->image_width * $this->iscale, $this->image_height * $this->iscale, $this->gdbgcolor);
750
751 if ($this->bgimg == '') {
752 if ($this->background_directory != null && is_dir($this->background_directory) && is_readable($this->background_directory)) {
754 if ($img != false) {
755 $this->bgimg = $img;
756 }
757 }
758 }
759
760 $dat = @getimagesize($this->bgimg);
761 if($dat == false) {
762 return;
763 }
764
765 switch($dat[2]) {
766 case 1: $newim = @imagecreatefromgif($this->bgimg); break;
767 case 2: $newim = @imagecreatefromjpeg($this->bgimg); break;
768 case 3: $newim = @imagecreatefrompng($this->bgimg); break;
769 case 15: $newim = @imagecreatefromwbmp($this->bgimg); break;
770 case 16: $newim = @imagecreatefromxbm($this->bgimg); break;
771 default: return;
772 }
773
774 if(!$newim) return;
775
776 imagecopyresized($this->im, $newim, 0, 0, 0, 0, $this->image_width, $this->image_height, imagesx($newim), imagesy($newim));
777 }
getBackgroundFromDirectory()
Return the full path to a random gif, jpg, or png from the background directory.
Definition: securimage.php:786
$img

References $img, background_directory, bgimg, getBackgroundFromDirectory(), image_height, and image_width.

Referenced by doImage().

+ Here is the call graph for this function:

◆ show()

Securimage::show (   $background_image = "")

Generate a code and output the image to the browser.

<?php include 'securimage.php'; $securimage = new Securimage(); $securimage->show('bg.jpg'); ?>

Parameters
string$background_imageThe path to an image to use as the background for the CAPTCHA

Definition at line 582 of file securimage.php.

583 {
584 if($background_image != "" && is_readable($background_image)) {
585 $this->bgimg = $background_image;
586 }
587
588 $this->doImage();
589 }
doImage()
Generate and output the image.
Definition: securimage.php:652

References bgimg, and doImage().

+ Here is the call graph for this function:

◆ validate()

Securimage::validate ( )

Validate the code to the user code.

@access private

Definition at line 1161 of file securimage.php.

1162 {
1163 $code='';
1164 // retrieve code from session, if no code exists check sqlite database if supported.
1165
1166 if (isset($_SESSION['securimage_code_value']) && trim($_SESSION['securimage_code_value']) != '') {
1167 if ($this->isCodeExpired($_SESSION['securimage_code_ctime']) == false) {
1168 $code = $_SESSION['securimage_code_value'];
1169 }
1170 } else if ($this->use_sqlite_db == true && function_exists('sqlite_open')) { // no code in session - may mean user has cookies turned off
1171 $this->openDatabase();
1172 $code = $this->getCodeFromDatabase();
1173 } else {
1174 // session code invalid or non-existant and code not found in sqlite db or sqlite is not available
1175 $code = '';
1176 }
1177
1178 $code = trim(strtolower($code));
1179 $code_entered = trim(strtolower($this->code_entered));
1180 $this->correct_code = false;
1181
1182 if ($code != '') {
1183 if ($code == $code_entered) {
1184 $this->correct_code = true;
1185 $_SESSION['securimage_code_value'] = '';
1186 $_SESSION['securimage_code_ctime'] = '';
1187 $this->clearCodeFromDatabase();
1188 }
1189 }
1190 }
clearCodeFromDatabase()
Delete a code from the database by ip address hash.

References $code, $code_entered, clearCodeFromDatabase(), getCodeFromDatabase(), isCodeExpired(), and openDatabase().

Referenced by check().

+ Here is the call graph for this function:

Field Documentation

◆ $audio_format

Securimage::$audio_format

Definition at line 348 of file securimage.php.

◆ $audio_path

Securimage::$audio_path

Definition at line 341 of file securimage.php.

◆ $background_directory

Securimage::$background_directory = null

Definition at line 248 of file securimage.php.

◆ $bgimg

Securimage::$bgimg

Definition at line 420 of file securimage.php.

◆ $charset

Securimage::$charset

Definition at line 145 of file securimage.php.

◆ $code

Securimage::$code

◆ $code_entered

Securimage::$code_entered

Definition at line 436 of file securimage.php.

Referenced by validate().

◆ $code_length

Securimage::$code_length

Definition at line 136 of file securimage.php.

◆ $correct_code

Securimage::$correct_code

Definition at line 444 of file securimage.php.

Referenced by check(), and checkCode().

◆ $draw_lines_over_text

Securimage::$draw_lines_over_text

Definition at line 316 of file securimage.php.

◆ $expiry_time

Securimage::$expiry_time

Definition at line 366 of file securimage.php.

◆ $gd_font_file

Securimage::$gd_font_file

Definition at line 169 of file securimage.php.

Referenced by drawWord().

◆ $gd_font_size

Securimage::$gd_font_size

Definition at line 178 of file securimage.php.

◆ $gdbgcolor

Securimage::$gdbgcolor

Definition at line 492 of file securimage.php.

◆ $gdlinecolor

Securimage::$gdlinecolor

Definition at line 460 of file securimage.php.

◆ $gdmulticolor

Securimage::$gdmulticolor

Definition at line 468 of file securimage.php.

◆ $gdsignaturecolor

Securimage::$gdsignaturecolor

Definition at line 484 of file securimage.php.

◆ $gdtextcolor

Securimage::$gdtextcolor

Definition at line 476 of file securimage.php.

Referenced by drawWord().

◆ $im

Securimage::$im

Definition at line 395 of file securimage.php.

◆ $image_bg_color

Securimage::$image_bg_color

Definition at line 237 of file securimage.php.

◆ $image_height

Securimage::$image_height

Definition at line 121 of file securimage.php.

Referenced by distortedCopy().

◆ $image_signature

Securimage::$image_signature

Definition at line 324 of file securimage.php.

◆ $image_type

Securimage::$image_type

Definition at line 129 of file securimage.php.

◆ $image_width

Securimage::$image_width

Definition at line 114 of file securimage.php.

Referenced by distortedCopy(), and drawLines().

◆ $iscale

Securimage::$iscale

Definition at line 412 of file securimage.php.

Referenced by distortedCopy(), and drawWord().

◆ $line_color

Securimage::$line_color

Definition at line 308 of file securimage.php.

◆ $multi_text_color

Securimage::$multi_text_color

Definition at line 273 of file securimage.php.

◆ $num_lines

Securimage::$num_lines

Definition at line 301 of file securimage.php.

Referenced by drawLines().

◆ $perturbation

Securimage::$perturbation

Definition at line 202 of file securimage.php.

◆ $session_name

Securimage::$session_name = ''

Definition at line 357 of file securimage.php.

◆ $signature_color

Securimage::$signature_color

Definition at line 332 of file securimage.php.

◆ $sqlite_database

Securimage::$sqlite_database

Definition at line 377 of file securimage.php.

◆ $sqlite_handle

Securimage::$sqlite_handle

Definition at line 452 of file securimage.php.

Referenced by openDatabase().

◆ $text_angle_maximum

Securimage::$text_angle_maximum

Definition at line 221 of file securimage.php.

◆ $text_angle_minimum

Securimage::$text_angle_minimum

Definition at line 212 of file securimage.php.

◆ $text_color

Securimage::$text_color

Definition at line 258 of file securimage.php.

◆ $text_transparency_percentage

Securimage::$text_transparency_percentage

Definition at line 290 of file securimage.php.

◆ $text_x_start

Securimage::$text_x_start

Definition at line 230 of file securimage.php.

◆ $tmpimg

Securimage::$tmpimg

Definition at line 403 of file securimage.php.

◆ $ttf_file

Securimage::$ttf_file

Definition at line 194 of file securimage.php.

◆ $use_gd_font

Securimage::$use_gd_font

Definition at line 185 of file securimage.php.

◆ $use_multi_text

Securimage::$use_multi_text

Definition at line 266 of file securimage.php.

◆ $use_sqlite_db

Securimage::$use_sqlite_db

Use an SQLite database for storing codes as a backup to sessions.


Note: Sessions will still be used

Definition at line 383 of file securimage.php.

◆ $use_transparent_text

Securimage::$use_transparent_text

Definition at line 281 of file securimage.php.

◆ $use_wordlist

Securimage::$use_wordlist = false

Definition at line 159 of file securimage.php.

◆ $wordlist_file

Securimage::$wordlist_file

Definition at line 152 of file securimage.php.


The documentation for this class was generated from the following file: