Re: Auth and QuickForm usage problem ?! [reminder]
| From: | Laurent Laville | Date: | Thu, 05 May 2005 07:19:31 +0000 |
| Subject: | Re: Auth and QuickForm usage problem ?! [reminder] | ||
| References: | 1 | Groups: | php.pear.dev php.pear.qa |
| Request: | Send a blank email to pear-dev+get-37496@lists.php.net to get a copy of this message | ||
Hi QA-team
As i've not yet received any anwsers to my question, i request
your help !
Perharps one of you may help me to understand what's wrong.
regards
Laurent Laville
Laurent Laville a écrit :
hi all, i'v try to used Auth-1.2.3 and QuickForm 3.2.4pl1 to generate login form, but i've a little problem with applying custom filter. It's not a QF usage problem: i know this package, but i don't think it's such easy to use (its filter feature) with Auth package. If i'm not wrong (please someone, tell me) the Auth::start() method run the Auth::assignData() that set POST data just before QF may validate the form (and apply filters). So it's to late, and data are assigned with no-filtered form datas Here are the most important code of my script: My platform: PHP 4.3.10, PEAR 1.3.4, Windows XP, Apache 1.3.3 Is someone may help me to understand if it's a wrong Auth package usage or if it's a bug ? Thanks in advance Laurent Laville <?php // my QF custom filter function filterSecure($values) {$values = trim($values); $values = strip_tags($values); return $values;} function loginFunction($username, $status, &$auth) {require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/Renderer/QuickHtml.php';$form = new HTML_QuickForm('dauth'); [....] $form->applyFilter('__ALL__', 'filterSecure'); [....]$renderer = new HTML_QuickForm_Renderer_QuickHtml(); $form->accept($renderer);$html_template = '................ the form template itself ...... ';echo $renderer->toHtml($html_template); $form->validate();} $storageDriver = 'File'; $options = 'passwd.file'; $loginFunction = 'loginFunction'; $a = new Auth($storageDriver, $options, $loginFunction); $a->start(); if ($a->checkAuth()) {echo 'welcome '.$a->getUsername();} ?>