Date: 03/29/00
- Next message: Florian Dittmer: "[PHPLIB] Is there a function to authentificate?"
- Previous message: Jesús Vega: "[PHPLIB] Problem with GET, POST"
- In reply to: simon.thackeray <email protected>: "[PHPLIB] pages/admin/new_user_md5.php3"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 07:59 PM 3/29/2000 +0100, you wrote:
>Hi all.
>
>I am quite new to PHPLIB an I have a problem with the example called
>new_user_md5.php3.
>I can call it and create new users. But when I query the mysql database I
>notice
>that it gives a permission named "Array" to the newly added user.
>Is there somewhere a syntax error?
>I am using the Example session classes.
>The new_user.php3 (using the auth_user table works fine!)
>
>Many thanks
>
>Simon
I noticed that, too. There are coding errors in the MD5 stuff. Before I
subscribed to this list, I sent email to the developers with my fix but,
never heard anything back. Here's a copy of that message. These should
probably be dif files but ...
Andrew
>Date: Mon, 06 Mar 2000 01:54:36 -0700
>To: be <email protected>, kk <email protected>, sascha <email protected>
>From: Andrew Crawford <Andrew <email protected>>
>Subject: Error in new_user_md5.php3
>
>Greetings,
>
>Thank you for PHPLIB. It is a great tool.
>
>In case this hasn't already been brought to your attention, there appear
>to be a few small errors in new_user_md5.php3. One of them causes it to
>set the permissions of users to "Array" ($perm) rather than the actual
>permissions ($permlist.) The other problem is that the user id column
>name for the auth_user_md5 table is "user_id" rather than "u_id." I
>modeled a solution on the code in new_user.php3. Here are the corrected
>sections of new_user_md5.php3:
>
> ## Create a uid and insert the user...
> $permlist = addslashes(implode($perms,","));
> $u_id=md5(uniqid($hash_secret));
> $query = "insert into auth_user_md5
> values('$u_id','$username','$password',\
>'$permlist')";
> $db->query($query);
> if ($db->affected_rows() == 0) {
> my_error("<b>Failed:</b> $query");
> break;
> }
>
> my_msg("User \"$username\" created.<BR>");
> break;
>
>....
>
> ## Update user information.
> $permlist = addslashes(implode($perms,","));
> $query = "update auth_user_md5 set username='$username',
> password='$passwor\
>d', perms='$permlist' where user_id='$u_id'";
> $db->query($query);
> if ($db->affected_rows() == 0) {
> my_error("<b>Failed:</b> $query");
> break;
> }
>
> my_msg("User \"$username\" changed.<BR>");
> break;
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.
- Next message: Florian Dittmer: "[PHPLIB] Is there a function to authentificate?"
- Previous message: Jesús Vega: "[PHPLIB] Problem with GET, POST"
- In reply to: simon.thackeray <email protected>: "[PHPLIB] pages/admin/new_user_md5.php3"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

