Re: Re: auth 1.3.0r1 release
| From: | Paul M Jones | Date: | Tue, 29 Jun 2004 17:41:48 +0000 |
| Subject: | Re: Re: auth 1.3.0r1 release | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31342@lists.php.net to get a copy of this message | ||
On Jun 29, 2004, at 12:00 PM, Lukas Smith wrote:
Paul M Jones wrote:To illuminate the situation, let me describe the behavior that the 1.3.0 release breaks. This is paraphrased from the Yawp 0.14 code, which uses the stable Auth 1.2.3 release. // instantiate the object $Yawp->Auth =& new Auth($container, $params, null, false); if (isset($_POST['LOGIN'])) { // start an authenticated session; this will // automatically check credentials ($_POST['username'] // && $_POST['password']) if they were passed. $Yawp->Auth->start(); // was the login successful? if ($Yawp->Auth->checkAuth()) { // ... do successful-login stuff } else { // ... do failed-login stuff } } Under Auth 1.3.0, this breaks; it does not process the login because showLogin is set to false. If we set showLogin to true, Auth will shows a login form, which (in this case) we want the template system to handle, not Auth itself. If I change $Yawp->auth->start() to... $Yawp->Auth->start(); $Yawp->Auth->login(); ... then I get an AUTH_WRONG_LOGIN even when the credentials are correct. Other users (ahundiak, raz) have suggested using two sequential checkAuth() calls ... $Yawp->Auth->start(); // fix for 1.3.0 starts if (! $Yawp->Auth->checkAuth()) { $Yawp->Auth->login(); } // fix for 1.3.0 ends // was the login successful? if ($Yawp->Auth->checkAuth()) { // ... do successful-login stuff } else { // ... do failed-login stuff } ... does not seem to work either. Suggestions? Comments? -- Paul M. Jones Savant: the simple alternative to Smarty for PHP. http://phpsavant.com/ DB_Table: build RDBMS tables and XHTML forms in one PHP class. http://wiki.ciaweb.net/yawiki/index.php?area=DB_Table Yawiki: a collaborative online documentation system. http://wiki.ciaweb.net/yawiki/index.php?area=Yawiki Yawp: a single-file foundation for PHP applications. http://phpyawp.com/On Jun 29, 2004, at 11:53 AM, Mark Wiesemann wrote:Sounds like a BC break unless the documentation clearly states that the old behaviour was unsupported.Lukas Smith wrote:Is this not a BC break, then? I thought the idea was that running code should continue to run.just wanted to quickly note that it seems that yawiki seems to stop working once I upgraded to 1.3.0r1 but it works fine with 1.2.3Probably this is the same problem as in http://pear.php.net/bugs/bug.php?id=1691 Calling login() after start() solved the problem.