Show
Ignore:
Timestamp:
07/10/2008 11:06:23 AM (5 months ago)
Author:
Geert
Message:

A few minor tweaks to Basic and Alpha Captcha style in order to preserve enough readability and make both styles differ a bit more.

Also changed internal terminology to the "official" convention: http://en.wikipedia.org/wiki/Challenge-response_authentication

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Captcha.php

    r3027 r3031  
    2727 
    2828        // The Captcha challenge answer, the text the user is supposed to enter 
    29         public static $answer; 
     29        public static $response; 
    3030 
    3131        /** 
     
    121121 
    122122                // Generate a new Captcha challenge 
    123                 self::$answer = (string) $this->driver->generate_challenge(); 
     123                self::$response = (string) $this->driver->generate_challenge(); 
    124124 
    125125                // Store the answer in a session 
    126                 Session::instance()->set('captcha_answer', self::$answer); 
     126                Session::instance()->set('captcha_response', self::$response); 
    127127 
    128128                Log::add('debug', 'Captcha Library initialized'); 
     
    130130 
    131131        /** 
    132          * Validates a Captcha answer. 
     132         * Validates a Captcha response. 
    133133         * 
    134          * @param   string   captcha answer 
     134         * @param   string   captcha response 
    135135         * @return  boolean 
    136136         */ 
    137         public static function valid($answer) 
     137        public static function valid($response) 
    138138        { 
    139                 return (strtoupper($answer) === strtoupper(Session::instance()->get('captcha_answer'))); 
     139                return (strtoupper($response) === strtoupper(Session::instance()->get('captcha_response'))); 
    140140        } 
    141141