Welcome to Geeklog, Anonymous Monday, April 29 2024 @ 12:30 pm EDT

Geeklog Forums

Forcing new users to include full name


Status: offline

gotroot801

Forum User
Junior
Registered: 04/26/02
Posts: 25
I'm setting up Geeklog v1.3.6 for my company's intranet, and my bosses would like to force users to include their full name when they sign up for a new account. How can I do this without depending on users to update their own profiles?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Well, that shouldn't be too hard. You need to add the full name field to the user registration form and make sure that people actually fill it in. Then, when they do that, just save the full name together with the email address and the username. The code you're looking for is in users.php bye, Dirk
 Quote

Status: offline

gotroot801

Forum User
Junior
Registered: 04/26/02
Posts: 25
OK - adding the Full Name field to registrationform.thtml was easy. I added the following after the E-mail field: <tr> <td align="right"><b>Full Name:</b><td> <td><input type="text" size="16" maxlength="96" name="fullname"></td> </tr> However, maybe due to a lack of PHP knowledge, I'm having a hard time getting GL to add fullname in the createuser function of users.php. I added $fullname to the function declaration on line 331, and on line 341, I made this change: DB_save($_TABLES['users'],'username,email,fullname,regdate',"'$username','$email','$fullname','$regdate'"Wink; ..but it doesn't add fullname to the user entry. In fact, it creates the user and sends out the password, but I get this error: Warning: Missing argument 3 for createuser() in /var/geeklog/public_html/users.php on line 331 I've got this feeling that I'm missing one piece...
 Quote

Status: offline

gotroot801

Forum User
Junior
Registered: 04/26/02
Posts: 25
...and I was right - I was missing something. Line 554 of users.php now reads: $display .= createuser($HTTP_POST_VARS['username'],$HTTP_POST_VARS['email'],$HTTP_POST_VARS['fullname']); I haven't figured out how to *force* fullname yet, but that's a minor issue at this point.
 Quote

Anonymous

Anonymous
I still can't get mine to work, this is the code snippets from user.php: ---------------------------------------------------------------------- DB_save($_TABLES['users'],'username,fullname,email,regdate',"'$username','$fullname','$email','$regdate'"Wink; --------------------------------------------------------------------- case 'create': $display .= createuser($HTTP_POST_VARS['username'],$HTTP_POST_VARS['email'],$HTTP_POST_VARS['fullname']); break; ----------------------------------------------------------------------- code snippets from registrationform.thtml: ----------------------------------------------------------------------- <tr> <td align="right"><b>{user_fullname}:</b></td> <td><input type="text" size="16" maxlength="16" name="fullname"></td> </tr>
 Quote

Anonymous

Anonymous
I followed your lead and got it so the registration form requested the "fullname" and createuser would set the fullname. I want to also capture the user's company name and job when they sign up. I figure the "about" field in the "userinfo" table should good for this. (Since this is just supposed to be useful info about the person anyway, and that's the info I think I need on this business-to-business site, it should be fine). So changed the language file so that LANG04[7] and LANG04[38] now say "Your job and company" and "Please enter information you want others to see about you". I've changed registrationform.thtml to include the "about" field as well as the fullname field. I've changed the createuser function to have the "about" field as an argument, but I don't know how to set the value in the database. I think it should be either DB_query or DB_save that does it, but I can't find where these are declared. I've tried both (guessing from other statements that update fields) but I can't get it to work. That is, with my modified setup, the new user registration page displays as I want it. If I fill in the "fullname" and the "about" fields and create the new user, I get a new user created. The "fullname" field is properly set, but the "about" field is still blank. Can someone tell me how, if I have a variable called $about that has the text for the field "about" to go in the table "userinfo" how do I set it? Thanks.
 Quote

All times are EDT. The time is now 12:30 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content