I was able to build a fairly complex sign up system allowing users to sign up external from the shop, and use the details to log into the shop AND website.
My only issue now is, how would I use the shops sesssion on the website login, so the shop and webpage link seamlessly without the user having to log in twice.
If it helps I can provide how the shop handles login:
if (isset ($_SESSION['customer_id'])) {
xtc_redirect(xtc_href_link(FILENAME_ACCOUNT, '', 'SSL'));
}
// create smarty elements
$smarty = new Smarty;
// include boxes
require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');
// include needed functions
require_once (DIR_FS_INC.'xtc_validate_password.inc.php');
require_once (DIR_FS_INC.'xtc_array_to_string.inc.php');
require_once (DIR_FS_INC.'xtc_write_user_info.inc.php');
// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
if ($session_started == false) {
xtc_redirect(xtc_href_link(FILENAME_COOKIE_USAGE));
}
if (isset ($_GET['action']) && ($_GET['action'] == 'process')) {
$email_address = xtc_db_prepare_input($_POST['email_address']);
$password = xtc_db_prepare_input($_POST['password']);
// Check if email exists
$check_customer_query = xtc_db_query("select customers_id, customers_vat_id, customers_firstname,customers_lastname, customers_gender, customers_password, customers_email_address, customers_default_address_id from ".TABLE_CUSTOMERS." where customers_email_address = '".xtc_db_input($email_address)."' and account_type = '0'");
if (!xtc_db_num_rows($check_customer_query)) {
$_GET['login'] = 'fail';
$info_message = TEXT_NO_EMAIL_ADDRESS_FOUND;
} else {
$check_customer = xtc_db_fetch_array($check_customer_query);
// Check that password is good
if (!xtc_validate_password($password, $check_customer['customers_password'])) {
$_GET['login'] = 'fail';
$info_message = TEXT_LOGIN_ERROR;
} else {
if (SESSION_RECREATE == 'True') {
xtc_session_recreate();
}
$check_country_query = xtc_db_query("select entry_country_id, entry_zone_id from ".TABLE_ADDRESS_BOOK." where customers_id = '".(int) $check_customer['customers_id']."' and address_book_id = '".$check_customer['customers_default_address_id']."'");
$check_country = xtc_db_fetch_array($check_country_query);
$_SESSION['customer_gender'] = $check_customer['customers_gender'];
$_SESSION['customer_first_name'] = $check_customer['customers_firstname'];
$_SESSION['customer_last_name'] = $check_customer['customers_lastname'];
$_SESSION['customer_id'] = $check_customer['customers_id'];
$_SESSION['customer_vat_id'] = $check_customer['customers_vat_id'];
$_SESSION['customer_default_address_id'] = $check_customer['customers_default_address_id'];
$_SESSION['customer_country_id'] = $check_country['entry_country_id'];
$_SESSION['customer_zone_id'] = $check_country['entry_zone_id'];
$date_now = date('Ymd');
xtc_db_query("update ".TABLE_CUSTOMERS_INFO." SET customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 WHERE customers_info_id = '".(int) $_SESSION['customer_id']."'");
xtc_write_user_info((int) $_SESSION['customer_id']);
// restore cart contents
$_SESSION['cart']->restore_contents();
if (is_object($econda)) $econda->_loginUser();
if ($_SESSION['cart']->count_contents() > 0) {
xtc_redirect(xtc_href_link(FILENAME_SHOPPING_CART, '', 'SSL'));
} else {
xtc_redirect(xtc_href_link(FILENAME_DEFAULT));
}
}
}
}