cvs: peardoc /fr/package/text/text-captcha example.xml

From: Date: Mon, 18 Feb 2008 07:29:30 +0000
Subject: cvs: peardoc /fr/package/text/text-captcha example.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10499@lists.php.net to get a copy of this message
moosh Mon Feb 18 07:29:30 2008 UTC Modified files: /peardoc/fr/package/text/text-captcha example.xml Log: sync to en 1.5 - no change in translation, review syntax of example http://cvs.php.net/viewvc.cgi/peardoc/fr/package/text/text-captcha/example.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/fr/package/text/text-captcha/example.xml diff -u peardoc/fr/package/text/text-captcha/example.xml:1.2 peardoc/fr/package/text/text-captcha/example.xml:1.3 --- peardoc/fr/package/text/text-captcha/example.xml:1.2 Thu Jun 28 20:42:40 2007 +++ peardoc/fr/package/text/text-captcha/example.xml Mon Feb 18 07:29:30 2008 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> -<!-- $Id: example.xml,v 1.2 2007/06/28 20:42:40 moosh Exp $ --> -<!-- EN-Revision: 1.4 Maintainer: moosh Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- $Id: example.xml,v 1.3 2008/02/18 07:29:30 moosh Exp $ --> +<!-- EN-Revision: 1.5 Maintainer: moosh Status: ready --> <sect2 id="package.text.text-captcha.example"> <title>Exemple</title> @@ -25,18 +25,28 @@ require_once 'Text/CAPTCHA.php'; // Fixons les options du CAPTCHA (la fonte doit exister!) +$imageOptions = array( + 'font_size' => 24, + 'font_path' => './', + 'font_file' => 'COUR.TTF', + 'text_color' => '#DDFF99', + 'lines_color' => '#CCEEDD', + 'background_color' => '#555555' +); + $options = array( - 'font_size' => 24, - 'font_path' => './', - 'font_file' => 'COUR.TTF' + 'width' => 200, + 'height' => 80, + 'output' => 'png', + 'imageOptions' => $imageOptions ); // Générer un nouvel objet Text_CAPTCHA, pour le pilote Image $c = Text_CAPTCHA::factory('Image'); -$retval = $c->init(200, 80, null, $options); +$retval = $c->init($options); if (PEAR::isError($retval)) { - echo 'Erreur pendant la génération du CAPTCHA!'; - echo $retval->getMessage(); + printf ('Erreur pendant la génération du CAPTCHA: %s', + $retval->getMessage()); exit; } @@ -75,7 +85,7 @@ $msg = 'Veuillez introduire dans le champs ci dessous ' . 'le texte qui apparait dans l\'image!'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { - if (isset($_POST['phrase']) && isset($_SESSION['phrase']) && + if (isset($_POST['phrase']) && is_string($_POST['phrase']) && isset($_SESSION['phrase']) && strlen($_POST['phrase']) > 0 && strlen($_SESSION['phrase']) > 0 && $_POST['phrase'] == $_SESSION['phrase']) { $msg = 'OK!';

« previous php.pear.doc (#10499) next »