[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/data/captcha/ -> captcha.class.php (sommaire)

default expiration time for old images, 1h

Poids: 165 lignes (5 kb)
Inclus ou requis:0 fois
Référencé: 3 fois
Nécessite: 0 fichiers

Définit 1 class

Captcha:: (6 méthodes):
  Captcha()
  encrypt()
  generateCode()
  generate()
  validate()
  purgeOld()


Classe: Captcha  - X-Ref

\ingroup Data

Class to generate CAPTCHA images, based on Mark Wu's AuthImage plugin. Requires support
for GD built-in.

Usage:
<pre>
$auth = new Captcha();
$auth->generate();
...
if( $auth->validate( $_POST["authImage"] )) {
// validation ok!
}
else {
// error in validation!
}
</pre>
Captcha()   X-Ref
Constructor. It takes no parameter but there are several public attributes that
can be set after the constructor has been called:

- key
- cacheFolder
- expiredTime
- length

encrypt($string, $key)   X-Ref


generateCode()   X-Ref


generate()   X-Ref
generates a new image and returns the url

return: a url to the captcha image

validate( $code )   X-Ref
checks whether the given code validates with any of the authimages
previously generated

param: code The code
return: True if the code is valid or false otherwise

purgeOld( $expireTime = CAPTCHA_DEFAULT_EXPIRATION_TIME )   X-Ref
Removes the old captcha images that are not needed anymre
Ê@private




Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics