Author Topic: Registration issue  (Read 7499 times)

doorknob

  • Jr. Member
  • **
  • Posts: 151
Registration issue
« on: September 23, 2008, 15:05:13 pm »
I have configured my system to use only the 'First Name' when registering. I don't need the full name because my site is 'catalogue only' with no shopping cart (BTW in the UK it is an offence against the Data Registration act to collect and store personal information that is not needed for business purposes).

Now when a user registers, the 'Last Name' field is omitted from the form (as expected) but when creating the 'name' field in the jos_name table, the value then defaults to 'Last Name'. In addition, there are a few functions where the full name is created on the fly and a null last name becomes a trailing space because of the way the first and last names are put together with an embedded space.

I have fixed this in my system with the following changes to classes/ps_shopper:

line 279:
Code: [Select]
$_POST['name'] = vmGet($d,'first_name','First Name' )." ".vmGet($d,'last_name','Last Name' );
changed to:
Code: [Select]
$_POST['name'] = trim( vmGet( $d, 'first_name', '' )." ".vmGet( $d, 'last_name', '' ) );

line 433/4:
Code: [Select]
$db->query( "INSERT INTO `#__ccnewsletter_subscribers` ( `name`, `email`, `plainText`, `enabled`, `sdate`)
VALUES('".$d['first_name']." ". $d['last_name']."','".$d['email']."', '0', '1', NOW())" );
changed to:
Code: [Select]
$name = trim( $d['first_name']." ". $d['last_name'] );
$db->query( "INSERT INTO `#__ccnewsletter_subscribers` ( `name`, `email`, `plainText`, `enabled`, `sdate`)
VALUES('$name','".$d['email']."', '0', '1', NOW())" );

line 439/40:
Code: [Select]
$db->query( "INSERT INTO `#__letterman_subscribers` (`user_id`, `subscriber_name`, `subscriber_email`, `confirmed`, `subscribe_date`)
VALUES('$uid','".$d['first_name']." ". $d['last_name']."','".$d['email']."', '1', NOW())");
changed to:
Code: [Select]
$name = trim( $d['first_name']." ". $d['last_name'] );
$db->query( "INSERT INTO `#__letterman_subscribers` (`user_id`, `subscriber_name`, `subscriber_email`, `confirmed`, `subscribe_date`)
VALUES('$uid','$name','".$d['email']."', '1', NOW())");

line 656:
Code: [Select]
$_POST['name'] = $d['first_name']." ". $d['last_name'];
replaced by:
Code: [Select]
$_POST['name'] = trim( $d['first_name']." ". $d['last_name'] );

regards
Phil

lucato

  • Jr. Member
  • **
  • Posts: 205
Re: Registration issue
« Reply #1 on: May 13, 2009, 15:54:59 pm »
It didn't work for VM 1.1.3. I'm getting the register e-mails, the name on the log-in with the 1st name+"last name" and I've disable the "last name" user field from the managment fields.

Does anybody have any idea how to get rid of it on 1.1.3?

Thanks.

wowderland

  • Beginner
  • *
  • Posts: 4
Re: Registration issue
« Reply #2 on: December 29, 2009, 12:47:08 pm »
Im having the same issue. Anybody have a suggestion on this ?

doorknob

  • Jr. Member
  • **
  • Posts: 151
Re: Registration issue
« Reply #3 on: December 29, 2009, 14:53:24 pm »
This patch is still working for me (v1.1.4)

wowderland

  • Beginner
  • *
  • Posts: 4
Re: Registration issue
« Reply #4 on: December 30, 2009, 00:28:36 am »
Hello. I've done it again today and it worked perfectly. Thanks a lot !!!

Destini

  • Beginner
  • *
  • Posts: 3
Re: Registration issue
« Reply #5 on: December 30, 2009, 02:38:07 am »
This worked for me as well ...

Ideally I'd like it to not ask for any name at all, first or last and only username/email/password ... but I'm not sure what to change in that hack above. If anyone knows this, I'd love to know.

Either way though a very viable solution to what has been an all day problem. Thanks for sharing, Doorknob!