Jump to content

Disactivate new account created


Recommended Posts

Hi there, 

I'm currently developing a module to disactivate account when a new user signs up and redirect the user to a CMS page, to inform him that his account need to be activated by the admin. I'm using this code, but once the user account is disactivated, the redirection doesn't work. The user stays on the registration form. Any idea ? 

 

 public function hookActionCustomerAccountAdd($params){

    $customer = $params["newCustomer"];
    $customer->active = false; 
    $ok = $customer->save();
    if ($ok) {
      $this->context->updateCustomer($customer);
      header("Location: [MY_URL]");
      die();
    }
  }

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...