A user with such an e-mail is already registered. Please login and try again.
What should I modify so that it doesn't check if the email was already used so it permits the user to submit the form multiple times with the same email address?
Thanks!
A user with such an e-mail is already registered. Please login and try again.
$userData = User::createUser(array(
'email' => $booking->useremail,
'username' => $booking->username,
'phone' => $booking->phone,
'activatekey' => User::generateActivateKey()
));
if ($userData) {
$user = $userData['userModel'];
$user->id = $userData['id'];
$user->password = $userData['password'];
$user->email = $userData['email'];
$user->username = $userData['username'];
$user->activatekey = $userData['activatekey'];
$user->activateLink = $userData['activateLink'];
if($payImmediately){
$identity = new UserIdentity($userData['email'], $userData['password']);
if($identity->authenticate() && Yii::app()->user->login($identity, 2592000)){
Yii::app()->user->setState('attempts-login', 0);
User::updateUserSession();
User::updateLatestInfo(Yii::app()->user->id, Yii::app()->controller->currentUserIp);
}
}
$notifier = new Notifier;
$notifier->raiseEvent('onNewUser_'.param('user_registrationMode'), $user, array(
'user' => $userData['userModel'],
'forceSendUser' => true
));
} else {
$booking->addError('', tt('Error User Registration', 'booking'));
}
if(param('useUserRegistration', 1)) {
$userData = User::createUser(array(
'email' => $booking->useremail,
'username' => $booking->username,
'phone' => $booking->phone,
'activatekey' => User::generateActivateKey()
));
if ($userData) {
$user = $userData['userModel'];
$user->id = $userData['id'];
$user->password = $userData['password'];
$user->email = $userData['email'];
$user->username = $userData['username'];
$user->activatekey = $userData['activatekey'];
$user->activateLink = $userData['activateLink'];
if($payImmediately){
$identity = new UserIdentity($userData['email'], $userData['password']);
if($identity->authenticate() && Yii::app()->user->login($identity, 2592000)){
Yii::app()->user->setState('attempts-login', 0);
User::updateUserSession();
User::updateLatestInfo(Yii::app()->user->id, Yii::app()->controller->currentUserIp);
}
}
$notifier = new Notifier;
$notifier->raiseEvent('onNewUser_'.param('user_registrationMode'), $user, array(
'user' => $userData['userModel'],
'forceSendUser' => true
));
} else {
$booking->addError('', tt('Error User Registration', 'booking'));
}
}
public function myUserEmailValidator() {
if (Yii::app()->user->isGuest) {
public function myUserEmailValidator() {
if (Yii::app()->user->isGuest && param('useUserRegistration', 1)) {
public static function addRecord(Booking $booking, User $user, $status = self::STATUS_NEW) {
$dateStart = Yii::app()->dateFormatter->format('yyyy-MM-dd', CDateTimeParser::parse($booking->date_start, Booking::getYiiDateFormat()));
$dateEnd = Yii::app()->dateFormatter->format('yyyy-MM-dd', CDateTimeParser::parse($booking->date_end, Booking::getYiiDateFormat()));
$model = new Bookingtable;
$model->active = $status;
$model->apartment_id = $booking->apartment_id;
$model->username = $booking->username;
$model->email = $booking->useremail;
$model->phone = $booking->phone;
$model->date_start = $dateStart;
$model->date_end = $dateEnd;
$model->time_in = $booking->time_in;
$model->time_out = $booking->time_out;
$model->comment = $booking->comment;
$model->user_ip = $booking->user_ip;
$model->user_ip_ip2_long = $booking->user_ip_ip2_long;
$model->sender_id = $user->id;
$model->amount = $booking->amount;
$model->num_guest = $booking->num_guest;
$model->save(false);
return $model;
}
public static function addRecord(Booking $booking, $user, $status = self::STATUS_NEW) {
$dateStart = Yii::app()->dateFormatter->format('yyyy-MM-dd', CDateTimeParser::parse($booking->date_start, Booking::getYiiDateFormat()));
$dateEnd = Yii::app()->dateFormatter->format('yyyy-MM-dd', CDateTimeParser::parse($booking->date_end, Booking::getYiiDateFormat()));
$model = new Bookingtable;
$model->active = $status;
$model->apartment_id = $booking->apartment_id;
$model->username = $booking->username;
$model->email = $booking->useremail;
$model->phone = $booking->phone;
$model->date_start = $dateStart;
$model->date_end = $dateEnd;
$model->time_in = $booking->time_in;
$model->time_out = $booking->time_out;
$model->comment = $booking->comment;
$model->user_ip = $booking->user_ip;
$model->user_ip_ip2_long = $booking->user_ip_ip2_long;
$model->sender_id = $user ? $user->id : 0;
$model->amount = $booking->amount;
$model->num_guest = $booking->num_guest;
$model->save(false);
return $model;
}
Users browsing this forum: No registered users and 19 guests