[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 create_account.php

Zen Cart 源代码 create_account.php




下载文件

文件名: create_account.php
文件类型: PHP文件
文件大小: 19.55 KiB
MD5: a176e42475d79d9f66390748c0d328fe

create_account.php - 关闭高亮
  1. <?php
  2. /**
  3.  * create_account header_php.php
  4.  *
  5.  * @package modules
  6.  * @copyright Copyright 2003-2010 Zen Cart Development Team
  7.  * @copyright Portions Copyright 2003 osCommerce
  8.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9.  * @version $Id: create_account.php 16704 2010-06-10 21:16:37Z wilt $
  10.  */
  11. // This should be first line of the script:
  12. $zco_notifier->notify('NOTIFY_MODULE_START_CREATE_ACCOUNT');
  13.  
  14. if (!defined('IS_ADMIN_FLAG')) {
  15.   die('Illegal Access');
  16. }
  17. /**
  18.  * Set some defaults
  19.  */
  20.   $process = false;
  21.   $zone_name = '';
  22.   $entry_state_has_zones = '';
  23.   $error_state_input = false;
  24.   $state = '';
  25.   $zone_id = 0;
  26.   $error = false;
  27.   $email_format = (ACCOUNT_EMAIL_PREFERENCE == '1' ? 'HTML' : 'TEXT');
  28.   $newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '0' ? false : true);
  29.  
  30. /**
  31.  * Process form contents
  32.  */
  33. if (isset($_POST['action']) && ($_POST['action'] == 'process')) {
  34.   $process = true;
  35.  
  36.   if (ACCOUNT_GENDER == 'true') {
  37.     if (isset($_POST['gender'])) {
  38.       $gender = zen_db_prepare_input($_POST['gender']);
  39.     } else {
  40.       $gender = false;
  41.     }
  42.   }
  43.  
  44.   if (isset($_POST['email_format'])) {
  45.     $email_format = zen_db_prepare_input($_POST['email_format']);
  46.   }
  47.  
  48.   if (ACCOUNT_COMPANY == 'true') $company = zen_db_prepare_input($_POST['company']);
  49.   $firstname = zen_db_prepare_input(zen_sanitize_string($_POST['firstname']));
  50.   $lastname = zen_db_prepare_input(zen_sanitize_string($_POST['lastname']));
  51.   $nick = zen_db_prepare_input($_POST['nick']);
  52.   if (ACCOUNT_DOB == 'true') $dob = zen_db_prepare_input($_POST['dob']);
  53.   $email_address = zen_db_prepare_input($_POST['email_address']);
  54.   $street_address = zen_db_prepare_input($_POST['street_address']);
  55.   if (ACCOUNT_SUBURB == 'true') $suburb = zen_db_prepare_input($_POST['suburb']);
  56.   $postcode = zen_db_prepare_input($_POST['postcode']);
  57.   $city = zen_db_prepare_input($_POST['city']);
  58.   if (ACCOUNT_STATE == 'true') {
  59.     $state = zen_db_prepare_input($_POST['state']);
  60.     if (isset($_POST['zone_id'])) {
  61.       $zone_id = zen_db_prepare_input($_POST['zone_id']);
  62.     } else {
  63.       $zone_id = false;
  64.     }
  65.   }
  66.   $country = zen_db_prepare_input($_POST['zone_country_id']);
  67.   $telephone = zen_db_prepare_input($_POST['telephone']);
  68.   $fax = zen_db_prepare_input($_POST['fax']);
  69.   $customers_authorization = CUSTOMERS_APPROVAL_AUTHORIZATION;
  70.   $customers_referral = zen_db_prepare_input($_POST['customers_referral']);
  71.  
  72.   if (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '2') {
  73.     $newsletter = 0;
  74.     if (isset($_POST['newsletter'])) {
  75.       $newsletter = zen_db_prepare_input($_POST['newsletter']);
  76.     }
  77.   }
  78.  
  79.   $password = zen_db_prepare_input($_POST['password']);
  80.   $confirmation = zen_db_prepare_input($_POST['confirmation']);
  81.  
  82.  
  83.   if (DISPLAY_PRIVACY_CONDITIONS == 'true') {
  84.     if (!isset($_POST['privacy_conditions']) || ($_POST['privacy_conditions'] != '1')) {
  85.       $error = true;
  86.       $messageStack->add('create_account', ERROR_PRIVACY_STATEMENT_NOT_ACCEPTED, 'error');
  87.     }
  88.   }
  89.  
  90.   if (ACCOUNT_GENDER == 'true') {
  91.     if ( ($gender != 'm') && ($gender != 'f') ) {
  92.       $error = true;
  93.       $messageStack->add('create_account', ENTRY_GENDER_ERROR);
  94.     }
  95.   }
  96.  
  97.   if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  98.     $error = true;
  99.     $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
  100.   }
  101.  
  102.   if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
  103.     $error = true;
  104.     $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
  105.   }
  106.  
  107.   if (ACCOUNT_DOB == 'true') {
  108.     if (ENTRY_DOB_MIN_LENGTH > 0 or !empty($_POST['dob'])) {
  109.       if (substr_count($dob,'/') > 2 || checkdate((int)substr(zen_date_raw($dob), 4, 2), (int)substr(zen_date_raw($dob), 6, 2), (int)substr(zen_date_raw($dob), 0, 4)) == false) {
  110.         $error = true;
  111.         $messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
  112.       }
  113.     }
  114.   }
  115.  
  116.   if (ACCOUNT_COMPANY == 'true') {
  117.     if ((int)ENTRY_COMPANY_MIN_LENGTH > 0 && strlen($company) < ENTRY_COMPANY_MIN_LENGTH) {
  118.       $error = true;
  119.       $messageStack->add('create_account', ENTRY_COMPANY_ERROR);
  120.     }
  121.   }
  122.  
  123.  
  124.   if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
  125.     $error = true;
  126.     $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
  127.   } elseif (zen_validate_email($email_address) == false) {
  128.     $error = true;
  129.     $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
  130.   } else {
  131.     $check_email_query = "select count(*) as total
  132.                            from " . TABLE_CUSTOMERS . "
  133.                            where customers_email_address = '" . zen_db_input($email_address) . "'";
  134.     $check_email = $db->Execute($check_email_query);
  135.  
  136.     if ($check_email->fields['total'] > 0) {
  137.       $error = true;
  138.       $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
  139.     }
  140.   }
  141.  
  142.   if ($phpBB->phpBB['installed'] == true) {
  143.     if (strlen($nick) < ENTRY_NICK_MIN_LENGTH)  {
  144.       $error = true;
  145.       $messageStack->add('create_account', ENTRY_NICK_LENGTH_ERROR);
  146.     } else {
  147.       // check Zen Cart for duplicate nickname
  148.       $sql = "select * from " . TABLE_CUSTOMERS  . "
  149.                           where customers_nick = :nick:";
  150.       $check_nick_query = $db->bindVars($sql, ':nick:', $nick, 'string');
  151.       $check_nick = $db->Execute($check_nick_query);
  152.       if ($check_nick->RecordCount() > 0 ) {
  153.         $error = true;
  154.         $messageStack->add('create_account', ENTRY_NICK_DUPLICATE_ERROR);
  155.       }
  156.       // check phpBB for duplicate nickname
  157.       if ($phpBB->phpbb_check_for_duplicate_nick($nick) == 'already_exists' ) {
  158.         $error = true;
  159.         $messageStack->add('create_account', ENTRY_NICK_DUPLICATE_ERROR . ' (phpBB)');
  160.       }
  161.     }
  162.   }
  163.  
  164.   if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
  165.     $error = true;
  166.     $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
  167.   }
  168.  
  169.   if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
  170.     $error = true;
  171.     $messageStack->add('create_account', ENTRY_CITY_ERROR);
  172.   }
  173.  
  174.   if (ACCOUNT_STATE == 'true') {
  175.     $check_query = "SELECT count(*) AS total
  176.                    FROM " . TABLE_ZONES . "
  177.                    WHERE zone_country_id = :zoneCountryID";
  178.     $check_query = $db->bindVars($check_query, ':zoneCountryID', $country, 'integer');
  179.     $check = $db->Execute($check_query);
  180.     $entry_state_has_zones = ($check->fields['total'] > 0);
  181.     if ($entry_state_has_zones == true) {
  182.       $zone_query = "SELECT distinct zone_id, zone_name, zone_code
  183.                     FROM " . TABLE_ZONES . "
  184.                     WHERE zone_country_id = :zoneCountryID
  185.                     AND " .
  186.                      ((trim($state) != '' && $zone_id == 0) ? "(upper(zone_name) like ':zoneState%' OR upper(zone_code) like '%:zoneState%') OR " : "") .
  187.                     "zone_id = :zoneID
  188.                     ORDER BY zone_code ASC, zone_name";
  189.  
  190.       $zone_query = $db->bindVars($zone_query, ':zoneCountryID', $country, 'integer');
  191. // BOM by zen-cart.cn
  192.       $zone_query = $db->bindVars($zone_query, ':zoneState', GBcase($state,"upper"), 'noquotestring');
  193. // EOM by zen-cart.cn
  194.       $zone_query = $db->bindVars($zone_query, ':zoneID', $zone_id, 'integer');
  195.       $zone = $db->Execute($zone_query);
  196.  
  197.       //look for an exact match on zone ISO code
  198.       $found_exact_iso_match = ($zone->RecordCount() == 1);
  199.       if ($zone->RecordCount() > 1) {
  200.         while (!$zone->EOF && !$found_exact_iso_match) {
  201.           if (strtoupper($zone->fields['zone_code']) == strtoupper($state) ) {
  202.             $found_exact_iso_match = true;
  203.             continue;
  204.           }
  205.           $zone->MoveNext();
  206.         }
  207.       }
  208.  
  209.       if ($found_exact_iso_match) {
  210.         $zone_id = $zone->fields['zone_id'];
  211.         $zone_name = $zone->fields['zone_name'];
  212.       } else {
  213.         $error = true;
  214.         $error_state_input = true;
  215.         $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
  216.       }
  217.     } else {
  218.       if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
  219.         $error = true;
  220.         $error_state_input = true;
  221.         $messageStack->add('create_account', ENTRY_STATE_ERROR);
  222.       }
  223.     }
  224.   }
  225.  
  226.   if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
  227.     $error = true;
  228.     $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
  229.   }
  230.  
  231.   if ( (is_numeric($country) == false) || ($country < 1) ) {
  232.     $error = true;
  233.     $messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
  234.   }
  235.  
  236.   if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
  237.     $error = true;
  238.     $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
  239.   }
  240.  
  241.  
  242.   if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
  243.     $error = true;
  244.     $messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
  245.   } elseif ($password != $confirmation) {
  246.     $error = true;
  247.     $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
  248.   }
  249.  
  250.   if ($error == true) {
  251.     // hook notifier class
  252.     $zco_notifier->notify('NOTIFY_FAILURE_DURING_CREATE_ACCOUNT');
  253.   } else {
  254.     $sql_data_array = array('customers_firstname' => $firstname,
  255.                             'customers_lastname' => $lastname,
  256.                             'customers_email_address' => $email_address,
  257.                             'customers_nick' => $nick,
  258.                             'customers_telephone' => $telephone,
  259.                             'customers_fax' => $fax,
  260.                             'customers_newsletter' => (int)$newsletter,
  261.                             'customers_email_format' => $email_format,
  262.                             'customers_default_address_id' => 0,
  263.                             'customers_password' => zen_encrypt_password($password),
  264.                             'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
  265.     );
  266.  
  267.     if ((CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '')) $sql_data_array['customers_referral'] = $customers_referral;
  268.     if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
  269.     if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = (empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']));
  270.  
  271.     zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);
  272.  
  273.     $_SESSION['customer_id'] = $db->Insert_ID();
  274.  
  275.     $zco_notifier->notify('NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD', array_merge(array('customer_id' => $_SESSION['customer_id']), $sql_data_array));
  276.  
  277.     $sql_data_array = array('customers_id' => $_SESSION['customer_id'],
  278.                             'entry_firstname' => $firstname,
  279.                             'entry_lastname' => $lastname,
  280.                             'entry_street_address' => $street_address,
  281.                             'entry_postcode' => $postcode,
  282.                             'entry_city' => $city,
  283.                             'entry_country_id' => $country);
  284.  
  285.     if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  286.     if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  287.     if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  288.     if (ACCOUNT_STATE == 'true') {
  289.       if ($zone_id > 0) {
  290.         $sql_data_array['entry_zone_id'] = $zone_id;
  291.         $sql_data_array['entry_state'] = '';
  292.       } else {
  293.         $sql_data_array['entry_zone_id'] = '0';
  294.         $sql_data_array['entry_state'] = $state;
  295.       }
  296.     }
  297.  
  298.     zen_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
  299.  
  300.     $address_id = $db->Insert_ID();
  301.  
  302.     $zco_notifier->notify('NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_ADDRESS_BOOK_RECORD', array_merge(array('address_id' => $address_id), $sql_data_array));
  303.  
  304.     $sql = "update " . TABLE_CUSTOMERS . "
  305.              set customers_default_address_id = '" . (int)$address_id . "'
  306.              where customers_id = '" . (int)$_SESSION['customer_id'] . "'";
  307.  
  308.     $db->Execute($sql);
  309.  
  310.     $sql = "insert into " . TABLE_CUSTOMERS_INFO . "
  311.                          (customers_info_id, customers_info_number_of_logons,
  312.                           customers_info_date_account_created, customers_info_date_of_last_logon)
  313.              values ('" . (int)$_SESSION['customer_id'] . "', '1', now(), now())";
  314.  
  315.     $db->Execute($sql);
  316.  
  317.     // phpBB create account
  318.     if ($phpBB->phpBB['installed'] == true) {
  319.       $phpBB->phpbb_create_account($nick, $password, $email_address);
  320.     }
  321.     // End phppBB create account
  322.  
  323.     if (SESSION_RECREATE == 'True') {
  324.       zen_session_recreate();
  325.     }
  326.  
  327.     $_SESSION['customer_first_name'] = $firstname;
  328.     $_SESSION['customer_default_address_id'] = $address_id;
  329.     $_SESSION['customer_country_id'] = $country;
  330.     $_SESSION['customer_zone_id'] = $zone_id;
  331.     $_SESSION['customers_authorization'] = $customers_authorization;
  332.  
  333.     // restore cart contents
  334.     $_SESSION['cart']->restore_contents();
  335.  
  336.     // hook notifier class
  337.     $zco_notifier->notify('NOTIFY_LOGIN_SUCCESS_VIA_CREATE_ACCOUNT');
  338.  
  339.     // build the message content
  340.     $name = $firstname . ' ' . $lastname;
  341.  
  342.     if (ACCOUNT_GENDER == 'true') {
  343.       if ($gender == 'm') {
  344.         $email_text = sprintf(EMAIL_GREET_MR, $lastname);
  345.       } else {
  346.         $email_text = sprintf(EMAIL_GREET_MS, $lastname);
  347.       }
  348.     } else {
  349.       $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  350.     }
  351.     $html_msg['EMAIL_GREETING'] = str_replace('\n','',$email_text);
  352.     $html_msg['EMAIL_FIRST_NAME'] = $firstname;
  353.     $html_msg['EMAIL_LAST_NAME']  = $lastname;
  354.  
  355.     // initial welcome
  356.     $email_text .=  EMAIL_WELCOME;
  357.     $html_msg['EMAIL_WELCOME'] = str_replace('\n','',EMAIL_WELCOME);
  358.  
  359.     if (NEW_SIGNUP_DISCOUNT_COUPON != '' and NEW_SIGNUP_DISCOUNT_COUPON != '0') {
  360.       $coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;
  361.       $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");
  362.       $coupon_desc = $db->Execute("select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . $_SESSION['languages_id'] . "'");
  363.       $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");
  364.  
  365.       $text_coupon_help = sprintf(TEXT_COUPON_HELP_DATE, zen_date_short($coupon->fields['coupon_start_date']),zen_date_short($coupon->fields['coupon_expire_date']));
  366.  
  367.       // if on, add in Discount Coupon explanation
  368.       //        $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .
  369.       $email_text .= "\n" . EMAIL_COUPON_INCENTIVE_HEADER .
  370.       (!empty($coupon_desc->fields['coupon_description']) ? $coupon_desc->fields['coupon_description'] . "\n\n" : '') . $text_coupon_help  . "\n\n" .
  371.       strip_tags(sprintf(EMAIL_COUPON_REDEEM, ' ' . $coupon->fields['coupon_code'])) . EMAIL_SEPARATOR;
  372.  
  373.       $html_msg['COUPON_TEXT_VOUCHER_IS'] = EMAIL_COUPON_INCENTIVE_HEADER ;
  374.       $html_msg['COUPON_DESCRIPTION']     = (!empty($coupon_desc->fields['coupon_description']) ? '<strong>' . $coupon_desc->fields['coupon_description'] . '</strong>' : '');
  375.       $html_msg['COUPON_TEXT_TO_REDEEM']  = str_replace("\n", '', sprintf(EMAIL_COUPON_REDEEM, ''));
  376.       $html_msg['COUPON_CODE']  = $coupon->fields['coupon_code'] . $text_coupon_help;
  377.     } //endif coupon
  378.  
  379.     if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
  380.       $coupon_code = zen_create_coupon_code();
  381.       $insert_query = $db->Execute("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
  382.       $insert_id = $db->Insert_ID();
  383.       $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )");
  384.  
  385.       // if on, add in GV explanation
  386.       $email_text .= "\n\n" . sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) .
  387.       sprintf(EMAIL_GV_REDEEM, $coupon_code) .
  388.       EMAIL_GV_LINK . zen_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code, 'NONSSL', false) . "\n\n" .
  389.       EMAIL_GV_LINK_OTHER . EMAIL_SEPARATOR;
  390.       $html_msg['GV_WORTH'] = str_replace('\n','',sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) );
  391.       $html_msg['GV_REDEEM'] = str_replace('\n','',str_replace('\n\n','<br />',sprintf(EMAIL_GV_REDEEM, '<strong>' . $coupon_code . '</strong>')));
  392.       $html_msg['GV_CODE_NUM'] = $coupon_code;
  393.       $html_msg['GV_CODE_URL'] = str_replace('\n','',EMAIL_GV_LINK . '<a href="' . zen_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code, 'NONSSL', false) . '">' . TEXT_GV_NAME . ': ' . $coupon_code . '</a>');
  394.       $html_msg['GV_LINK_OTHER'] = EMAIL_GV_LINK_OTHER;
  395.     } // endif voucher
  396.  
  397.     // add in regular email welcome text
  398.     $email_text .= "\n\n" . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_GV_CLOSURE;
  399.  
  400.     $html_msg['EMAIL_MESSAGE_HTML']  = str_replace('\n','',EMAIL_TEXT);
  401.     $html_msg['EMAIL_CONTACT_OWNER'] = str_replace('\n','',EMAIL_CONTACT);
  402.     $html_msg['EMAIL_CLOSURE']       = nl2br(EMAIL_GV_CLOSURE);
  403.  
  404.     // include create-account-specific disclaimer
  405.     $email_text .= "\n\n" . sprintf(EMAIL_DISCLAIMER_NEW_CUSTOMER, STORE_OWNER_EMAIL_ADDRESS). "\n\n";
  406.     $html_msg['EMAIL_DISCLAIMER'] = sprintf(EMAIL_DISCLAIMER_NEW_CUSTOMER, '<a href="mailto:' . STORE_OWNER_EMAIL_ADDRESS . '">'. STORE_OWNER_EMAIL_ADDRESS .' </a>');
  407.  
  408.     // send welcome email
  409.     if (trim(EMAIL_SUBJECT) != 'n/a') zen_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_NAME, EMAIL_FROM, $html_msg, 'welcome');
  410.  
  411.     // send additional emails
  412.     if (SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_STATUS == '1' and SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO !='') {
  413.       if ($_SESSION['customer_id']) {
  414.         $account_query = "select customers_firstname, customers_lastname, customers_email_address, customers_telephone, customers_fax
  415.                            from " . TABLE_CUSTOMERS . "
  416.                            where customers_id = '" . (int)$_SESSION['customer_id'] . "'";
  417.  
  418.         $account = $db->Execute($account_query);
  419.       }
  420.  
  421.       $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']);
  422.       $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
  423.       if (trim(SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT) != 'n/a') zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT . ' ' . EMAIL_SUBJECT,
  424.       $email_text . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'welcome_extra');
  425.     } //endif send extra emails
  426.  
  427.     zen_redirect(zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
  428.  
  429.   } //endif !error
  430. }
  431.  
  432.  
  433. /*
  434.  * Set flags for template use:
  435.  */
  436.   $selected_country = (isset($_POST['zone_country_id']) && $_POST['zone_country_id'] != '') ? $country : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
  437.   $flag_show_pulldown_states = ((($process == true || $entry_state_has_zones == true) && $zone_name == '') || ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true' || $error_state_input) ? true : false;
  438.   $state = ($flag_show_pulldown_states) ? ($state == '' ? '&nbsp;' : $state) : $zone_name;
  439.   $state_field_label = ($flag_show_pulldown_states) ? '' : ENTRY_STATE;
  440.  
  441. // This should be last line of the script:
  442. $zco_notifier->notify('NOTIFY_MODULE_END_CREATE_ACCOUNT');
  443.