Changeset 253

Show
Ignore:
Timestamp:
05/27/07 17:22:26
Author:
danfreak
Message:

changed all referenced of "security_code" to "captcha" in config file and all other files

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • FreakAuth/trunk/www/system/application/config/freakauth_light.php

    r252 r253  
    139139 |------------------------------------------------------------------------------ 
    140140 */ 
    141  $config['FAL_use_security_code_login'] = TRUE; 
    142  $config['FAL_use_security_code_register'] = TRUE; 
    143  $config['FAL_use_security_code_forgot_password'] = TRUE; 
     141 $config['FAL_use_captcha_login'] = TRUE; 
     142 $config['FAL_use_captcha_register'] = TRUE; 
     143 $config['FAL_use_captcha_forgot_password'] = TRUE; 
    144144  
    145145 /* 
     
    192192|------------------------------------------------------------------------------- 
    193193*/ 
    194 $config['FAL_security_code_case_sensitive'] = TRUE; 
     194$config['FAL_captcha_case_sensitive'] = TRUE; 
    195195 
    196196/* 
     
    200200*/ 
    201201// upper and lower case (lower case by default) 
    202 $config['FAL_security_code_upper_lower_case'] = FALSE; 
    203 $config['FAL_security_code_use_numbers'] = FALSE; 
     202$config['FAL_captcha_upper_lower_case'] = FALSE; 
     203$config['FAL_captcha_use_numbers'] = FALSE; 
    204204 
    205205// use special characters (if true, use a font that support it) 
    206 $config['FAL_security_code_use_specials'] = FALSE; 
    207  
    208 $config['FAL_security_code_min'] = 5;      //min captcha length 
    209 $config['FAL_security_code_max'] = 5;      //max captcha length 
     206$config['FAL_captcha_use_specials'] = FALSE; 
     207 
     208$config['FAL_captcha_min'] = 5;      //min captcha length 
     209$config['FAL_captcha_max'] = 5;      //max captcha length 
    210210 
    211211/* 
     
    214214|------------------------------------------------------------------------------- 
    215215*/ 
    216 $config['FAL_security_code_image_font_size'] = 20; 
    217 $config['FAL_security_code_image_font_color'] = '33CC33'; 
     216$config['FAL_captcha_image_font_size'] = 20; 
     217$config['FAL_captcha_image_font_color'] = '33CC33'; 
    218218 
    219219/* 
     
    222222|------------------------------------------------------------------------------- 
    223223*/ 
    224 $config['FAL_security_image_library'] = 'GD2'; 
     224$config['FAL_captcha_image_library'] = 'GD2'; 
    225225 
    226226// Folder of the Base image needed to generate Captcha 
    227 $config['FAL_security_code_base_image_path'] = 'public/images/captcha/'; 
     227$config['FAL_captcha_base_image_path'] = 'public/images/captcha/'; 
    228228 
    229229// Base image name for captcha 
    230 $config['FAL_security_code_image_base_image'] = 'base_image.jpg'; 
     230$config['FAL_captcha_image_base_image'] = 'base_image.jpg'; 
    231231 
    232232// captcha font location 
    233 $config['FAL_security_code_image_font'] = BASEPATH.'fonts/Jester.ttf'; 
     233$config['FAL_captcha_image_font'] = BASEPATH.'fonts/Jester.ttf'; 
    234234 
    235235// Folder to save the captcha background image (relative BASEPATH) 
    236236// this folder must be writable by php 
    237 $config['FAL_security_code_image_path'] = 'tmp/'; 
     237$config['FAL_captcha_image_path'] = 'tmp/'; 
    238238 
    239239//name of the generate image (leave it blank!!!!!!) 
    240 $config['FAL_security_code_image'] = ''; 
     240$config['FAL_captcha_image'] = ''; 
    241241 
    242242/* 
     
    281281 
    282282 // SECURITTY CODE 
    283   $config['FAL_user_security_code_field_validation'] = 'trim|required|xss_clean|securitycode_check'; 
     283  $config['FAL_user_captcha_field_validation'] = 'trim|required|xss_clean|securitycode_check'; 
    284284 
    285285 // FORGOTTEN PASSWORD 
  • FreakAuth/trunk/www/system/application/libraries/FAL_front.php

    r246 r253  
    124124            
    125125            //do we want chaptcha for login? 
    126             if ($this->CI->config->item('FAL_use_security_code_login')) 
     126            if ($this->CI->config->item('FAL_use_captcha_login')) 
    127127            { 
    128128                $fields['security'] = $this->CI->lang->line('FAL_captcha_label'); 
    129                 $rules['security'] = $this->CI->config->item('FAL_user_security_code_field_validation'); 
     129                $rules['security'] = $this->CI->config->item('FAL_user_captcha_field_validation'); 
    130130            } 
    131131            
     
    174174            {    
    175175                
    176                 if ($this->CI->config->item('FAL_use_security_code_login')) 
     176                if ($this->CI->config->item('FAL_use_captcha_login')) 
    177177                {        
    178178                    $action='_login'; 
    179179                    $this->CI->freakauth_light->captcha_init($action); 
    180                     $data['captcha'] = $this->CI->config->item('FAL_security_code_image'); 
     180                    $data['captcha'] = $this->CI->config->item('FAL_captcha_image'); 
    181181                } 
    182182                
     
    250250        } 
    251251        //do we also want to secure the registration with CAPTCHA? 
    252         if ($this->CI->config->item('FAL_use_security_code_register')) 
     252        if ($this->CI->config->item('FAL_use_captcha_register')) 
    253253        { 
    254254            $fields['security'] = $this->CI->lang->line('FAL_captcha_label'); 
    255                 $rules['security'] = $this->CI->config->item('FAL_user_security_code_field_validation'); 
     255                $rules['security'] = $this->CI->config->item('FAL_user_captcha_field_validation'); 
    256256        } 
    257257        
     
    281281                } 
    282282                //if we want to secure the registration with CAPTCHA let's generate it 
    283                 if ($this->CI->config->item('FAL_use_security_code_register')) 
     283                if ($this->CI->config->item('FAL_use_captcha_register')) 
    284284                {        
    285285                        $action='_register'; 
    286286                    $this->CI->freakauth_light->captcha_init($action); 
    287                     $data['captcha'] = $this->CI->config->item('FAL_security_code_image'); 
     287                    $data['captcha'] = $this->CI->config->item('FAL_captcha_image'); 
    288288                } 
    289289                        
     
    366366         
    367367        //do we also want CAPTCHA? 
    368         if ($this->CI->config->item('FAL_use_security_code_forgot_password')) 
     368        if ($this->CI->config->item('FAL_use_captcha_forgot_password')) 
    369369        { 
    370370            $fields['security'] = $this->CI->lang->line('FAL_captcha_label'); 
    371             $rules['security'] = $this->CI->config->item('FAL_user_security_code_field_validation'); 
     371            $rules['security'] = $this->CI->config->item('FAL_user_captcha_field_validation'); 
    372372        } 
    373373        
     
    391391                 
    392392                //do we want captcha 
    393                 if ($this->CI->config->item('FAL_use_security_code_forgot_password')) 
     393                if ($this->CI->config->item('FAL_use_captcha_forgot_password')) 
    394394                { 
    395395                        $action='_forgot_password'; 
    396396                $this->CI->freakauth_light->captcha_init($action); 
    397                         $data['captcha'] = $this->CI->config->item('FAL_security_code_image'); 
     397                        $data['captcha'] = $this->CI->config->item('FAL_captcha_image'); 
    398398                } 
    399399            
  • FreakAuth/trunk/www/system/application/libraries/FAL_validation.php

    r239 r253  
    363363        function securitycode_check($value) 
    364364        { 
    365             if ($this->CI->config->item('FAL_use_security_code_register') OR $this->CI->config->item('FAL_use_security_code_login') OR $this->CI->config->item('FAL_use_security_code_forgot_password')) 
     365            if ($this->CI->config->item('FAL_use_captcha_register') OR $this->CI->config->item('FAL_use_captcha_login') OR $this->CI->config->item('FAL_use_captcha_forgot_password')) 
    366366            { 
    367367            //gets the security code stored in the db_session 
    368                 $securityCode = $this->CI->db_session->userdata('FreakAuth_security_code'); 
     368                $securityCode = $this->CI->db_session->userdata('FreakAuth_captcha'); 
    369369                         
    370370            // erase the code from the session to prevent it to be used a second time 
    371371            // see http://www.ciforge.com/trac/freakauth/ticket/20 
    372             $this->CI->db_session->unset_userdata('FreakAuth_security_code'); 
     372            $this->CI->db_session->unset_userdata('FreakAuth_captcha'); 
    373373                         
    374                 if ($this->CI->config->item('FAL_security_code_case_sensitive')==FALSE) 
     374                if ($this->CI->config->item('FAL_captcha_case_sensitive')==FALSE) 
    375375                { 
    376376                        $control= strcmp(strtolower($value), strtolower($securityCode)); 
  • FreakAuth/trunk/www/system/application/libraries/Freakauth_light.php

    r249 r253  
    903903    {    
    904904        //checks FreakAuth security code configuration 
    905         if (!$this->CI->config->item('FAL_use_security_code'.$action)) 
     905        if (!$this->CI->config->item('FAL_use_captcha'.$action)) 
    906906             
    907907                //if not set or FALSE 
     
    909909         
    910910        //ELSE unsets userdata from session table          
    911         $this->CI->db_session->unset_userdata('FreakAuth_security_code'); 
     911        $this->CI->db_session->unset_userdata('FreakAuth_captcha'); 
    912912         
    913913        //loads the captcha plugin 
     
    932932    function show_captcha() { 
    933933        $img_html = '<span class="note">'; 
    934         $img_html.= '<img src="'.base_url().$this->CI->config->item('FAL_security_code_image_path').$this->CI->config->item('FAL_security_code_image').'" alt="" />'; 
     934        $img_html.= '<img src="'.base_url().$this->CI->config->item('FAL_captcha_image_path').$this->CI->config->item('FAL_captcha_image').'" alt="" />'; 
    935935        $img_html.= '</span>'; 
    936936        return $img_html; 
     
    954954        $expiration=60*10; //10 min 
    955955                         
    956                 $current_dir = @opendir($this->CI->config->item('FAL_security_code_image_path')); 
     956                $current_dir = @opendir($this->CI->config->item('FAL_captcha_image_path')); 
    957957                 
    958958                while($filename = @readdir($current_dir)) 
     
    964964                                if (($name + $expiration) < $now) 
    965965                                { 
    966                                         @unlink($this->CI->config->item('FAL_security_code_image_path').$filename); 
     966                                        @unlink($this->CI->config->item('FAL_captcha_image_path').$filename); 
    967967                                } 
    968968                        } 
     
    982982    { 
    983983         
    984             $securityCode = $this->_generateRandomString($this->CI->config->item('FAL_security_code_min'), $this->CI->config->item('FAL_security_code_max')); 
     984            $securityCode = $this->_generateRandomString($this->CI->config->item('FAL_captcha_min'), $this->CI->config->item('FAL_captcha_max')); 
    985985                        //$image = 'security-'.$this->_generateRandomString(16, 32).'.jpg'; 
    986986                        $image = $now.'.jpg'; 
    987             $this->CI->config->set_item('FAL_security_code_image', $image); 
    988              
    989             $config['image_library'] = $this->CI->config->item('FAL_security_image_library'); 
    990             $config['source_image'] = $this->CI->config->item('FAL_security_code_base_image_path').$this->CI->config->item('FAL_security_code_image_base_image'); 
    991             $config['new_image'] = $this->CI->config->item('FAL_security_code_image_path').$image; 
     987            $this->CI->config->set_item('FAL_captcha_image', $image); 
     988             
     989            $config['image_library'] = $this->CI->config->item('FAL_captcha_image_library'); 
     990            $config['source_image'] = $this->CI->config->item('FAL_captcha_base_image_path').$this->CI->config->item('FAL_captcha_image_base_image'); 
     991            $config['new_image'] = $this->CI->config->item('FAL_captcha_image_path').$image; 
    992992            $config['wm_text'] = $securityCode; 
    993993            $config['wm_type'] = 'text'; 
    994             $config['wm_font_path'] = $this->CI->config->item('FAL_security_code_image_font'); 
    995             $config['wm_font_size'] = $this->CI->config->item('FAL_security_code_image_font_size'); 
    996             $config['wm_font_color'] = $this->CI->config->item('FAL_security_code_image_font_color'); 
     994            $config['wm_font_path'] = $this->CI->config->item('FAL_captcha_image_font'); 
     995            $config['wm_font_size'] = $this->CI->config->item('FAL_captcha_image_font_size'); 
     996            $config['wm_font_color'] = $this->CI->config->item('FAL_captcha_image_font_color'); 
    997997            $config['wm_vrt_alignment'] = 'top'; 
    998998                        $config['wm_hor_alignment'] = 'left'; 
     
    10081008                        }; 
    10091009                         
    1010             $this->CI->db_session->set_userdata('FreakAuth_security_code', $securityCode);                     
    1011             return $this->CI->config->item('FAL_security_code_image'); 
     1010            $this->CI->db_session->set_userdata('FreakAuth_captcha', $securityCode);                   
     1011            return $this->CI->config->item('FAL_captcha_image'); 
    10121012             
    10131013         
     
    10291029    { 
    10301030        $charset = "abcdefghijklmnopqrstuvwxyz"; 
    1031         if ($this->CI->config->item('FAL_security_code_upper_lower_case')) 
     1031        if ($this->CI->config->item('FAL_captcha_upper_lower_case')) 
    10321032            $charset .= "ABCDEFGHIJKLMNPQRSTUVWXYZ"; 
    1033         if ($this->CI->config->item('FAL_security_code_use_numbers')) 
     1033        if ($this->CI->config->item('FAL_captcha_use_numbers')) 
    10341034            $charset .= "23456789"; 
    1035                 if ($this->CI->config->item('FAL_security_code_use_specials')) 
     1035                if ($this->CI->config->item('FAL_captcha_use_specials')) 
    10361036            $charset .= "~@#$%^*()_+-={}|]["; 
    10371037             
    1038         $length = mt_rand($this->CI->config->item('FAL_security_code_min'), $this->CI->config->item('FAL_security_code_max')); 
    1039         if ($this->CI->config->item('FAL_security_code_min') > $this->CI->config->item('FAL_security_code_max')) 
    1040             $length = mt_rand($this->CI->config->item('FAL_security_code_max'), $this->CI->config->item('FAL_security_code_min')); 
     1038        $length = mt_rand($this->CI->config->item('FAL_captcha_min'), $this->CI->config->item('FAL_captcha_max')); 
     1039        if ($this->CI->config->item('FAL_captcha_min') > $this->CI->config->item('FAL_captcha_max')) 
     1040            $length = mt_rand($this->CI->config->item('FAL_captcha_max'), $this->CI->config->item('FAL_captcha_min')); 
    10411041 
    10421042        $key = ''; 
  • FreakAuth/trunk/www/system/application/views/FreakAuth_light/content/forgotten_password.php

    r213 r253  
    1111    <!--CAPTCHA (security image)--> 
    1212        <?php 
    13         if ($this->config->item('FAL_use_security_code_forgot_password')) 
     13        if ($this->config->item('FAL_use_captcha_forgot_password')) 
    1414        {?> 
    1515        <p><label for="security"><?=$this->lang->line('FAL_captcha_label')?>:</label> 
  • FreakAuth/trunk/www/system/application/views/FreakAuth_light/content/login.php

    r213 r253  
    2323    <!--CAPTCHA (security image)--> 
    2424        <?php 
    25         if ($this->config->item('FAL_use_security_code_login')) 
     25        if ($this->config->item('FAL_use_captcha_login')) 
    2626        {?> 
    2727        <p><label for="security"><?=$this->lang->line('FAL_captcha_label')?>:</label> 
  • FreakAuth/trunk/www/system/application/views/FreakAuth_light/content/register.php

    r213 r253  
    4141    <!--CAPTCHA (security image)--> 
    4242        <?php 
    43         if ($this->config->item('FAL_use_security_code_register')) 
     43        if ($this->config->item('FAL_use_captcha_register')) 
    4444        {?> 
    4545        <p><label for="security"><?=$this->lang->line('FAL_captcha_label')?>:</label>