Changeset 3046

Show
Ignore:
Timestamp:
07/11/08 03:31:08 (1 month ago)
Author:
Geert
Message:

Symplifying Captcha background and font config settings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/system/config/captcha.php

    r3032 r3046  
    88 * 
    99 * Group Options: 
    10  *  style           - Captcha type, e.g. basic, alpha, word, math, riddle 
    11  *  width           - Width of the Captcha image 
    12  *  height          - Height of the Captcha image 
    13  *  complexity      - Difficulty level (0-10), usage depends on chosen style 
    14  *  background_path - Path to folder in which background image reside 
    15  *  background_file - Image file name 
    16  *  font_path       - Path to folder in which fonts reside 
    17  *  font_file       - Font file name 
     10 *  style      - Captcha type, e.g. basic, alpha, word, math, riddle 
     11 *  width      - Width of the Captcha image 
     12 *  height     - Height of the Captcha image 
     13 *  complexity - Difficulty level (0-10), usage depends on chosen style 
     14 *  background - Path to background image file 
     15 *  font       - Path to font file 
    1816 */ 
    1917$config['default'] = array 
    2018( 
    21         'style'           => 'basic', 
    22         'width'           => 150, 
    23         'height'          => 50, 
    24         'complexity'      => 4, 
    25         'background_path' => '', 
    26         'background_file' => '', 
    27         'font_path'       => SYSPATH.'fonts/', 
    28         'font_file'       => 'DejaVuSerif.ttf', 
     19        'style'      => 'basic', 
     20        'width'      => 150, 
     21        'height'     => 50, 
     22        'complexity' => 4, 
     23        'background' => '', 
     24        'font'       => SYSPATH.'fonts/DejaVuSerif.ttf', 
    2925); 
  • trunk/system/libraries/Captcha.php

    r3045 r3046  
    9494 
    9595                // If using a background image, check if it exists 
    96                 if ( ! empty($config['background_file'])) 
    97                 { 
    98                         self::$config['background'] = str_replace('\\', '/', realpath($config['background_path'])).'/'.$config['background_file']
     96                if ( ! empty($config['background'])) 
     97                { 
     98                        self::$config['background'] = str_replace('\\', '/', realpath($config['background']))
    9999 
    100100                        if ( ! file_exists(self::$config['background'])) 
     
    103103 
    104104                // If using a font, check if it exists 
    105                 if ( ! empty($config['font_file'])) 
    106                 { 
    107                         self::$config['font'] = str_replace('\\', '/', realpath($config['font_path'])).'/'.$config['font_file']
     105                if ( ! empty($config['font'])) 
     106                { 
     107                        self::$config['font'] = str_replace('\\', '/', realpath($config['font']))
    108108 
    109109                        if ( ! file_exists(self::$config['font']))