Re: [PHPLIB] add_user_md5.php3 - problem or bug? From: Michael Bravo (mbravo <email protected>)
Date: 11/14/99

>>>>> "cain" == cain writes:

cain> [1 <text/plain; iso-8859-1 (quoted-printable)>] i was just trying out
cain> the ADD_USER_MD5.PHP3 to find out how to add users and i caught an
cain> javascript error, when i wanted to change the users permissions and i
cain> found out: the form input field for the permissions is set up as an
cain> array with
cain> <select multiple name="perms[]">
cain> but when changing the users permissions or on adding a new user the
cain> DB field perm in auth_user is filled with "Array" insted of the
cain> permission(s) because the script uses perm only as a scalar not as an
cain> array
cain> $query = "insert into auth_user_md5
cain> values('$u_id','$username','$password','$perms')";
cain> (see last parameter) is that a bug or am i doing something wrong? is
cain> there a fix or update, or is it that i have an old version

Actually, I'm not advanced enough to explain what happens, but I've fixed
this, and also several dangerous typos (?) which prevent new_user_md5.php3
from working correctly - namely, in several places SQL queries referred to
a field named 'uid' when the correct field name is user_id. I'm attaching a
patch which fixes the array error and also incorrect field names. Feel free
to incorporate it into current CVS (or should I do it myself?)

-- 
	/\/\ike

If you get to thinkin' you're a person of some influence, try orderin' somebody else's dog around.

- 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.