Added items to registration form and get "Notice: Undefined property: stdClass" I added 2 items to the user registration form Phone Number and Carrier. When I register a user or edit one i get the following error.
Notice: Undefined property: stdClass::$phone in user_account_form() (line 1066 of /var/www/capaug/modules/user/user.module).
Notice: Undefined property: stdClass::$carrier in user_account_form() (line 1076 of /var/www/capaug/modules/user/user.module).

Here is the code for the user registration:

function user_account_form(&amp;$form, &amp;$form_state) {
  global $user;

  $account = $form['#user'];
  $register = ($form['#user']-&gt;uid &gt; 0 ? FALSE : TRUE);

  $admin = user_access('administer users');

  $form['#validate'][] = 'user_account_form_validate';

  // Account information.
  $form['account'] = array(
    '#type'   =&gt; 'container',
    '#weight' =&gt; -10,
  );
  // Only show name field on registration form or user can change own username.
  $form['account']['name'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Username'),
    '#maxlength' =&gt; USERNAME_MAX_LENGTH,
    '#description' =&gt; t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.'),
    '#required' =&gt; TRUE,
    '#attributes' =&gt; array('class' =&gt; array('username')),
    '#default_value' =&gt; (!$register ? $account-&gt;name : ''),
    '#access' =&gt; ($register || ($user-&gt;uid == $account-&gt;uid &amp;&amp; user_access('change own username')) || $admin),
    '#weight' =&gt; -10,
  );

  $form['account']['mail'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('E-mail address'),
    '#maxlength' =&gt; EMAIL_MAX_LENGTH,
    '#description' =&gt; t('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'),
    '#required' =&gt; TRUE,
    '#default_value' =&gt; (!$register ? $account-&gt;mail : ''),
  );

  //Phone Number Entry
  $form['account']['phone'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Phone Number'),
    '#maxlength' =&gt; PHONE_MAX_LENGTH,
    '#description' =&gt; t('A valid Telephone number. Numbers only, no parentheses or dashes.'),
    '#required' =&gt; TRUE,
    '#default_value' =&gt; (!$register ? $account-&gt;phone : ''),
  );

  //Carrier Selection
  $form['account']['carrier'] = array(
    '#type' =&gt; 'select',
    '#title' =&gt; t('Carrier'),
    '#options' =&gt; array(t('--- NONE ---'), t('AT&amp;T'), t('NTelos'), t('Sprint'), t('Straight-    Talk'), t('T-Mobile'), t('Tracfone'), t('Verizon'), t('Virgin Mobile')),
    '#description' =&gt; t('Your phone service provider. Select "None" for home phones.'),
    '#required' =&gt; TRUE,
    '#default_value' =&gt; (!$register ? $account-&gt;carrier : ''),
  );


Where do I have to define those variables to get them to work?

Thank you all!
Never, ever patch core like that. This is not how Drupal works. That said, you didn't specify whether you are using Drupal 7 or not; I presume you do. Instead of doing this, use the field UI module to add the relevant fields to users under Administer > Configuration > People > Profiles.