Re: Possible BC break in between Auth 1.3.0 and 1.3.1
| From: | Adam Ashley | Date: | Wed, 13 Sep 2006 01:31:35 +0000 |
| Subject: | Re: Possible BC break in between Auth 1.3.0 and 1.3.1 | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43935@lists.php.net to get a copy of this message | ||
On Tue, 12 Sep 2006 16:56:23 +0300, Mika Tuupola <tuupola@appelsiini.net> wrote:
On Sep 12, 2006, at 14:03, Mika Tuupola wrote:Okay I've looked closely at how $_SESSION['_authsession']['username'] is set and frankly I don't see how your code example worked all the way back to 1.2.0 (i couldnt be bothered looking further back). I'm unable to replicate it with the latest versions (1.3.2 and 1.4.0RC1). the username field is set in Auth::setAuth() upon successful completetion of the Auth::login() call. it is set when the session storage is first setup and then never touched after that. The username field is handled completely independant of the auth container in use. The setting of db_fields to * enables a hack that loads all fields from the database for the users record and attaches them to the Auth session. Sorry but I don't think I can help you. Adam AshleyJust noticed that one of my apps stopped working after upgrading Auth. I know I use it in an unorthodox way, but this might affect normal usage too. Will investigate further. Problem is that $_SESSION['_authsession']['username'] is now empty. If using 1.3.0 the username is there. $a->getUsername() also returns empty value.A Quick note. If I add $options['db_fields'] = '*'; then username will appear in $_SESSION['_authsession']['username'] Trying something like $options['db_fields'] = array('username') does not seem to work.Check this unorthodox example: -cut- $a = new Auth('DB', $dbha, 'displayLogin'); $a->start(); /* kludge, store password in the session so we can force *//* authentication without POST:ing */if ($_POST['password']) { $a->setAuthData('password', $_POST['password']); } $username = $_SESSION['_authsession']['username']; /*this is empty if using 1.3.1 or 1.3.2*/ $password = $_SESSION['_authsession']['data'][password]; $a->_loadStorage(); if (true !== $a->storage->fetchData($username, $password, false)) { $a->logout(); die(); } -cut-