Re: Pear and Pear AUTH -
| From: | Sarah Gray | Date: | Wed, 06 Oct 2004 05:46:46 +0000 |
| Subject: | Re: Pear and Pear AUTH - | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14769@lists.php.net to get a copy of this message | ||
Is this perhaps that you don't have your password MD5-encrypted in your db?
This was an earlier post on the list and sounds like it might be your problem as
well.
Adapted from what Matthew wrote on August 31, 04 ( in the post: [PEAR] Re: it
cant authenticates!!!!!!!!!!!!!!!!!!!!!!!!MySQL):
"Is the password stored in the database as an MD5 of 12345? My guess is
that it isn't -- that you either stored it as plaintext or using MySQL's
password() or SHA() functions.
To make sure... execute the following in a MySQL client:
UPDATE auth SET password = MD5( '12345' ) WHERE username = 'fulano';
"
s.
Erico Henrique Guimaraes wrote:
> Dear Sirs,
>
> I have Apache 2.0.48 & PHP 5.0.0RC2 & MYSQL 4.0.13-nt. First, i would like
> to know if there´s any difference between PEAR 4X and PEAR 5x. Second, I
> want to reinstall PEAR in PHP5 and I kindly ask you a small 'cake recipe' to
> make it work and with little workarounds.
> And last but not the least, i copied and pasted the below code from
>
> http://pear.php.net/manual/en/package.authentication.auth.intro.php
> .
>
> <?php
> require_once ("Auth/Auth.php");
>
> function loginFunction()
> {
> echo "Welcome to this site ..."
> /**
> * Change the HTML output so that it fits to your
> * application.
> */
> echo "<b>Here you are<b></p>";
> echo "<form method=\"post\" action=\"" .
> $_SERVER['PHP_SELF'] . "\">";
> echo "<input type=\"text\" name=\"username\">";
> echo "<input type=\"password\" name=\"password\">"
> /*change to supply database name*/
> echo "<input type=\"text\" name=\"database">";
> echo "<input type=\"submit\">";
> echo "</form>";
> }
>
> /*username=fulano
> password=12345
> database = mysql
> */
>
> $dsn = "mysql://user:password@localhost/database";
>
> $a = new Auth("DB", $dsn, "loginFunction");
> print $a;
>
> $a->start();
>
> if ($a->checkAuth()) {
>
> echo "Login successfull!";
> /**
> * The output of your site goes here.
> */
> }
> ?>
>
>
> I supply my name (fulano) and password(12345) and database (mysql). The same
> ones I use under DOS to query Mysql succesfully. These assignments really
> work fine with another front-end, namely MySQL-Front .But the page always
> returns nothing. In this case it should display "Login Successfull" but just
> prompt on and on the screen again. I wonder what I fail to understand 'cause
> I read lists, manuals, docs but there´s something in $dsn =
> "mysql://user:password@localhost/database" or somwhere else I stil can see
> to make it work.
>
> best regards
>
> Érico