@ -88,6 +88,9 @@ class RegistrationController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function actionRegister()
|
||||
{
|
||||
if (!$this->module->enableRegistration) {
|
||||
@ -104,12 +107,18 @@ class RegistrationController extends Controller
|
||||
$this->trigger(FormEvent::EVENT_BEFORE_REGISTER, $event);
|
||||
|
||||
/** @var User $user */
|
||||
$user = $this->make(User::class, [],
|
||||
[ 'email' => $form->attributes['email'],
|
||||
'username' => $form->attributes['username'],
|
||||
'password' => $form->attributes['password']
|
||||
]); $user->setScenario('register');
|
||||
|
||||
// Create a temporay $user so we can get the attributes, then get
|
||||
// the intersection between the $form fields and the $user fields.
|
||||
$user = $this->make(User::class, [] );
|
||||
$fields = array_intersect_key($form->attributes, $user->attributes);
|
||||
|
||||
// Becomes password_hash
|
||||
$fields['password'] = $form['password'];
|
||||
|
||||
$user = $this->make(User::class, [], $fields );
|
||||
|
||||
$user->setScenario('register');
|
||||
$mailService = MailFactory::makeWelcomeMailerService($user);
|
||||
|
||||
if ($this->make(UserRegisterService::class, [$user, $mailService])->run()) {
|
||||
@ -138,6 +147,9 @@ class RegistrationController extends Controller
|
||||
return $this->render('register', ['model' => $form, 'module' => $this->module]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function actionConnect($code)
|
||||
{
|
||||
/** @var SocialNetworkAccount $account */
|
||||
@ -179,6 +191,9 @@ class RegistrationController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function actionConfirm($id, $code)
|
||||
{
|
||||
/** @var User $user */
|
||||
@ -215,6 +230,9 @@ class RegistrationController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function actionResend()
|
||||
{
|
||||
if ($this->module->enableEmailConfirmation === false) {
|
||||
|
||||
Reference in New Issue
Block a user