hi dears
i want to add some field to registration form
i add each of my need to this address lib/pkp/templates/frontend/components/registrationForm.tpl
for example
<div class="Sex">
<label>
<span class="label">
{translate key="user.sex"}
<span class="required">*</span>
<span class="pkp_screen_reader">
{translate key="common.required"}
</span>
</span>
<select name="Sex" id="Sex" required>
<option value="0">{translate key="user.sex.male"}</option>
<option value="1">{translate key="user.sex.female"}</option>
</select>
</label>
</div>
and add this code to lib/pkp/classes/user/form/RegistrationForm.inc.php
function execute($request) {
$requireValidation = Config::getVar('email', 'require_validation');
$userDao = DAORegistry::getDAO('UserDAO');
// New user
$user = $userDao->newDataObject();
$user->setUsername($this->getData('username'));
// Set the base user fields (name, etc.)
$user->setFirstName($this->getData('firstName'));
$user->setMiddleName($this->getData('middleName'));
$user->setLastName($this->getData('lastName'));
$user->setInitials($this->getData('initials'));
$user->setEmail($this->getData('email'));
$user->setCountry($this->getData('country'));
$user->setCity($this->getData('City'));
$user->setAddress($this->getData('Address'));
$user->setSex($this->getData('Sex'));
$user->setNationalID($this->getData('NationalID'));
$user->setPhone($this->getData('Phone'));
$user->setMobile($this->getData('Mobile'));
$user->setAffiliation($this->getData('affiliation'), null); // Localized
$user->setDateRegistered(Core::getCurrentDate());
$user->setInlineHelp(1); // default new users to having inline help visible.
if (isset($this->defaultAuth)) {
$user->setPassword($this->getData('password'));
// FIXME Check result and handle failures
$this->defaultAuth->doCreateUser($user);
$user->setAuthId($this->defaultAuth->authId);
}
$user->setPassword(Validation::encryptCredentials($this->getData('username'), $this->getData('password')));
if ($requireValidation) {
// The account should be created in a disabled
// state.
$user->setDisabled(true);
$user->setDisabledReason(__('user.login.accountNotValidated', array('email' => $this->getData('email'))));
}
parent::execute($user);
$userDao->insertObject($user);
$userId = $user->getId();
if (!$userId) {
return false;
}
// Associate the new user with the existing session
$sessionManager = SessionManager::getManager();
$session = $sessionManager->getUserSession();
$session->setSessionVar('username', $user->getUsername());
// Save the roles
import('lib.pkp.classes.user.form.UserFormHelper');
$userFormHelper = new UserFormHelper();
$userFormHelper->saveRoleContent($this, $user);
// Insert the user interests
import('lib.pkp.classes.user.InterestManager');
$interestManager = new InterestManager();
$interestManager->setInterestsForUser($user, $this->getData('interests'));
import('lib.pkp.classes.mail.MailTemplate');
if ($requireValidation) {
// Create an access key
import('lib.pkp.classes.security.AccessKeyManager');
$accessKeyManager = new AccessKeyManager();
$accessKey = $accessKeyManager->createKey('RegisterContext', $user->getId(), null, Config::getVar('email', 'validation_timeout'));
// Send email validation request to user
$mail = new MailTemplate('USER_VALIDATE');
$this->_setMailFrom($request, $mail);
$context = $request->getContext();
$mail->assignParams(array(
'userFullName' => $user->getFullName(),
'activateUrl' => $request->url($context->getPath(), 'user', 'activateUser', array($this->getData('username'), $accessKey))
));
$mail->addRecipient($user->getEmail(), $user->getFullName());
$mail->send();
unset($mail);
}
return $userId;
}
but when i clicked on submit button , see white page
in additional i add these property to db , on user table
can you help me?