Users are keeping deactivated automatically
Created 7 years ago by lckamalI have set auto activation mode in admin. but when user activates at some point he automatically becomes deactivated.
Any idea how?
lckamal
—
7 years ago
I have used my own. but everything is identical to RegisterFormBuilder
class MyRegisterFormBuilder extends RegisterFormBuilder
{
protected $roles = [];
protected $model = 'Anomaly\UsersModule\User\UserModel';
protected $handler = 'Anomaly\UsersModule\User\Register\RegisterFormHandler';
protected $fields = [
'first_name' => [
'instructions' => false,
'placeholder' => 'theme::field.first_name.name',
'rules' => [
'required'
],
'required' => true,
'validators' => [
'required' => [
'message' => 'First Name is required.',
],
],
],
'last_name' => [
'instructions' => false,
'placeholder' => 'theme::field.last_name.name',
'required' => true,
'validators' => [
'required' => [
'last_name.message' => 'Last name is required.',
],
],
],
'email' => [
'instructions' => false,
'placeholder' => 'theme::field.email.name',
'validators' => [
'required' => [
'email.message' => 'Email is required.',
],
],
],
'password' => [
'instructions' => false,
'placeholder' => 'theme::field.password.name',
],
'roles' => [
'instructions' => false,
'placeholder' => 'theme::field.roles.name',
'validators' => [
'roles.required' => [
'message' => 'Please check if you are a Job seeker or an Employer.',
],
],
],
];
protected $actions = [
'blue' => [
'text' => 'anomaly.module.users::button.register',
],
];
protected $options = [
'redirect' => '/',
'success_message' => 'anomaly.module.users::success.user_registered',
'pending_message' => 'anomaly.module.users::message.pending_admin_activation',
'confirm_message' => 'anomaly.module.users::message.pending_email_activation',
'activated_message' => 'anomaly.module.users::message.account_activated',
];
public function onSaving()
{
$entry = $this->getFormEntry();
if($first_name = $this->getFormValue('first_name')){
$entry->display_name = $first_name.' '.$this->getFormValue('last_name');
}
if($email = $this->getFormvalue('email')){
$entry->username = $email;
}
}
public function onSaved()
{
$this->dispatch(new AssociateActivationRoles($this));
}
public function getRoles()
{
return $this->roles;
}
public function setRoles($roles)
{
$this->roles = $roles;
return $this;
}
You are using RegisterFormBuilder from UsersModule, or your own?