Re: bug in Auth (?)
| From: | Jeroen Houben | Date: | Fri, 11 Apr 2003 14:05:44 +0000 |
| Subject: | Re: bug in Auth (?) | ||
| References: | 1 | Groups: | php.pear.dev php.pear.general |
| Request: | Send a blank email to pear-general+get-4799@lists.php.net to get a copy of this message | ||
Hans Westerbeek wrote:
Hi Jeroen, Are you sure you haven't created the username column in postgres as one with a fixed char length? In that case postgres may be padding your usernames with whitespaces... Yes they are created as chars, but that never was a problem in MySql where they were also chars. I could just convert them into varchars I suppose, that would fix the problem, but I thought char columns were faster to search on.Thanks, Jeroen
Anyway, the question why postgres is giving you strings with whitespace is probably the most important one.. Hans On Fri, 11 Apr 2003, Jeroen Houben wrote:Hi Martin, I'm switching from MySql to PostgreSQL and PEAR::Auth keeps throwing "wrong username and password" at me. After some investigation I found out that postgres returns extra spaces in char fields, the results aren't trimmed. I changed the source for Container/DB.php on line 217 like this:if (is_array($entry)) { if ($this->verifyPassword(trim($password),trim($entry[$this->options['passwordcol']]),$this->options['cryptType'])) { $res->free();That works. Can you apply this patch, or should I (as the user) just make sure my database returns trimmed results? TIA Jeroen btw is something wrong at php.net, I don't seem to be receiving any mail on the PEAR mailinglists.. -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php