Ignore:
Timestamp:
Dec 18, 2005 12:16:03 AM (18 years ago)
Author:
scdev
Message:

detabbed all files ;P

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Captcha.inc.php

    r41 r42  
    1 <?php 
     1<?php
    22/**
    33 * Captcha.inc.php
     
    1010 */
    1111class Captcha {
    12    
     12
    1313    var $secret_key = 'some random seed text for the md5';
    1414    var $ascii_numbers = array(
     
    9595        )
    9696    );
    97    
     97
    9898    /**
    9999     * Print ASCII number.
     
    109109        if (preg_match('/[^\d]/', $num)) {
    110110            App::logMsg(sprintf('Bad number: %s', $num), LOG_ERR, __FILE__, __LINE__);
    111             return false;
     111            return false;
    112112        }
    113        
     113
    114114        // Number must be an array of strings.
    115115        $num = preg_split('// ', strval($num), -1, PREG_SPLIT_NO_EMPTY);
     
    124124            $output .= "\n";
    125125        }
    126        
     126
    127127        return $output;
    128128    }
    129    
     129
    130130    /**
    131131     * Prints a form to enter captcha, including the required hidden hash form.
     
    148148        <?php
    149149    }
    150    
    151     /**
    152      * Validate submitted number against ascii captcha. 
     150
     151    /**
     152     * Validate submitted number against ascii captcha.
    153153     * Regenerate md5 hash from submitted captcha number and compare with posted hash.
    154154     *
     
    164164
    165165        if ('' == $number . $hash) {
    166             return false;
     166            return false;
    167167        }
    168168
     
    182182        return rand(1000, 9999);
    183183    }
    184        
     184
    185185    /**
    186186     * Generate md5 hash of number using secret key.
     
    196196        return md5($this->secret_key . $input);
    197197    }
    198    
     198
    199199}
    200200
Note: See TracChangeset for help on using the changeset viewer.