<?php
/*
$Header: /cvs/hol/src/user/actRegValidateSave.php,v 1.7.6.1 2005/08/20 14:58:12 elfoz Exp $
<fusedoc fuse="actRegValidateSave.php">
<responsibilities>
Validates and saves registration data
</responsibilities>
<properties>
<history author="" date="2003 September 29" email="" type="create" />
<note>
Data Rules: XFA_RegisterFailure - (None)
Data Rules: XFA_RegisterSuccess - (None)
Data Rules: registrationData - (None)
Data Rules: fuseaction - (None)
</note>
</properties>
<io>
<in>
<string name="self" optional="false" />
<string name="XFA_RegisterFailure" scope="request" optional="false" comment="" />
<string name="XFA_RegisterSuccess" scope="request" optional="false" comment="" />
<structure name="registrationData" scope="request" optional="false" comment="User registration data form fields" />
</in>
<out>
<structure name="registrationData" scope="session" optional="false" comment="User registration data form fields" />
<string name="fuseaction" scope="request" optional="true" comment="" />
</out>
<passthrough>
<structure name="registrationData" scope="request" optional="false" comment="User registration data form fields" />
</passthrough>
</io>
</fusedoc>
*/
$fuseFailure = true;
if (isset($registerit)) $fuseFailure = !$registerit;
if (!$fuseFailure) {
# We save form values in session to dispose of them in both failure/success cases
$_SESSION['regData']['returnfa'] = $regForm->getInputValue('returnFuseaction');
$_SESSION['regData']['username'] = strip_tags($regForm->getInputValue('username'));
$_SESSION['regData']['password'] = md5($regForm->getInputValue('password'));
$_SESSION['regData']['firstname'] = strip_tags($regForm->getInputValue('firstname'));
$_SESSION['regData']['lastname'] = strip_tags($regForm->getInputValue('lastname'));
$_SESSION['regData']['company'] = strip_tags($regForm->getInputValue('company'));
$_SESSION['regData']['d_birth'] = $regForm->getInputValue('d_birth');
$_SESSION['regData']['m_birth'] = $regForm->getInputValue('m_birth');
$_SESSION['regData']['y_birth'] = $regForm->getInputValue('y_birth');
$_SESSION['regData']['job'] = $regForm->getInputValue('job');
$_SESSION['regData']['email'] = strip_tags($regForm->getInputValue('email'));
$_SESSION['regData']['i_phone'] = $regForm->getInputValue('i_phone');
$_SESSION['regData']['l_phone'] = $regForm->getInputValue('l_phone');
$_SESSION['regData']['n_phone'] = $regForm->getInputValue('n_phone');
$_SESSION['regData']['i_altphone'] = $regForm->getInputValue('i_altphone');
$_SESSION['regData']['l_altphone'] = $regForm->getInputValue('l_altphone');
$_SESSION['regData']['n_altphone'] = $regForm->getInputValue('n_altphone');
$_SESSION['regData']['i_fax'] = $regForm->getInputValue('i_fax');
$_SESSION['regData']['l_fax'] = $regForm->getInputValue('l_fax');
$_SESSION['regData']['n_fax'] = $regForm->getInputValue('n_fax');
$_SESSION['regData']['address'] = strip_tags($regForm->getInputValue('address'));
$_SESSION['regData']['city'] = strip_tags($regForm->getInputValue('city'));
$_SESSION['regData']['zip'] = strip_tags($regForm->getInputValue('zip'));
$_SESSION['regData']['state'] = strtoupper(strip_tags($regForm->getInputValue('state')));
$_SESSION['regData']['country'] = $regForm->getInputValue('country');
$_SESSION['regData']['heard'] = $regForm->getInputValue('heard');
$_SESSION['regData']['commercial'] = $_POST['commercial']; // TODO This is not a standard way to get values from form objects as we use them
if ($GLOBALS['CONFIG']['TRAVELAGENTS']) {
if (in_array(0, $_POST['activity']))
$_SESSION['regData']['touroperator'] = 1;
if (in_array(1, $_POST['activity']))
$_SESSION['regData']['travelagent'] = 1;
$_SESSION['regData']['iata'] = strip_tags($regForm->getInputValue('iata'));
}
Location($GLOBALS['self'].'?fuseaction='.$XFA['XFA_RegisterSuccess']);
} else {
include('dspRegForm.php');
}
?>