Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. app/code/core/Mage/Customer/controllers/AccountController.php
  2. 00192 public function createPostAction()
  3. {
  4. 00241 if (true === $validationResult) {
  5. 00242 $customer->save();
  6.  
  7.  
  8. 00243 // Do your custom Code here to match the domains you want to make Confirmation Required for them.
  9. $patterns = array('@foo.com','@boo.com','@bar.com');
  10. $patterns_flattened = implode('|', $patterns);
  11. if ( preg_match('/'. $patterns_flattened .'/i', $customer->getEmail(), $matches) )
  12. { $customer->setIsConfirmationRequired(true);
  13. }
  14.  
  15.  
  16.  
  17. 00244 if ($customer->isConfirmationRequired()) {
  18. 00245 $customer->sendNewAccountEmail('confirmation', $this->_getSession()->getBeforeAuthUrl());
  19. 00246 $this->_getSession()->addSuccess($this->__('Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please <a href="%s">click here</a>.',
  20. 00247 Mage::helper('customer')->getEmailConfirmationUrl($customer->getEmail())
  21. 00248 ));
  22. 00249 $this->_redirectSuccess(Mage::getUrl('*/*/index', array('_secure'=>true)));
  23. 00250 return;
  24. 00251 }
  25. 00252 else {
  26. 00253 $this->_getSession()->setCustomerAsLoggedIn($customer);
  27. 00254 $url = $this->_welcomeCustomer($customer);
  28. 00255 $this->_redirectSuccess($url);
  29. 00256 return;
  30. 00257 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement