1
codyf
Making real name required in 2.2.2
  • 2005/8/23 9:11

  • codyf

  • Just popping in

  • Posts: 24

  • Since: 2005/5/6 4


Has anyone figured out how to make the real name field required in the registration form of 2.2.2 I used the hack in the faq for 2.0.10 but it dosn't work. It looks like it could be adapted but I am not skilled in the ways of php.

2
codyf
Re: Making real name required in 2.2.2
  • 2005/8/24 11:28

  • codyf

  • Just popping in

  • Posts: 24

  • Since: 2005/5/6 4


Ok, I figured it out and thought i'd share the wealth.

I'm sure there's a better way of going about this but this is how I got it to work.

So here it is:

modules/profiles/include/form.php

Below:

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_DISPLAYNAME"uname"$uname_size75

$user->getVar('uname''e')), 'required' => true);
    
$weights[0][] = 0;


Add:

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_REALNAME"name"$name_size75$user->getVar('name'

'e')), 'required' => true);
    
$weights[0][] = 0;


modules/profiles/register.php

Below:

$newuser->setVar('uname', isset($_POST['uname']) ? trim($_POST['uname']) : '');


Add:

$newuser->setVar('name', isset($_POST['name']) ? trim($_POST['name']) : '');


Below:

echo _PROFILE_MA_DISPLAYNAME.": ".$newuser->getVar('uname')."<br />";


Add:

echo _PROFILE_MA_REALNAME.": ".$newuser->getVar('name')."<br />";


That's it.

3
gary711
Re: Making real name required in 2.2.2
  • 2005/9/2 20:02

  • gary711

  • Just popping in

  • Posts: 13

  • Since: 2004/8/3 6


it shows the following notice

Notice [PHP]: Undefined variable: name_size in file modules/profile/include/forms.php line 241

4
codyf
Re: Making real name required in 2.2.2
  • 2005/9/3 3:56

  • codyf

  • Just popping in

  • Posts: 24

  • Since: 2005/5/6 4


I just noticed that. It gives the php notice but it will work and save the name to the db. If anyone knows what there doing more than I we could use some help. I tryed adding:

$name_size = $xoopsModuleConfig['max_name'] < 35 ? $xoopsModuleConfig['max_name'] :
35;

But then debug said undefined max_name. Where do I define max_name or am I going about this wrong?

5
mactoeknee
Re: Making real name required in 2.2.2
  • 2005/10/29 22:17

  • mactoeknee

  • Just popping in

  • Posts: 75

  • Since: 2005/2/26


I wonder what ever happened with this-- Is real name part of the registration process in 2.2? The sites I have in 2.0.9 worked with the realname hack like yours, but when I updated them to 2.0.10 Beta 3, the realname was still part of the registration process but then did not get sent with the registration e-mail or put in the database. I haven't had time to track it down, and I am scared what 2.0.13 will do to my sites.

I am hoping 2.2 brings real name entry as required without any hack. My sites need that security before I can approve the registrations.

Login

Username:
Password:

Lost Password? Register now!

Who's Online

79 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 79


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits