Sitewards_B2BProfessional - Version 3.0.5

Version Notes

Updated documentation, added customer-activation as internal dependency

Download this release

Release Info

Developer Sitewards Magento Team
Extension Sitewards_B2BProfessional
Version 3.0.5
Comparing to
See all releases


Code changes from version 3.0.4 to 3.0.5

Files changed (49) hide show
  1. app/code/community/Netzarbeiter/CustomerActivation/Block/Adminhtml/Widget/Grid/Column/Renderer/Boolean.php +29 -0
  2. app/code/community/Netzarbeiter/CustomerActivation/Changelog +150 -0
  3. app/code/community/Netzarbeiter/CustomerActivation/Helper/Data.php +271 -0
  4. app/code/community/Netzarbeiter/CustomerActivation/Model/Adminhtml/System/Config/Source/Customer/Group/Multiselect.php +51 -0
  5. app/code/community/Netzarbeiter/CustomerActivation/Model/Observer.php +431 -0
  6. app/code/community/Netzarbeiter/CustomerActivation/Model/Resource/Customer.php +100 -0
  7. app/code/community/Netzarbeiter/CustomerActivation/README.md +97 -0
  8. app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/AbstractController.php +73 -0
  9. app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/AdminControllerTest.php +130 -0
  10. app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/CustomerGridTest.php +181 -0
  11. app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/expectations/massActivation.yaml +64 -0
  12. app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/providers/massActivation.yaml +49 -0
  13. app/code/community/Netzarbeiter/CustomerActivation/Test/Helper/Data/Mock/Zend/Mail.php +31 -0
  14. app/code/community/Netzarbeiter/CustomerActivation/Test/Helper/DataTest.php +218 -0
  15. app/code/community/Netzarbeiter/CustomerActivation/Test/Helper/fixtures/emailConfig.yaml +12 -0
  16. app/code/community/Netzarbeiter/CustomerActivation/Test/Model/ObserverTest.php +94 -0
  17. app/code/community/Netzarbeiter/CustomerActivation/Test/Model/expectations/newCustomerActivationState.yaml +54 -0
  18. app/code/community/Netzarbeiter/CustomerActivation/Test/Model/providers/newCustomerActivationState.yaml +77 -0
  19. app/code/community/Netzarbeiter/CustomerActivation/Test/fixtures/customers.yaml +34 -0
  20. app/code/community/Netzarbeiter/CustomerActivation/Test/fixtures/global.yaml +120 -0
  21. app/code/community/Netzarbeiter/CustomerActivation/controllers/AdminController.php +127 -0
  22. app/code/community/Netzarbeiter/CustomerActivation/etc/config.xml +211 -0
  23. app/code/community/Netzarbeiter/CustomerActivation/etc/system.xml +173 -0
  24. app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-install-0.1.0.php +36 -0
  25. app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.3-0.2.4.php +25 -0
  26. app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.4-0.2.5.php +29 -0
  27. app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.7-0.2.8.php +35 -0
  28. app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.8-0.2.9.php +35 -0
  29. app/code/community/Sitewards/B2BProfessional/Docs/Sitewards_B2B_Professional_DE.pdf +0 -0
  30. app/code/community/Sitewards/B2BProfessional/Docs/Sitewards_B2B_Professional_EN.pdf +0 -0
  31. app/code/community/Sitewards/B2BProfessional/Helper/Redirects.php +5 -1
  32. app/code/community/Sitewards/B2BProfessional/etc/config.xml +1 -1
  33. app/etc/modules/Netzarbeiter_CustomerActivation.xml +14 -0
  34. app/locale/de_DE/Netzarbeiter_CustomerActivation.csv +26 -0
  35. app/locale/de_DE/template/email/netzarbeiter/customeractivation/customer_activation.html +41 -0
  36. app/locale/de_DE/template/email/netzarbeiter/customeractivation/customer_registration_admin.html +32 -0
  37. app/locale/el_GR/Netzarbeiter_CustomerActivation.csv +7 -0
  38. app/locale/en_US/Netzarbeiter_CustomerActivation.csv +26 -0
  39. app/locale/en_US/template/email/netzarbeiter/customeractivation/customer_activation.html +41 -0
  40. app/locale/en_US/template/email/netzarbeiter/customeractivation/customer_registration_admin.html +33 -0
  41. app/locale/fr_FR/Netzarbeiter_CustomerActivation.csv +9 -0
  42. app/locale/it_IT/Netzarbeiter_CustomerActivation.csv +16 -0
  43. app/locale/it_IT/Sitewards_B2BProfessional.csv +0 -19
  44. app/locale/it_IT/template/email/netzarbeiter/customeractivation/customer_activation.html +41 -0
  45. app/locale/it_IT/template/email/netzarbeiter/customeractivation/customer_registration_admin.html +33 -0
  46. app/locale/ja_JP/Netzarbeiter_CustomerActivation.csv +17 -0
  47. app/locale/nl_NL/Netzarbeiter_CustomerActivation.csv +16 -0
  48. app/locale/pt_BR/Netzarbeiter_CustomerActivation.csv +24 -0
  49. package.xml +6 -6
app/code/community/Netzarbeiter/CustomerActivation/Block/Adminhtml/Widget/Grid/Column/Renderer/Boolean.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Netzarbeiter_CustomerActivation_Block_Adminhtml_Widget_Grid_Column_Renderer_Boolean
21
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text
22
+ {
23
+ public function render(Varien_Object $row)
24
+ {
25
+ $data = (bool) $this->_getValue($row);
26
+ $value = $data ? 'Yes' : 'No';
27
+ return $this->__($value);
28
+ }
29
+ }
app/code/community/Netzarbeiter/CustomerActivation/Changelog ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Changelog for Netzarbeiter_CustomerActivation
2
+
3
+ 0.5.4 2014-11-19
4
+ - Bug fix: correctly evaluate admin_always_active setting in admin customer grid
5
+
6
+ 0.5.3 2014-09-13
7
+ - Activate all existing customers by default during installation
8
+ - Refactoring and improved tests to help keep module maintainable
9
+
10
+ 0.5.2 2014-01-09
11
+ - Compatibility with older Magento versions without automatic VAT ID validation (I think 1.5 and older)
12
+
13
+ 0.5.1 2013-12-20
14
+ - Remove dependency on PHP 5.3.2 or newer. Should work down to 5.2 again.
15
+
16
+ 0.5.0 2013-11-24
17
+ - Hide post registration message to enter address for VAT validation for deactivated accounts.
18
+ - Correct handling if default activation status is true and also activate by group is true.
19
+ In that case, the default activation status takes precedence since that is also how the
20
+ backend config dependencies show the fields.
21
+
22
+ 0.4.9 2013-11-15
23
+ - Implement workaround for versions of Magento where core/template::getDesignConfig
24
+ is protected.
25
+
26
+ 0.4.8 2013-11-12
27
+ - Fix de-association of selected default addresses on mass updates
28
+ - Only send notifications to customers whos status actually changed during a mass update
29
+
30
+ 0.4.7 2013-09-23
31
+ - Fix store variable in email templates
32
+ - Fix mass activation email notifications
33
+
34
+ 0.4.6 2013-05-24
35
+ - Backward compatibility fix for Magento older then 1.7
36
+
37
+ 0.4.5 2013-05-22
38
+ - Bugfix: enable usage default admin notification email template
39
+
40
+ 0.4.4 2013-04-21
41
+ - Minor new feature: export to CSV or XML now contains the activation status column
42
+
43
+ 0.4.3 2013-04-20
44
+ - New feature: require activation only for specific groups
45
+
46
+ 0.4.2 2013-01-16
47
+ - Update composer dependency on stable magento-composer-installer
48
+
49
+ 0.4.1 2012-12-05
50
+ - Bugfix: properly handle checkout registrations,
51
+ support onepage and multishipping checkout.
52
+
53
+ 0.4.0 2012-11-08
54
+ - Bugfix: only apply mass action to customer grid.
55
+
56
+ 0.3.9 2012-09-25
57
+ - Change observer declaration to <type>model</type> to avoid strange bug a user was reporting
58
+
59
+ 0.3.8 2012-08-07
60
+ - Don't reuse the customer model for mass actions - it messes up the addresses
61
+
62
+ 0.3.7 2012-07-28
63
+ - Move customer grid rewrite to observer to avoid conflicts with other modules
64
+
65
+ 0.3.6 2012-07-22
66
+ - Add configurable feature "Enable customer accounts by default"
67
+
68
+ 0.3.5 2012-07-20
69
+ - Change session model for messages to core/session
70
+
71
+ 0.3.4 2011-05-19
72
+ - Add _isAllowed() method to admin controller
73
+
74
+ 0.3.3 2011-04-29
75
+ - Use better logic to figure out the customer store id
76
+ - Use config value variables in email templates (Thanks to Ryan Price once again!)
77
+
78
+ 0.3.2 2011-04-28
79
+ - Added check of configuration values if emails should be sent (Thanks to Ryan Price for the patch!)
80
+
81
+ 0.3.1 2011-03-23
82
+ - Added shipping and billing address models as email variables
83
+
84
+ 0.3.0 2011-03-22
85
+ - Fix session logout handling for Magento 1.5 compatibility
86
+ - Added licence header comments to all files
87
+
88
+ 0.2.9 2010-12-20
89
+ - Add japanese locale (thanks to Junya Sano for the translation!)
90
+
91
+ 0.2.8 2010-12-20
92
+ - Drop Magento 1.3 Support
93
+ - Add customer_activated attribute to 1.4.2 (CE) / 1.9 (EE) customer_form_attribute table
94
+ - Add renderer for column to display null values as "not activated"
95
+
96
+ 0.2.7 2010-03-22
97
+ - Add option to enable mass activation updates when module is disabled
98
+
99
+ 0.2.6 2010-03-15
100
+ - Add it_IT locale
101
+
102
+ 0.2.5 2010-03-11
103
+ - Fix account not activated message for magento 1.4
104
+ - Add customer_activated customer attribute to attribute_set so it is displayed in the admin interface in 1.4
105
+
106
+ 0.2.4 2009-09-21
107
+ - Get rid of customer edit block override by setting the correct attribute source model
108
+
109
+ 0.2.3 2009-08-10
110
+ - Make customer notification email template selectable on a store view configuraton level
111
+
112
+ 0.2.2 2009-07-18
113
+ - Added new config option to keep module active in admin customer interface, even if it is disabled otherwise
114
+
115
+ 0.2.1 2009-06-13
116
+ - Let through API calls unchecked
117
+
118
+ 0.2.0 2009-06-13
119
+ - Added new Feature: send out notification emails to admin and customer
120
+
121
+ 0.1.9 2009-06-13
122
+ - Added greek translation - thanks to Erik Hoeksma
123
+
124
+ 0.1.8 2009-04-24
125
+ - Added dutch translation - thanks to Toon van Veelden!
126
+
127
+ 0.1.7 2009-04-01
128
+ - Added Mass Action Controller and Amdin Customer Activation Status in the grid from PaulE - thanks for the contributon, man!
129
+
130
+ 0.1.6 2009-01-13
131
+ - Declared stable
132
+
133
+ 0.1.5 2008-12-30
134
+ - Bugfix in Admintml - create new customer form now works (again, thanks SeL for the bug report)
135
+
136
+ 0.1.4 2008-11-13
137
+ - Bugfix in Adminhtml (thanks to SeL)
138
+ - French Translation (again, thanks to SeL)
139
+ - Bugfix, now also works when customer email activation is disabled
140
+
141
+ 0.1.2 2008-08-29
142
+ - Use dropdown in Adminhtml interface instead of text field (now overrides Mage_Adminhtml_Block_Customer_Edit_Tab_Account)
143
+ - Translation of label and dropdown values in adminhtml interface
144
+
145
+ 0.1.1 2008-08-28
146
+ - Bugfix for dependency problem in pear package
147
+
148
+ 0.1.0 2008-08-25
149
+ - Initial release
150
+
app/code/community/Netzarbeiter/CustomerActivation/Helper/Data.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Netzarbeiter_CustomerActivation_Helper_Data extends Mage_Core_Helper_Abstract
21
+ {
22
+ const XML_PATH_EMAIL_ADMIN_NOTIFICATION = 'customer/customeractivation/admin_email';
23
+ const XML_PATH_EMAIL_ADMIN_NOTIFICATION_TEMPLATE = 'customer/customeractivation/registration_admin_template';
24
+ const XML_PATH_EMAIL_CUSTOMER_NOTIFICATION_TEMPLATE = 'customer/customeractivation/activation_template';
25
+ const XML_PATH_ALERT_CUSTOMER = 'customer/customeractivation/alert_customer';
26
+ const XML_PATH_ALERT_ADMIN = 'customer/customeractivation/alert_admin';
27
+ const XML_PATH_DEFAULT_STATUS = 'customer/customeractivation/activation_status_default';
28
+ const XML_PATH_DEFAULT_STATUS_BY_GROUP = 'customer/customeractivation/require_activation_for_specific_groups';
29
+ const XML_PATH_DEFAULT_STATUS_GROUPS = 'customer/customeractivation/require_activation_groups';
30
+
31
+ const XML_PATH_MODULE_DISABLED = 'customer/customeractivation/disable_ext';
32
+ const XML_PATH_ALWAYS_ACTIVE_ADMIN = 'customer/customeractivation/always_active_in_admin';
33
+
34
+ const STATUS_ACTIVATE_WITHOUT_EMAIL = 1;
35
+ const STATUS_ACTIVATE_WITH_EMAIL = 2;
36
+ const STATUS_DEACTIVATE = 0;
37
+
38
+ protected $_origEmailDesignConfig;
39
+
40
+ public function isModuleActive($store = null)
41
+ {
42
+ $value = Mage::getStoreConfig(self::XML_PATH_MODULE_DISABLED, $store);
43
+ return ! $value;
44
+ }
45
+
46
+ public function isModuleActiveInAdmin()
47
+ {
48
+ if (Mage::getStoreConfig(self::XML_PATH_ALWAYS_ACTIVE_ADMIN)) {
49
+ return true;
50
+ }
51
+ return $this->isModuleActive(0);
52
+ }
53
+
54
+ /**
55
+ * Send Admin a notification whenever a new customer account is registered
56
+ *
57
+ * @param Mage_Customer_Model_Customer $customer
58
+ * @return Netzarbeiter_CustomerActivation_Helper_Data
59
+ */
60
+ public function sendAdminNotificationEmail(Mage_Customer_Model_Customer $customer)
61
+ {
62
+ $storeId = $this->getCustomerStoreId($customer);
63
+ if (Mage::getStoreConfig(self::XML_PATH_ALERT_ADMIN, $storeId)) {
64
+ $to = $this->_getEmails(self::XML_PATH_EMAIL_ADMIN_NOTIFICATION, $storeId);
65
+ $storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
66
+ $this->_sendNotificationEmail($to, $customer, self::XML_PATH_EMAIL_ADMIN_NOTIFICATION_TEMPLATE, $storeId);
67
+ }
68
+ return $this;
69
+ }
70
+
71
+ /**
72
+ * Send Customer a notification when her account is activated
73
+ *
74
+ * @param Mage_Customer_Model_Customer $customer
75
+ * @return Netzarbeiter_CustomerActivation_Helper_Data
76
+ */
77
+ public function sendCustomerNotificationEmail(Mage_Customer_Model_Customer $customer)
78
+ {
79
+ if (Mage::getStoreConfig(self::XML_PATH_ALERT_CUSTOMER, $this->getCustomerStoreId($customer))) {
80
+ $to = array(array(
81
+ 'name' => $customer->getName(),
82
+ 'email' => $customer->getEmail(),
83
+ ));
84
+ $this->_sendNotificationEmail($to, $customer, self::XML_PATH_EMAIL_CUSTOMER_NOTIFICATION_TEMPLATE);
85
+ }
86
+ return $this;
87
+ }
88
+
89
+ /**
90
+ * Send transactional email
91
+ *
92
+ * @param array|string $to
93
+ * @param Mage_Customer_Model_Customer $customer
94
+ * @param string $templateConfigPath
95
+ * @param int $storeId
96
+ * @return Netzarbeiter_CustomerActivation_Helper_Data
97
+ */
98
+ protected function _sendNotificationEmail($to, $customer, $templateConfigPath, $storeId = null)
99
+ {
100
+ if (!$to) return;
101
+
102
+ if (is_null($storeId)) {
103
+ $storeId = $this->getCustomerStoreId($customer);
104
+ }
105
+
106
+ $translate = Mage::getSingleton('core/translate')
107
+ ->setTranslateInline(false);
108
+
109
+ $mailTemplate = Mage::getModel('core/email_template');
110
+
111
+ $template = Mage::getStoreConfig($templateConfigPath, $storeId);
112
+
113
+ $sendTo = array();
114
+ foreach ($to as $recipient) {
115
+ if (is_array($recipient)) {
116
+ $sendTo[] = $recipient;
117
+ } else {
118
+ $sendTo[] = array('email' => $recipient, 'name' => null);
119
+ }
120
+ }
121
+
122
+ $this->_setEmailDesignConfig($mailTemplate, $storeId);
123
+
124
+ foreach ($sendTo as $recipient) {
125
+ $mailTemplate->sendTransactional(
126
+ $template,
127
+ Mage::getStoreConfig(Mage_Customer_Model_Customer::XML_PATH_REGISTER_EMAIL_IDENTITY, $storeId),
128
+ $recipient['email'],
129
+ $recipient['name'],
130
+ array(
131
+ 'customer' => $customer,
132
+ 'shipping' => $customer->getPrimaryShippingAddress(),
133
+ 'billing' => $customer->getPrimaryBillingAddress(),
134
+ 'store' => Mage::app()->getStore(
135
+ // In case of admin store emails, $storeId is set to 0.
136
+ // We want 'store' to always be set to the customers store.
137
+ $this->getCustomerStoreId($customer)
138
+ ),
139
+ ),
140
+ $storeId
141
+ );
142
+ }
143
+
144
+ $this->_revertEmailDesignConfig($mailTemplate);
145
+
146
+ $translate->setTranslateInline(true);
147
+
148
+ return $this;
149
+ }
150
+
151
+ /**
152
+ * Keep the original design config if it is set so it can be reset later
153
+ *
154
+ * @param Mage_Core_Model_Email_Template $mailTemplate
155
+ * @param int $storeId
156
+ * @return $this
157
+ */
158
+ protected function _setEmailDesignConfig(Mage_Core_Model_Email_Template $mailTemplate, $storeId)
159
+ {
160
+ $this->_origEmailDesignConfig = null;
161
+
162
+ // Workaround for bug in Mage_Core_Model_Template where getDesignConfig is protected
163
+ if (is_callable(array($mailTemplate, 'getDesignConfig'))) {
164
+ // Use standard way to fetch the current design config (if possible)
165
+ $this->_origEmailDesignConfig = $mailTemplate->getDesignConfig();
166
+
167
+ } elseif (version_compare(phpversion(), '5.3.2', '>=')) {
168
+ // ReflectionMethod::setAccessible() is only available in 5.3.2 or newer
169
+ $method = new ReflectionMethod($mailTemplate, 'getDesignConfig');
170
+ if ($method->isProtected()) {
171
+ $method->setAccessible(true);
172
+ }
173
+ if ($this->_origEmailDesignConfig = $method->invoke($mailTemplate)) {
174
+ $this->_origEmailDesignConfig = $this->_origEmailDesignConfig->getData();
175
+ }
176
+ }
177
+
178
+ // Fallback if neither of the previous versions is available or if
179
+ // there was no design configuration set on the mail template instance
180
+ if (! $this->_origEmailDesignConfig) {
181
+ $this->_origEmailDesignConfig = array(
182
+ 'area' => Mage::app()->getStore()->isAdmin() ? 'adminhtml' : 'frontend',
183
+ 'store' => Mage::app()->getStore()->getId()
184
+ );
185
+ }
186
+
187
+ $mailTemplate->setDesignConfig(array(
188
+ 'area' => Mage::app()->getStore($storeId)->isAdmin() ? 'adminhtml' : 'frontend',
189
+ 'store' => $storeId)
190
+ );
191
+
192
+ return $this;
193
+ }
194
+
195
+ /**
196
+ * Reset the design configuration so emails sent later during
197
+ * the request will use the right store config
198
+ *
199
+ * @param Mage_Core_Model_Email_Template $mailTemplate
200
+ * @return $this
201
+ */
202
+ protected function _revertEmailDesignConfig(Mage_Core_Model_Email_Template $mailTemplate)
203
+ {
204
+ $mailTemplate->setDesignConfig($this->_origEmailDesignConfig);
205
+ return $this;
206
+ }
207
+
208
+ protected function _getEmails($configPath, $storeId = null)
209
+ {
210
+ $data = Mage::getStoreConfig($configPath, $storeId);
211
+ if (!empty($data)) {
212
+ return explode(',', $data);
213
+ }
214
+ return false;
215
+ }
216
+
217
+ /**
218
+ * Return the Store Id to read configuration settings for this customer from
219
+ *
220
+ * @param Mage_Customer_Model_Customer $customer
221
+ * @return int
222
+ */
223
+ public function getCustomerStoreId(Mage_Customer_Model_Customer $customer)
224
+ {
225
+ /*
226
+ * Only set in Adminhtml UI
227
+ */
228
+ if (!($storeId = $customer->getSendemailStoreId())) {
229
+ /*
230
+ * store_id might be zero if the account was created in the admin interface
231
+ */
232
+ $storeId = $customer->getStoreId();
233
+ if (!$storeId && $customer->getWebsiteId()) {
234
+ /*
235
+ * Use the default store groups store of the customers website
236
+ */
237
+ if ($store = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()) {
238
+ $storeId = $store->getId();
239
+ }
240
+ }
241
+ // In case the website_id is not yet set on the customer, and the
242
+ // current store is a frontend store, use the current store ID
243
+ if (!$storeId && !Mage::app()->getStore()->isAdmin()) {
244
+ $storeId = Mage::app()->getStore()->getId();
245
+ }
246
+ }
247
+ return $storeId;
248
+ }
249
+
250
+ /**
251
+ * Return the default activation status for a given group and store Id
252
+ *
253
+ * @param int $groupId
254
+ * @param int $storeId
255
+ * @return bool
256
+ */
257
+ public function getDefaultActivationStatus($groupId, $storeId)
258
+ {
259
+ $defaultIsActive = Mage::getStoreConfig(self::XML_PATH_DEFAULT_STATUS, $storeId);
260
+ $activateByGroup = Mage::getStoreConfig(self::XML_PATH_DEFAULT_STATUS_BY_GROUP, $storeId);
261
+
262
+ if (! $defaultIsActive && $activateByGroup) {
263
+ $notActiveGroups = explode(',', Mage::getStoreConfig(self::XML_PATH_DEFAULT_STATUS_GROUPS, $storeId));
264
+ $isActive = in_array($groupId, $notActiveGroups) ? false : true;
265
+ } else {
266
+ $isActive = $defaultIsActive;
267
+ }
268
+
269
+ return $isActive;
270
+ }
271
+ }
app/code/community/Netzarbeiter/CustomerActivation/Model/Adminhtml/System/Config/Source/Customer/Group/Multiselect.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ /**
21
+ * Class Netzarbeiter_CustomerActivation_Model_Adminhtml_System_Config_Source_Customer_Group_Multiselect
22
+ *
23
+ * Unable to use config source class provided in the core since that is only available since
24
+ * Magento 1.7/1.12, this module supports backward compatibility to 1.4.
25
+ *
26
+ * @see Mage_Adminhtml_Model_System_Config_Source_Customer_Group_Multiselect
27
+ */
28
+ class Netzarbeiter_CustomerActivation_Model_Adminhtml_System_Config_Source_Customer_Group_Multiselect
29
+ {
30
+ /**
31
+ * Customer groups options array
32
+ *
33
+ * @var null|array
34
+ */
35
+ protected $_options;
36
+
37
+ /**
38
+ * Retrieve customer groups as array
39
+ *
40
+ * @return array
41
+ */
42
+ public function toOptionArray()
43
+ {
44
+ if (!$this->_options) {
45
+ $this->_options = Mage::getResourceModel('customer/group_collection')
46
+ ->setRealGroupsFilter()
47
+ ->loadData()->toOptionArray();
48
+ }
49
+ return $this->_options;
50
+ }
51
+ }
app/code/community/Netzarbeiter/CustomerActivation/Model/Observer.php ADDED
@@ -0,0 +1,431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Netzarbeiter_CustomerActivation_Model_Observer
21
+ {
22
+ const XML_PATH_ALWAYS_NOTIFY_ADMIN = 'customer/customeractivation/always_send_admin_email';
23
+
24
+ /**
25
+ * Fired on customer_login event
26
+ * Check if the customer has been activated (via adminhtml)
27
+ * If not, through login error
28
+ *
29
+ * @param Varien_Event_Observer $observer
30
+ */
31
+ public function customerLogin($observer)
32
+ {
33
+ $helper = Mage::helper('customeractivation');
34
+ if (! $helper->isModuleActive()) {
35
+ return;
36
+ }
37
+
38
+ if ($this->_isApiRequest()) {
39
+ return;
40
+ }
41
+
42
+ $customer = $observer->getEvent()->getCustomer();
43
+ $session = Mage::getSingleton('customer/session');
44
+
45
+ if (!$customer->getCustomerActivated()) {
46
+ /*
47
+ * Fake the old logout() method without deleting the session and all messages
48
+ */
49
+ $session->setCustomer(Mage::getModel('customer/customer'))
50
+ ->setId(null)
51
+ ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
52
+
53
+ if ($this->_checkRequestRoute('customer', 'account', 'createpost')) {
54
+ /*
55
+ * If this is a regular registration, simply display message
56
+ */
57
+ $message = $helper->__('Please wait for your account to be activated');
58
+
59
+ $session->addSuccess($message);
60
+ } else {
61
+ /*
62
+ * All other types of login
63
+ */
64
+ Mage::throwException($helper->__('This account is not activated.'));
65
+ }
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Flag new accounts as such
71
+ *
72
+ * @param Varien_Event_Observer $observer
73
+ */
74
+ public function customerSaveBefore($observer)
75
+ {
76
+ $customer = $observer->getEvent()->getCustomer();
77
+
78
+ $helper = Mage::helper('customeractivation');
79
+ $storeId = $helper->getCustomerStoreId($customer);
80
+
81
+ if (! $helper->isModuleActive($storeId)) {
82
+ return;
83
+ }
84
+
85
+ if (!$customer->getId()) {
86
+ $customer->setCustomerActivationNewAccount(true);
87
+ if (! (Mage::app()->getStore()->isAdmin() && $this->_checkControllerAction('customer', 'save'))) {
88
+ // Do not set the default status on the admin customer edit save action
89
+ $groupId = $customer->getGroupId();
90
+ $defaultStatus = $helper->getDefaultActivationStatus($groupId, $storeId);
91
+ $customer->setCustomerActivated($defaultStatus);
92
+
93
+ if (! $defaultStatus) {
94
+ // Suppress the "enter your billing address for VAT validation" message.
95
+ // This setting will not be saved, its just for this request.
96
+ $helper = Mage::helper('customer/address');
97
+ if (method_exists($helper, 'isVatValidationEnabled')) {
98
+ if (is_callable(array($helper, 'isVatValidationEnabled'))) {
99
+ if (Mage::helper('customer/address')->isVatValidationEnabled($storeId)) {
100
+ Mage::app()->getStore($storeId)->setConfig(
101
+ Mage_Customer_Helper_Address::XML_PATH_VAT_VALIDATION_ENABLED, false
102
+ );
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Send out emails
113
+ *
114
+ * @param Varien_Event_Observer $observer
115
+ */
116
+ public function customerSaveAfter($observer)
117
+ {
118
+ /** @var Mage_Customer_Model_Customer $customer */
119
+ $customer = $observer->getEvent()->getCustomer();
120
+
121
+ $helper = Mage::helper('customeractivation');
122
+ $storeId = $helper->getCustomerStoreId($customer);
123
+
124
+ if (! $helper->isModuleActive($storeId)) {
125
+ return;
126
+ }
127
+
128
+ $groupId = $customer->getGroupId();
129
+ $defaultStatus = $helper->getDefaultActivationStatus($groupId, $storeId);
130
+
131
+ try {
132
+ if (Mage::app()->getStore()->isAdmin()) {
133
+ if (!$customer->getOrigData('customer_activated') && $customer->getCustomerActivated()) {
134
+ // Send customer email only if it isn't a new account and it isn't activated by default
135
+ if (!($customer->getCustomerActivationNewAccount() && $defaultStatus)) {
136
+ $helper->sendCustomerNotificationEmail($customer);
137
+ }
138
+ }
139
+ } else {
140
+ if ($customer->getCustomerActivationNewAccount()) {
141
+ // Only notify the admin if the default is deactivated or the "always notify" flag is configured
142
+ $alwaysNotify = Mage::getStoreConfig(self::XML_PATH_ALWAYS_NOTIFY_ADMIN, $storeId);
143
+ if (!$defaultStatus || $alwaysNotify) {
144
+ $helper->sendAdminNotificationEmail($customer);
145
+ }
146
+ }
147
+ $customer->setCustomerActivationNewAccount(false);
148
+ }
149
+ } catch (Exception $e) {
150
+ Mage::throwException($e->getMessage());
151
+ }
152
+ }
153
+
154
+ public function salesConvertQuoteAddressToOrder(Varien_Event_Observer $observer)
155
+ {
156
+ /** @var $address Mage_Sales_Model_Quote_Address */
157
+ $address = $observer->getEvent()->getAddress();
158
+ $this->_abortCheckoutRegistration($address->getQuote());
159
+ }
160
+
161
+ /**
162
+ * Abort registration during checkout if default activation status is false.
163
+ *
164
+ * Should work with: onepage checkout, multishipping checkout and custom
165
+ * checkout types, as long as they use the standard converter model
166
+ * Mage_Sales_Model_Convert_Quote.
167
+ *
168
+ * Expected state after checkout:
169
+ * - Customer saved
170
+ * - No order placed
171
+ * - Guest quote still contains items
172
+ * - Customer quote contains no items
173
+ * - Customer redirected to login page
174
+ * - Customer sees message
175
+ *
176
+ * @param Mage_Sales_Model_Quote $quote
177
+ */
178
+ protected function _abortCheckoutRegistration(Mage_Sales_Model_Quote $quote)
179
+ {
180
+ $helper = Mage::helper('customeractivation');
181
+ if (! $helper->isModuleActive($quote->getStoreId())) {
182
+ return;
183
+ }
184
+
185
+ if ($this->_isApiRequest()) {
186
+ return;
187
+ }
188
+
189
+ if (!Mage::getSingleton('customer/session')->isLoggedIn() && !$quote->getCustomerIsGuest()) {
190
+ // Order is being created by non-activated customer
191
+ $customer = $quote->getCustomer()->save();
192
+ if (!$customer->getCustomerActivated()) {
193
+ // Abort order placement
194
+ // Exception handling can not be assumed to be useful
195
+
196
+ // Todo: merge guest quote to customer quote and save customer quote, but don't log customer in
197
+
198
+ // Add message
199
+ $message = $helper->__(
200
+ 'Please wait for your account to be activated, then log in and continue with the checkout'
201
+ );
202
+ Mage::getSingleton('core/session')->addSuccess($message);
203
+
204
+ // Handle redirect to login page
205
+ $targetUrl = Mage::getUrl('customer/account/login');
206
+ $response = Mage::app()->getResponse();
207
+
208
+ if (Mage::app()->getRequest()->isAjax()) {
209
+ // Assume one page checkout
210
+ $result = array('redirect' => $targetUrl);
211
+ $response->setBody(Mage::helper('core')->jsonEncode($result));
212
+ } else if ($response->canSendHeaders(true)) {
213
+ // Assume multishipping checkout
214
+ $response->clearHeader('location')
215
+ ->setRedirect($targetUrl);
216
+ }
217
+ $response->sendResponse();
218
+ /* ugly, but we need to stop the further order processing */
219
+ exit();
220
+ }
221
+ }
222
+ }
223
+
224
+ /**
225
+ * Return true if the request is made via the api
226
+ *
227
+ * @return boolean
228
+ */
229
+ protected function _isApiRequest()
230
+ {
231
+ return Mage::app()->getRequest()->getModuleName() === 'api';
232
+ }
233
+
234
+ /**
235
+ * Check the current module, controller and action against the given values.
236
+ *
237
+ * @param string $module
238
+ * @param string $controller
239
+ * @param string $action
240
+ * @return bool
241
+ */
242
+ protected function _checkRequestRoute($module, $controller, $action)
243
+ {
244
+ $req = Mage::app()->getRequest();
245
+ if (strtolower($req->getModuleName()) == $module
246
+ && strtolower($req->getControllerName()) == $controller
247
+ && strtolower($req->getActionName()) == $action
248
+ ) {
249
+ return true;
250
+ }
251
+ return false;
252
+ }
253
+
254
+ /**
255
+ * Check the current controller and action match the passed names
256
+ *
257
+ * @param string $controller
258
+ * @param string $action
259
+ * @return bool
260
+ */
261
+ protected function _checkControllerAction($controller, $action)
262
+ {
263
+ $req = Mage::app()->getRequest();
264
+ return $this->_checkRequestRoute($req->getModuleName(), $controller, $action);
265
+ }
266
+
267
+ /**
268
+ * Add customer activation option to the mass action block.
269
+ *
270
+ * This can't be done during the block abstract event
271
+ *
272
+ * @param Varien_Event_Observer $observer
273
+ */
274
+ public function adminhtmlBlockHtmlBefore(Varien_Event_Observer $observer)
275
+ {
276
+ // Check the grid is the customer grid
277
+ if ($observer->getBlock()->getId() != 'customerGrid') {
278
+ return;
279
+ }
280
+
281
+ // Check if there is a massaction block and if yes, add the massaction for customeractivation
282
+ $massBlock = $observer->getBlock()->getMassactionBlock();
283
+ if ($massBlock) {
284
+ /** @var $helper Netzarbeiter_CustomerActivation_Helper_Data */
285
+ $helper = Mage::helper('customeractivation');
286
+
287
+ if (! $helper->isModuleActiveInAdmin()) {
288
+ return;
289
+ }
290
+
291
+ $noEmail = Netzarbeiter_CustomerActivation_Helper_Data::STATUS_ACTIVATE_WITHOUT_EMAIL;
292
+ $withEmail = Netzarbeiter_CustomerActivation_Helper_Data::STATUS_ACTIVATE_WITH_EMAIL;
293
+ $deactivate = Netzarbeiter_CustomerActivation_Helper_Data::STATUS_DEACTIVATE;
294
+
295
+ $massBlock->addItem(
296
+ 'customer_activated',
297
+ array(
298
+ 'label' => $helper->__('Customer Activated'),
299
+ 'url' => Mage::getUrl('customeractivation/admin/massActivation'),
300
+ 'additional' => array(
301
+ 'status' => array(
302
+ 'name' => 'customer_activated',
303
+ 'type' => 'select',
304
+ 'class' => 'required-entry',
305
+ 'label' => $helper->__('Customer Activated'),
306
+ 'values' => array(
307
+ $noEmail => $helper->__('Yes (No Notification)'),
308
+ $withEmail => $helper->__('Yes (With Notification)'),
309
+ $deactivate => $helper->__('No')
310
+ )
311
+ )
312
+ )
313
+ )
314
+ );
315
+ }
316
+ }
317
+
318
+ /**
319
+ * Add the customer_activated attribute to the customer grid collection
320
+ *
321
+ * @param Varien_Event_Observer $observer
322
+ */
323
+ public function eavCollectionAbstractLoadBefore(Varien_Event_Observer $observer)
324
+ {
325
+ if (! Mage::helper('customeractivation')->isModuleActiveInAdmin()) {
326
+ return;
327
+ }
328
+
329
+ if (Mage::app()->getRequest()->getControllerName() !== 'customer') {
330
+ return;
331
+ }
332
+
333
+ /** @var $collection Mage_Customer_Model_Resource_Customer_Collection */
334
+ $collection = $observer->getEvent()->getCollection();
335
+
336
+ // Only add attribute to customer collections
337
+ $customerTypeId = Mage::getSingleton('eav/config')->getEntityType('customer')->getId();
338
+ $collectionTypeId = $collection->getEntity()->getTypeId();
339
+ if ($customerTypeId == $collectionTypeId) {
340
+ $collection->addAttributeToSelect('customer_activated');
341
+
342
+ }
343
+ }
344
+
345
+ /**
346
+ * Add customer_activated column to CSV and XML exports
347
+ *
348
+ * @param Varien_Event_Observer $observer
349
+ */
350
+ public function coreBlockAbstractPrepareLayoutAfter(Varien_Event_Observer $observer)
351
+ {
352
+ if (! Mage::helper('customeractivation')->isModuleActiveInAdmin()) {
353
+ return;
354
+ }
355
+
356
+ if (Mage::app()->getRequest()->getControllerName() !== 'customer') {
357
+ return;
358
+ }
359
+
360
+ $block = $observer->getBlock();
361
+ if ($block->getType() === 'adminhtml/customer_grid') {
362
+ // I don't think we need to limit applying the column by action
363
+ //$action = Mage::app()->getRequest()->getActionName();
364
+ //if (in_array($action, array('grid', 'index', 'exportCsv', 'exportXml'))) {
365
+
366
+ $this->_addActivationStatusColumn($block);
367
+
368
+ //}
369
+ }
370
+ }
371
+
372
+ /**
373
+ * Add the activation status column to the customer grid block.
374
+ *
375
+ * This is used from different events when displaying the block as well as
376
+ * during exporting the grid to CSV or XML.
377
+ *
378
+ * @param Mage_Adminhtml_Block_Widget_Grid $block
379
+ */
380
+ protected function _addActivationStatusColumn(Mage_Adminhtml_Block_Widget_Grid $block)
381
+ {
382
+ /** @var $helper Netzarbeiter_CustomerActivation_Helper_Data */
383
+ $helper = Mage::helper('customeractivation');
384
+
385
+ // Add the attribute as a column to the grid
386
+ $block->addColumnAfter(
387
+ 'customer_activated',
388
+ array(
389
+ 'header' => $helper->__('Customer Activated'),
390
+ 'align' => 'center',
391
+ 'width' => '80px',
392
+ 'type' => 'options',
393
+ 'options' => array(
394
+ '0' => $helper->__('No'),
395
+ '1' => $helper->__('Yes')
396
+ ),
397
+ 'default' => '0',
398
+ 'index' => 'customer_activated',
399
+ 'renderer' => 'customeractivation/adminhtml_widget_grid_column_renderer_boolean'
400
+ ),
401
+ 'customer_since'
402
+ );
403
+
404
+ // Set the new columns order.. otherwise our column would be the last one
405
+ $block->sortColumnsByOrder();
406
+ }
407
+
408
+ /**
409
+ * Reportedly on Magento 1.6 customers are logged in automatically
410
+ * by the lost password functionality (must be some customization actually).
411
+ *
412
+ * This observer method removes the customer id from the customer/session,
413
+ * in effect causing a logout just in case.
414
+ *
415
+ * @param Varien_Event_Observer $observer
416
+ */
417
+ public function controllerActionPostdispatchCustomerAccountResetPasswordPost(Varien_Event_Observer $observer)
418
+ {
419
+ if (! Mage::helper('customeractivation')->isModuleActive()) {
420
+ return;
421
+ }
422
+ if (version_compare(Mage::getVersion(), '1.7', '<')) {
423
+ $session = Mage::getSingleton('customer/session');
424
+ $customer = $session->getCustomer();
425
+ if (!$customer->getCustomerActivated() && $session->isLoggedIn()) {
426
+ $session->setCustomerId(null)->setId(null);
427
+ }
428
+ }
429
+
430
+ }
431
+ }
app/code/community/Netzarbeiter/CustomerActivation/Model/Resource/Customer.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Netzarbeiter_CustomerActivation_Model_Resource_Customer
21
+ extends Mage_Eav_Model_Entity_Abstract
22
+ {
23
+ /**
24
+ * Emulate customer resource model for easy access
25
+ */
26
+ protected function _construct()
27
+ {
28
+ $this->setType('customer');
29
+ $this->setConnection('customer_read', 'customer_write');
30
+ return parent::_construct();
31
+ }
32
+
33
+ /**
34
+ * Attempt to quickly set the specified customer activation status
35
+ *
36
+ * @param array $customerIds
37
+ * @param int $value
38
+ * @return $this
39
+ */
40
+ public function massSetActivationStatus(array $customerIds, $value)
41
+ {
42
+ $customerIds = $this->_getValidCustomerIds($customerIds);
43
+ $changeIds = array();
44
+ if ($customerIds) {
45
+ $attribute = $this->getAttribute('customer_activated');
46
+ $table = $attribute->getBackend()->getTable();
47
+
48
+ $select = $this->getReadConnection()->select()
49
+ ->from($table, 'entity_id')
50
+ ->where('entity_id IN (?)', $customerIds)
51
+ ->where('attribute_id = ?', $attribute->getId())
52
+ ->where('value = ?', $value);
53
+ $noChangeIds = $this->_getReadAdapter()->fetchCol($select);
54
+
55
+ $changeIds = array_diff($customerIds, $noChangeIds);
56
+ $select = $this->_getReadAdapter()->select()
57
+ ->from($table, 'entity_id')
58
+ ->where('entity_id IN (?)', $changeIds)
59
+ ->where('attribute_id = ?', $attribute->getId());
60
+
61
+ $updateIds = $this->_getReadAdapter()->fetchCol($select);
62
+ $insertIds = array_diff($changeIds, $updateIds);
63
+
64
+ if ($updateIds) {
65
+ $cond = $this->_getWriteAdapter()->quoteInto('entity_type_id = ?', $this->getEntityType()->getId());
66
+ $cond .= $this->_getWriteAdapter()->quoteInto(' AND attribute_id = ?', $attribute->getId());
67
+ $cond .= $this->_getWriteAdapter()->quoteInto(' AND entity_id IN (?)', $updateIds);
68
+ $this->_getWriteAdapter()->update($table, array('value' => $value), $cond);
69
+ }
70
+ if ($insertIds) {
71
+ $rows = array();
72
+ foreach ($insertIds as $customerId) {
73
+ $rows[] = array(
74
+ 'entity_type_id' => $this->getEntityType()->getId(),
75
+ 'attribute_id' => $attribute->getId(),
76
+ 'entity_id' => $customerId,
77
+ 'value' => $value
78
+ );
79
+ }
80
+ $this->_getWriteAdapter()->insertMultiple($table, $rows);
81
+ }
82
+ }
83
+ return $changeIds;
84
+ }
85
+
86
+ /**
87
+ * Return an array containing the valid subset of the specified customer IDs
88
+ *
89
+ * @param array $customerIds
90
+ * @return array
91
+ */
92
+ protected function _getValidCustomerIds(array $customerIds)
93
+ {
94
+ $column = $this->getEntityIdField();
95
+ $select = $this->_getReadAdapter()->select()
96
+ ->from($this->getEntityTable(), $column)
97
+ ->where($column . ' IN (?)', $customerIds);
98
+ return $this->_getReadAdapter()->fetchCol($select);
99
+ }
100
+ }
app/code/community/Netzarbeiter/CustomerActivation/README.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Customer Activation
2
+ ============================
3
+ Make it impossible for a customer to log in until the account has been activated by the admin.
4
+
5
+ Facts
6
+ -----
7
+ - version: check the [config.xml](https://github.com/Vinai/customer-activation/blob/master/app/code/community/Netzarbeiter/CustomerActivation/etc/config.xml)
8
+ - extension key: Netzarbeiter_CustomerActivation
9
+ - extension on Magento Connect: -
10
+ - Magento Connect 1.0 extension key: -
11
+ - Magento Connect 2.0 extension key: -
12
+ - [extension on GitHub](https://github.com/Vinai/customer-activation)
13
+ - [direct download link](https://github.com/Vinai/customer-activation/zipball/master)
14
+
15
+ Description
16
+ -----------
17
+ This small extension makes it impossible for a customer to log in to magento,
18
+ until the account has been activated in the adminhtml interface.
19
+
20
+ Customers - Manage Customers - (select customer) - Account Information - Is activated
21
+
22
+ You can also select email notifications for the admin (when a new customer registers) and
23
+ for the customer (when her account has been activated).
24
+
25
+ New customers can be configured to be activated by default. This can also be done on a per group basis.
26
+
27
+ The Extension was designed to be used together with the [Netzarbeiter_LoginCatalog][] extension.
28
+ Netzarbeiter_LoginCatalog only shows products to customers that are logged in.
29
+ There also is the Extension [Netzarbeiter_GroupsCatalog2][] which may suit your needs better,
30
+ you have to evaluate yourself what is the best solution for your case.
31
+
32
+ [Netzarbeiter_LoginCatalog]: https://github.com/Vinai/loginonlycatalog/ "The Login only Catalog Extension on github"
33
+ [Netzarbeiter_GroupsCatalog2]: https://github.com/Vinai/groupscatalog2 "GroupsCatalog 2"
34
+
35
+ Compatibility
36
+ -------------
37
+ - Magento >= 1.4
38
+
39
+ Installation Instructions
40
+ -------------------------
41
+ 1. Install the extension via Magento Connect with the key shown above or copy all the files into your document root.
42
+ 2. Clear the cache, logout from the admin panel and then login again.
43
+ 3. Configure and activate the extension under System - Configuration - Customer Configuration - Customer Activation
44
+
45
+ If you have existing customers prior to installing the extension, they will be deactivated by default.
46
+ You can easily and quickly activate all existing accounts using the mass action found above the customer backend grid.
47
+
48
+ Uninstallation Instructions
49
+ ---------------------------
50
+ 1. Delete the file app/etc/modules/Netzarbeiter_CustomerActivation.xml
51
+ 2. Execute the following SQL:
52
+ ```
53
+ DELETE FROM eav_attribute WHERE attribute_code = 'customer_activated';
54
+ ```
55
+ ```
56
+ DELETE FROM core_resource WHERE code = 'customeractivation_setup';
57
+ ```
58
+ 3. Remove all remaining extension files
59
+ - app/code/community/Netzarbeiter/CustomerActivation/
60
+ - app/locale/*/Netzarbeiter_CustomerActivation.csv
61
+ - app/locale/*/template/email/netzarbeiter/customeractivation
62
+
63
+ Acknowledgements
64
+ ----------------
65
+ - Thanks to Max for the updated french translation!
66
+ - Thanks to Junya Sano for the japanese translation!
67
+ - Thanks to SeL for the french translation and the bugfix!
68
+ - Thanks to SeL also for reporting the backend customer creation bug.
69
+ - Thanks to Toon van Veelen for the dutch translation!
70
+ - Thanks to Erik Hoeksma for the Greek translation!
71
+ - Thanks to PaulE for the integration in the admin grid for mass activation of customers!
72
+ - Thanks to Finn Snaterse for the inclusion in the Adminhtml Grid!
73
+ - Thanks to Aaron Kondziela for reminding me to clean up the admin customer edit page stuff!
74
+ - Thanks to Chiara Piatti for the italian translation!
75
+
76
+ Support
77
+ -------
78
+ If you have any issues with this extension, open an issue on GitHub (see URL above)
79
+
80
+ Contribution
81
+ ------------
82
+ Any contributions are highly appreciated. The best way to contribute code is to open a
83
+ [pull request on GitHub](https://help.github.com/articles/using-pull-requests).
84
+
85
+ Developer
86
+ ---------
87
+ Vinai Kopp
88
+ [http://www.netzarbeiter.com](http://www.netzarbeiter.com)
89
+ [@VinaiKopp](https://twitter.com/VinaiKopp)
90
+
91
+ Licence
92
+ -------
93
+ [OSL - Open Software Licence 3.0](http://opensource.org/licenses/osl-3.0.php)
94
+
95
+ Copyright
96
+ ---------
97
+ (c) 2014 Vinai Kopp
app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/AbstractController.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Netzarbeiter_CustomerActivation_Test_Controller_Adminhtml_AbstractController
5
+ extends EcomDev_PHPUnit_Test_Case_Controller
6
+ {
7
+ /**
8
+ * Mock the admin session and the adminhtml notifications
9
+ */
10
+ protected function setUp()
11
+ {
12
+ parent::setUp();
13
+
14
+ $this->mockAdminSession();
15
+ $this->disableAdminNotifications();
16
+ }
17
+
18
+ /**
19
+ * Build the admin session mock
20
+ */
21
+ protected function mockAdminSession()
22
+ {
23
+ $mockUser = $this->getModelMock('admin/user');
24
+ $mockUser->expects($this->any())
25
+ ->method('getId')
26
+ ->will($this->returnValue(1));
27
+
28
+ $mockSession = $this->getModelMockBuilder('admin/session')
29
+ ->disableOriginalConstructor()
30
+ ->setMethods(array('isLoggedIn', 'getUser', 'refreshAcl', 'isAllowed'))
31
+ ->getMock();
32
+
33
+ $mockSession->expects($this->any())
34
+ ->method('isLoggedIn')
35
+ ->will($this->returnValue(true));
36
+
37
+ $mockSession->expects($this->any())
38
+ ->method('refreshAcl')
39
+ ->will($this->returnSelf());
40
+
41
+ $mockSession->expects($this->any())
42
+ ->method('isAllowed')
43
+ ->will($this->returnValue(true));
44
+
45
+ $this->replaceByMock('model', 'admin/user', $mockUser);
46
+
47
+ $mockSession->expects($this->any())
48
+ ->method('getUser')
49
+ ->will($this->returnValue($mockUser));
50
+
51
+ $this->replaceByMock('singleton', 'admin/session', $mockSession);
52
+ }
53
+
54
+ /**
55
+ * Disable the admin notification rss feed
56
+ */
57
+ protected function disableAdminNotifications()
58
+ {
59
+ // Disable notification feed during test
60
+ $mockFeed = $this->getModelMockBuilder('adminnotification/feed')
61
+ ->disableOriginalConstructor()
62
+ ->setMethods(array('checkUpdate', 'getFeedData'))
63
+ ->getMock();
64
+ $mockFeed->expects($this->any())
65
+ ->method('checkUpdate')
66
+ ->will($this->returnSelf());
67
+ $mockFeed->expects($this->any())
68
+ ->method('getFeedData')
69
+ ->will($this->returnValue(''));
70
+
71
+ $this->replaceByMock('model', 'adminnotification/feed', $mockFeed);
72
+ }
73
+ }
app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/AdminControllerTest.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @see Netzarbeiter_CustomerActivation_AdminController
5
+ *
6
+ * @loadSharedFixture global.yaml
7
+ * @doNotIndexAll
8
+ */
9
+ class Netzarbeiter_CustomerActivation_Test_Controller_Adminhtml_AdminControllerTest
10
+ extends Netzarbeiter_CustomerActivation_Test_Controller_Adminhtml_AbstractController
11
+ {
12
+ /**
13
+ * Force a customer customer_activation attribute to be a specific value (in case of null remove record)
14
+ *
15
+ * This hack is needed because the eav fixture generator does not set null values.
16
+ *
17
+ * @param int $customerId
18
+ * @see EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Abstract::_getAttributeRecords()
19
+ */
20
+ protected function _initCustomer($customerId)
21
+ {
22
+ $value = $this->expected("initial-status-%s", $customerId)->getCustomerActivated();
23
+
24
+ /** @var Mage_Eav_Model_Entity_Attribute_Abstract $attribute */
25
+ $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'customer_activated');
26
+ /** @var Varien_Db_Adapter_Pdo_Mysql $con */
27
+ $con = Mage::getSingleton('core/resource')->getConnection('customer_write');
28
+ $table = $attribute->getBackend()->getTable();
29
+
30
+ $where = array();
31
+ $where[] = $con->quoteInto('entity_id = ?', $customerId);
32
+ $where[] = $con->quoteInto('attribute_id = ?', $attribute->getId());
33
+
34
+ if (is_null($value)) {
35
+ $con->delete($table, implode(' AND ', $where));
36
+
37
+ } else {
38
+ $select = $con->select()->from($table, new Zend_Db_Expr('COUNT(*)'))
39
+ ->where('entity_id = ?', $customerId)
40
+ ->where('attribute_id = ?', $attribute->getId());
41
+ $exists = $con->fetchOne($select);
42
+
43
+ if ($exists) {
44
+ $con->update($table, array('value' => $value), implode(' AND ', $where));
45
+
46
+ } else {
47
+ $con->insert($table, array(
48
+ 'entity_id' => $customerId,
49
+ 'entity_type_id' => $attribute->getEntity()->getId(),
50
+ 'attribute_id' => $attribute->getId(),
51
+ 'value' => $value
52
+ ));
53
+ }
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Check the passed customer ID's match the expected initial activation status
59
+ *
60
+ * @param $testCustomerIds
61
+ */
62
+ public function assertInitialStatus($testCustomerIds)
63
+ {
64
+ $customers = Mage::getResourceModel('customer/customer_collection')
65
+ ->addAttributeToFilter('entity_id', array('in' => $testCustomerIds))
66
+ ->addAttributeToSelect('customer_activated');
67
+
68
+ foreach ($testCustomerIds as $customerId) {
69
+ $customer = $customers->getItemById($customerId);
70
+ $expectedStatus = $this->expected("initial-status-%s", $customerId)->getCustomerActivated();
71
+ $realStatus = $customer->getData('customer_activated');
72
+ $message = sprintf("Expected customer %d to initially be %s but found to be %s",
73
+ $customer->getId(),
74
+ ($expectedStatus ? 'activated' : 'deactivated'),
75
+ ($realStatus ? 'activated' : 'deactivated')
76
+ );
77
+
78
+ $this->assertEquals($expectedStatus, $realStatus, $message);
79
+ }
80
+ }
81
+
82
+ /**
83
+ * @param array $testCustomerIds
84
+ * @param array $postCustomerIds
85
+ * @param int $status Activate or deactivate customers
86
+ *
87
+ * @test
88
+ * @loadFixture customers.yaml
89
+ * @dataProvider dataProvider
90
+ */
91
+ public function massActivation($testCustomerIds, $postCustomerIds, $status)
92
+ {
93
+ // Hack to work around fixture limitation:
94
+ // Force customer 3 initial value not to be set according to fixture file
95
+ $this->_initCustomer(3);
96
+
97
+ $this->assertInitialStatus($testCustomerIds);
98
+
99
+ $params = array(
100
+ '_store' => 'admin',
101
+ '_query' => array(
102
+ 'customer' => $postCustomerIds,
103
+ 'customer_activated' => (int) $status
104
+ )
105
+ );
106
+
107
+ $this->dispatch('customeractivation/admin/massActivation', $params);
108
+
109
+ $expectations = $this->expected(
110
+ "%s-%s-%d", implode(',', $testCustomerIds), implode(',', $postCustomerIds), $status
111
+ );
112
+
113
+ $customers = Mage::getResourceModel('customer/customer_collection')
114
+ ->addAttributeToFilter('entity_id', array('in' => $testCustomerIds))
115
+ ->addAttributeToSelect('customer_activated');
116
+
117
+ foreach ($testCustomerIds as $customerId) {
118
+ $customer = $customers->getItemById($customerId);
119
+ $expectedStatus = $expectations->getData('customer' . $customerId);
120
+ $realStatus = $customer->getData('customer_activated');
121
+ $message = sprintf("Expected customer %d to be %s but found to be %s",
122
+ $customer->getId(),
123
+ ($expectedStatus ? 'activated' : 'deactivated'),
124
+ ($realStatus ? 'activated' : 'deactivated')
125
+ );
126
+
127
+ $this->assertEquals($expectedStatus, $realStatus, $message);
128
+ }
129
+ }
130
+ }
app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/CustomerGridTest.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Netzarbeiter_CustomerActivation_Test_Controller_Adminhtml_CustomerGridTest
4
+ extends Netzarbeiter_CustomerActivation_Test_Controller_Adminhtml_AbstractController
5
+ {
6
+ protected function _overloadExit()
7
+ {
8
+ if (function_exists('set_exit_overload')) {
9
+ set_exit_overload(function () {
10
+ return false;
11
+ });
12
+ return true;
13
+ } elseif (function_exists('uopz_overload')) {
14
+ if (! ini_get('uopz.overloads')) {
15
+ $this->markTestSkipped('uopz extension installed but uopz.overloads ini setting is disabled.');
16
+ }
17
+ uopz_overload(ZEND_EXIT, function(){});
18
+ return true;
19
+ }
20
+ return false;
21
+ }
22
+
23
+ protected function _restoreExit()
24
+ {
25
+ if (function_exists('unset_exit_overload')) {
26
+ unset_exit_overload();
27
+ } elseif (function_exists('uopz_overload')) {
28
+ uopz_overload(ZEND_EXIT, null);
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Requires krakjoe/uopz or phpunit/test_helpers to be installed so exit() can be overloaded.
34
+ *
35
+ * See https://github.com/krakjoe/uopz
36
+ * and https://github.com/sebastianbergmann/php-test-helpers
37
+ * and https://github.com/whatthejeff/php-test-helpers (a pull request so it compiles for PHP 5.4)
38
+ *
39
+ * @param string $route
40
+ * @throws Exception|Zend_Controller_Response_Exception
41
+ * @return string
42
+ */
43
+ protected function getResponseFromActionWithExit($route)
44
+ {
45
+ if (! $this->_overloadExit()) {
46
+ $this->markTestSkipped("Unable to overload exit(): uopz or phpunit/test_helpers zend extensions not installed.");
47
+ }
48
+
49
+ try {
50
+ ob_start();
51
+ $this->dispatch($route);
52
+ $this->_restoreExit();
53
+ } catch (Zend_Controller_Response_Exception $e) {
54
+ $this->_restoreExit();
55
+ if ($e->getMessage() !== 'Cannot send headers; headers already sent') {
56
+ ob_end_clean();
57
+ throw $e;
58
+ }
59
+ }
60
+ $responseBody = ob_get_contents();
61
+ ob_end_clean();
62
+ return $responseBody;
63
+ }
64
+
65
+ /**
66
+ *
67
+ * @param string $action
68
+ *
69
+ * @test
70
+ * @singleton admin/session
71
+ * @dataProvider activationStatusGridModificationsProvider
72
+ */
73
+ public function activationStatusGridModifications($action)
74
+ {
75
+ $this->dispatch('adminhtml/customer/' . $action);
76
+
77
+ $this->assertLayoutHandleLoaded('adminhtml_customer_' . $action);
78
+ $this->assertEventDispatched('eav_collection_abstract_load_before');
79
+
80
+ // Check grid block is instantiated
81
+ $gridBlock = $this->_getCustomerGridBlock();
82
+ $this->assertInternalType('object', $gridBlock, "Customer grid block not found");
83
+ $this->assertInstanceOf('Mage_Adminhtml_Block_Customer_Grid', $gridBlock);
84
+
85
+ // Check if customer_activation column is defined
86
+ $foundActivationCol = $gridBlock->getColumn('customer_activated') !== false;
87
+ $this->assertTrue($foundActivationCol, "Customer activation column not found in grid");
88
+
89
+ // Check mass action is defined
90
+ /** @var Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract $massActionBlock */
91
+ $massActionBlock = $gridBlock->getMassactionBlock();
92
+ $massAction = $massActionBlock->getItem('customer_activated');
93
+ $this->assertTrue((bool) $massAction, "Customer activation mass action not found");
94
+
95
+ // Check customer activation attribute was loaded on customer collection
96
+ /** @var Mage_Customer_Model_Resource_Customer_Collection $collection */
97
+ $collection = $gridBlock->getCollection();
98
+ $property = new ReflectionProperty($collection, '_selectAttributes');
99
+ $property->setAccessible(true);
100
+ $selectAttributes = $property->getValue($collection);
101
+
102
+ $this->assertArrayHasKey(
103
+ 'customer_activated', $selectAttributes, "Customer activation attribute not part of collection"
104
+ );
105
+ }
106
+
107
+ /**
108
+ * @return Mage_Adminhtml_Block_Customer_Grid
109
+ */
110
+ protected function _getCustomerGridBlock()
111
+ {
112
+ foreach ($this->app()->getLayout()->getAllBlocks() as $block) {
113
+ if ($block->getType() === 'adminhtml/customer_grid') {
114
+ return $block;
115
+ }
116
+ }
117
+ return null;
118
+ }
119
+
120
+ /**
121
+ * Data Provider for activationStatusGridModifications test
122
+ * with adminhtml customer controller actions.
123
+ *
124
+ * @return array
125
+ */
126
+ public function activationStatusGridModificationsProvider()
127
+ {
128
+ return array(
129
+ array('index'),
130
+ array('grid'),
131
+ );
132
+ }
133
+
134
+ /**
135
+ * @test
136
+ */
137
+ public function activationStatusInCsvExport()
138
+ {
139
+ $body = $this->getResponseFromActionWithExit('adminhtml/customer/exportCsv');
140
+
141
+ $this->assertResponseHeaderEquals('content-type', 'application/octet-stream');
142
+
143
+ $label = 'Customer Activated';
144
+
145
+ list($exportHeaders) = explode("\n", $body);
146
+ $columns = str_getcsv($exportHeaders);
147
+
148
+ $this->assertTrue(in_array($label, $columns), "Column \"$label\" not found in CSV export columns");
149
+ }
150
+
151
+ /**
152
+ * @test
153
+ */
154
+ public function activationStatusInExcelExport()
155
+ {
156
+ $body = $this->getResponseFromActionWithExit('adminhtml/customer/exportXml');
157
+
158
+ $this->assertResponseHeaderEquals('content-type', 'application/octet-stream');
159
+
160
+ $label = 'Customer Activated';
161
+
162
+ /** @var SimpleXmlElement $xml */
163
+ $xml = simplexml_load_string($body);
164
+ $found = false;
165
+ foreach ($xml->Worksheet->children() as $worksheet) {
166
+ foreach ($worksheet->children() as $columns) {
167
+ foreach ($columns->children() as $cell) {
168
+ $value = (string) $cell->Data;
169
+ if ($value == $label) {
170
+ $found = true;
171
+ break(3);
172
+ }
173
+ }
174
+ // Only check the first row
175
+ break(2);
176
+ }
177
+ }
178
+
179
+ $this->assertTrue($found, "Column \"$label\" not found in Excel export columns");
180
+ }
181
+ }
app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/expectations/massActivation.yaml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Netzarbeiter
3
+ #
4
+ # NOTICE OF LICENSE
5
+ #
6
+ # This source file is subject to the Open Software License (OSL 3.0)
7
+ # that is bundled with this package in the file LICENSE.txt.
8
+ # It is also available through the world-wide-web at this URL:
9
+ # http://opensource.org/licenses/osl-3.0.php
10
+ #
11
+ # DISCLAIMER
12
+ #
13
+ # Do not edit or add to this file if you wish to upgrade this Module to
14
+ # newer versions in the future.
15
+ #
16
+ # @category Netzarbeiter
17
+ # @package Netzarbeiter_CustomerActivation
18
+ # @copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com
19
+ # @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ #
21
+
22
+ #
23
+ # Test case expectations
24
+ #
25
+
26
+ #
27
+ # Initial customer activation states
28
+ # customer_id | customer_activated
29
+ # 1 | 1
30
+ # 2 | 0
31
+ # 3 | null
32
+ #
33
+
34
+ initial-status-1:
35
+ customer_activated: 1
36
+ initial-status-2:
37
+ customer_activated: 0
38
+ initial-status-3:
39
+ customer_activated: null
40
+
41
+ 1,2,3-1,2,3-1: # Test Customer Ids, Post Customer ids, Status
42
+ customer1: 1
43
+ customer2: 1
44
+ customer3: 1
45
+
46
+ 1,2,3-1,2,3-0:
47
+ customer1: 0
48
+ customer2: 0
49
+ customer3: 0
50
+
51
+ 1,2,3-1,2-1:
52
+ customer1: 1
53
+ customer2: 1
54
+ customer3: 0
55
+
56
+ 1,2,3-1-0:
57
+ customer1: 0
58
+ customer2: 0
59
+ customer3: 0
60
+
61
+ 1,2,3-3-1:
62
+ customer1: 1
63
+ customer2: 0
64
+ customer3: 1
app/code/community/Netzarbeiter/CustomerActivation/Test/Controller/Adminhtml/providers/massActivation.yaml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Netzarbeiter
3
+ #
4
+ # NOTICE OF LICENSE
5
+ #
6
+ # This source file is subject to the Open Software License (OSL 3.0)
7
+ # that is bundled with this package in the file LICENSE.txt.
8
+ # It is also available through the world-wide-web at this URL:
9
+ # http://opensource.org/licenses/osl-3.0.php
10
+ #
11
+ # DISCLAIMER
12
+ #
13
+ # Do not edit or add to this file if you wish to upgrade this Module to
14
+ # newer versions in the future.
15
+ #
16
+ # @category Netzarbeiter
17
+ # @package Netzarbeiter_CustomerActivation
18
+ # @copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com
19
+ # @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ #
21
+
22
+ #
23
+ # Initial customer activation states
24
+ # customer_id | customer_activated
25
+ # 1 | 1
26
+ # 2 | 0
27
+ # 3 | null
28
+ #
29
+
30
+ - # Test Customer Ids, Post Customer Ids, Activation State
31
+ - [1, 2, 3]
32
+ - [1, 2, 3]
33
+ - 1
34
+ -
35
+ - [1, 2, 3]
36
+ - [1, 2, 3]
37
+ - 0
38
+ -
39
+ - [1, 2, 3]
40
+ - [1, 2]
41
+ - 1
42
+ -
43
+ - [1, 2, 3]
44
+ - [1]
45
+ - 0
46
+ -
47
+ - [1, 2, 3]
48
+ - [3]
49
+ - 1
app/code/community/Netzarbeiter/CustomerActivation/Test/Helper/Data/Mock/Zend/Mail.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Netzarbeiter_CustomerActivation_Test_Helper_Data_Mock_Zend_Mail
5
+ extends Zend_Mail
6
+ {
7
+ protected $_sendCount = 0;
8
+
9
+ /**
10
+ * Disable the send() method, retain all other methods.
11
+ *
12
+ * @param Zend_Mail_Transport_Abstract $transport
13
+ * @return Zend_Mail
14
+ */
15
+ public function send($transport = null)
16
+ {
17
+ $transport; // Not needed, but just in case
18
+ $this->_sendCount++;
19
+ return $this;
20
+ }
21
+
22
+ public function getSendCount()
23
+ {
24
+ return $this->_sendCount;
25
+ }
26
+
27
+ public function setSendCount($count)
28
+ {
29
+ $this->_sendCount = (int) $count;
30
+ }
31
+ }
app/code/community/Netzarbeiter/CustomerActivation/Test/Helper/DataTest.php ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Netzarbeiter
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade this Module to
16
+ * newer versions in the future.
17
+ *
18
+ * @category Netzarbeiter
19
+ * @package Netzarbeiter_CustomerActivation
20
+ * @copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ /**
25
+ * @see Netzarbeiter_CustomerActivation_Helper_Data
26
+ *
27
+ * @loadSharedFixture global.yaml
28
+ * @doNotIndexAll
29
+ */
30
+ class Netzarbeiter_CustomerActivation_Test_Helper_DataTest extends EcomDev_PHPUnit_Test_Case
31
+ {
32
+ /**
33
+ * Mock of Zend_Mail instance to access properties after send() is called
34
+ *
35
+ * @var Netzarbeiter_CustomerActivation_Test_Helper_Data_Mock_Zend_Mail
36
+ */
37
+ protected $_mail = null;
38
+
39
+ /**
40
+ * @var string
41
+ */
42
+ protected $_originalLocale = null;
43
+
44
+ /**
45
+ * Ssave the original locale
46
+ */
47
+ protected function setUp()
48
+ {
49
+ if (is_null($this->_originalLocale)) {
50
+ $this->_originalLocale = $this->app()->getLocale()->getLocaleCode();
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Restore the admin store score, reset mail send count and original locale
56
+ */
57
+ protected function tearDown()
58
+ {
59
+ if ($this->_mail) {
60
+ $this->_mail->setSendCount(0);
61
+ $this->_mail->clearRecipients()->setParts(array());
62
+ }
63
+ if (isset($this->_originalLocale)) {
64
+ $this->app()->getLocale()->setLocaleCode($this->_originalLocale);
65
+ }
66
+ }
67
+
68
+ /**
69
+ * @return Mage_Customer_Model_Customer
70
+ */
71
+ protected function _getMockCustomer()
72
+ {
73
+ $mockCustomer = $this->getModelMockBuilder('customer/customer')
74
+ ->disableOriginalConstructor()
75
+ ->setMethods(array('getName', 'getEmail', 'getSendemailStoreId', 'getStoreId', 'getAddressesCollection'))
76
+ ->getMock();
77
+ $mockCustomer->expects($this->any())
78
+ ->method('getSendemailStoreId')
79
+ ->will($this->returnValue(null));
80
+ $mockCustomer->expects($this->any())
81
+ ->method('getStoreId')
82
+ ->will($this->returnValue($this->app()->getStore('usa')->getId()));
83
+ $mockCustomer->expects($this->any())
84
+ ->method('getName')
85
+ ->will($this->returnValue('John Doe'));
86
+ $mockCustomer->expects($this->any())
87
+ ->method('getEmail')
88
+ ->will($this->returnValue('John.Doe@example.com'));
89
+ $mockCustomer->expects(($this->any()))
90
+ ->method('getAddressesCollection')
91
+ ->will($this->returnValue(new Varien_Object()));
92
+
93
+ return $mockCustomer;
94
+ }
95
+
96
+ /**
97
+ * Inject a mocked Zend_Mail instance into core/email_instance
98
+ *
99
+ * The purpose is to avoid calls to send() to actually do something. Keep
100
+ * all other functionality intact.
101
+ */
102
+ protected function _prepareEmailTemplateInstance()
103
+ {
104
+ $this->_mail = new Netzarbeiter_CustomerActivation_Test_Helper_Data_Mock_Zend_Mail();
105
+
106
+ $mailTemplate = Mage::getModel('core/email_template');
107
+ $property = new ReflectionProperty($mailTemplate, '_mail');
108
+ $property->setAccessible(true);
109
+ $property->setValue($mailTemplate, $this->_mail);
110
+
111
+ // Unable to use $this->replaceByMock() because $mailTemplate is no instance
112
+ // of PHPUnit_Framework_MockObject_MockObject
113
+ $this->app()->getConfig()->replaceInstanceCreation('model', 'core/email_template', $mailTemplate);
114
+ }
115
+
116
+ /**
117
+ * Simple data provider of locales and matching strings from the email template
118
+ *
119
+ * @return array
120
+ */
121
+ public function sendCustomerNotificationEmailDataProvider()
122
+ {
123
+ return array(
124
+ // Locale A text Snipplet from the locales default template
125
+ array('en_US', 'your account has been activated.'), // Standard locale
126
+ array('xx_XX', 'your account has been activated.'), // A non-existent locale falls back to default
127
+ array('de_DE', 'ihr Konto wurde aktiviert.'), // German locale with different template
128
+ );
129
+ }
130
+
131
+ /**
132
+ * @param string $locale
133
+ * @param string $contentPart
134
+ *
135
+ * @test
136
+ * @loadFixture emailConfig.yaml
137
+ * @dataProvider sendCustomerNotificationEmailDataProvider
138
+ */
139
+ public function sendCustomerNotificationEmail($locale, $contentPart)
140
+ {
141
+ $mockCustomer = $this->_getMockCustomer();
142
+
143
+ $this->app()->getStore($mockCustomer->getStoreId())->setConfig('general/locale/code', $locale);
144
+
145
+
146
+ $this->_prepareEmailTemplateInstance();
147
+
148
+ Mage::helper('customeractivation')->sendCustomerNotificationEmail($mockCustomer);
149
+
150
+ $message = sprintf(
151
+ "Expected method send() to be called 1 time but found to be called %s time(s)",
152
+ $this->_mail->getSendCount()
153
+ );
154
+ $this->assertEquals(1, $this->_mail->getSendCount(), $message);
155
+
156
+ $this->assertContains(
157
+ $mockCustomer->getEmail(), $this->_mail->getRecipients(),
158
+ "Not found the customer email in recipient list of email instance"
159
+ );
160
+
161
+ $this->assertContains($contentPart, $this->_mail->getBodyHtml(true));
162
+ }
163
+
164
+ /**
165
+ * The admin email should not change with the customer store locale, so the text sample is the same always
166
+ *
167
+ * @return array
168
+ */
169
+ public function sendAdminNotificationEmailDataProvider()
170
+ {
171
+ return array(
172
+ // customer Locale admin locale, A text Snipplet from the locales default template
173
+ array('en_US', 'en_US', 'New customer registration at'), // Standard locale
174
+ array('xx_XX', 'en_US', 'New customer registration at'), // A non-existent locale
175
+ array('de_DE', 'en_US', 'New customer registration at'), // German locale still uses en_US for admin email
176
+ array('de_DE', 'de_DE', 'Neue Kundenregistrierung bei'), // German locale in admin
177
+ array('en_US', 'de_DE', 'Neue Kundenregistrierung bei'), // German locale in admin
178
+ );
179
+ }
180
+
181
+ /**
182
+ * @param string $customerLocale
183
+ * @param string $contentPart
184
+ *
185
+ * @test
186
+ * @loadFixture emailConfig.yaml
187
+ * @dataProvider sendAdminNotificationEmailDataProvider
188
+ */
189
+ public function sendAdminNotificationEmail($customerLocale, $adminLocale, $contentPart)
190
+ {
191
+ $mockCustomer = $this->_getMockCustomer();
192
+
193
+ // Config fixtures
194
+ $this->app()->getStore($mockCustomer->getStoreId())
195
+ ->setConfig('general/locale/code', $customerLocale)
196
+ ->setConfig('customer/customeractivation/alert_admin', 1);
197
+
198
+ $this->app()->getStore('admin')
199
+ ->setConfig('general/locale/code', $adminLocale);
200
+
201
+ $this->_prepareEmailTemplateInstance();
202
+
203
+ Mage::helper('customeractivation')->sendAdminNotificationEmail($mockCustomer);
204
+
205
+ $message = sprintf(
206
+ "Expected method send() to be called 1 time but found to be called %s time(s)",
207
+ $this->_mail->getSendCount()
208
+ );
209
+ $this->assertEquals(1, $this->_mail->getSendCount(), $message);
210
+
211
+ $this->assertNotContains(
212
+ $mockCustomer->getEmail(), $this->_mail->getRecipients(),
213
+ "Found the customer email in recipient list for admin email"
214
+ );
215
+
216
+ $this->assertContains($contentPart, $this->_mail->getBodyHtml(true));
217
+ }
218
+ }
app/code/community/Netzarbeiter/CustomerActivation/Test/Helper/fixtures/emailConfig.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ config:
4
+ default/customer/customeractivation/disable_ext: 0
5
+ default/customer/customeractivation/alert_admin: 1
6
+ default/customer/customeractivation/alert_customer: 1
7
+ default/customer/customeractivation/activation_status_default: 0
8
+ default/customer/customeractivation/always_send_admin_email: 0
9
+ default/customer/customeractivation/require_activation_for_specific_groups: 0
10
+ default/customer/customeractivation/registration_admin_template: customer_customeractivation_registration_admin_template
11
+ default/customer/customeractivation/activation_template: customer_customeractivation_activation_template
12
+ default/customer/customeractivation/admin_email: admin@example.com
app/code/community/Netzarbeiter/CustomerActivation/Test/Model/ObserverTest.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Netzarbeiter
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade this Module to
15
+ * newer versions in the future.
16
+ *
17
+ * @category Netzarbeiter
18
+ * @package Netzarbeiter_CustomerActivation
19
+ * @copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ /**
24
+ * @see Netzarbeiter_CustomerActivation_Model_Observer
25
+ *
26
+ * @loadSharedFixture global.yaml
27
+ * @doNotIndexAll
28
+ */
29
+ class Netzarbeiter_CustomerActivation_Test_Model_ObserverTest extends EcomDev_PHPUnit_Test_Case
30
+ {
31
+ /**
32
+ * @var Mage_Core_Model_Abstract
33
+ */
34
+ protected $_model;
35
+
36
+ /**
37
+ * Enable global events
38
+ */
39
+ protected function setUp()
40
+ {
41
+ $this->app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
42
+ }
43
+
44
+ /**
45
+ * Reset current store to admin and clean up created customer entity
46
+ */
47
+ protected function tearDown()
48
+ {
49
+ $this->setCurrentStore('admin');
50
+ if ($this->_model && $this->_model->getId()) {
51
+ $this->_model->delete();
52
+ }
53
+ }
54
+
55
+ /**
56
+ * @test
57
+ * @dataProvider dataProvider
58
+ */
59
+ public function newCustomerActivationState($email, $storeCode, $groupCode, $activeByDefault, $specificGroups)
60
+ {
61
+ $store = $this->app()->getStore($storeCode);
62
+ $store->setConfig(Netzarbeiter_CustomerActivation_Helper_Data::XML_PATH_DEFAULT_STATUS, $activeByDefault);
63
+ $store->setConfig(Netzarbeiter_CustomerActivation_Helper_Data::XML_PATH_DEFAULT_STATUS_BY_GROUP, $specificGroups);
64
+ $this->setCurrentStore($store);
65
+
66
+ /* @var $group Mage_Customer_Model_Group */
67
+ $group = Mage::getModel('customer/group')->load($groupCode, 'customer_group_code');
68
+ $this->_model = Mage::getModel('customer/customer');
69
+ $this->_model->setData(array(
70
+ 'store_id' => $store->getId(),
71
+ 'website_id' => $store->getWebsiteId(),
72
+ 'group_id' => $group->getId(),
73
+ 'email' => $email,
74
+ ))->save();
75
+
76
+ // Since it's so easy thanks to EcomDev_PHPUnit, lets check triggered events, too
77
+ $this->assertEventDispatchedExactly('customer_save_before', 1);
78
+ $this->assertEventDispatchedExactly('customer_save_after', 1);
79
+
80
+ $expected = $this->expected("%s-%d-%d-%d", $storeCode, $group->getId(), $activeByDefault, $specificGroups)
81
+ ->getIsActivated();
82
+
83
+ $message = sprintf(
84
+ "Expected new customer %s with group %s in store %s to be %s, but found to be %s\n" .
85
+ "All groups default status: %s, %srequire activation for specific groups)",
86
+ $this->_model->getEmail(), $group->getCode(), $store->getCode(),
87
+ ($expected ? 'activated' : 'inactive'),
88
+ ($expected ? 'inactive' : 'active'),
89
+ ($activeByDefault ? 'active' : 'inactive'),
90
+ ($specificGroups ? '' : "don't ")
91
+ );
92
+ $this->assertEquals($expected, $this->_model->getCustomerActivated(), $message);
93
+ }
94
+ }
app/code/community/Netzarbeiter/CustomerActivation/Test/Model/expectations/newCustomerActivationState.yaml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Netzarbeiter
3
+ #
4
+ # NOTICE OF LICENSE
5
+ #
6
+ # This source file is subject to the Open Software License (OSL 3.0)
7
+ # that is bundled with this package in the file LICENSE.txt.
8
+ # It is also available through the world-wide-web at this URL:
9
+ # http://opensource.org/licenses/osl-3.0.php
10
+ #
11
+ # DISCLAIMER
12
+ #
13
+ # Do not edit or add to this file if you wish to upgrade this Module to
14
+ # newer versions in the future.
15
+ #
16
+ # @category Netzarbeiter
17
+ # @package Netzarbeiter_CustomerActivation
18
+ # @copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com
19
+ # @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ #
21
+
22
+ #
23
+ # Test case expectations
24
+ #
25
+
26
+ usa-1-1-0: # Group General, all groups active by default, do not require activation for specific groups
27
+ is_activated: 1
28
+
29
+ usa-1-0-0: # Group General, all groups inactive by default, do not require activation for specific groups
30
+ is_activated: 0
31
+
32
+ usa-1-0-1: # Group General, all groups inactive by default, require activation for specific groups
33
+ is_activated: 1
34
+
35
+
36
+ usa-2-1-0: # Group Wholesale, all groups active by default, do not require activation for specific groups
37
+ is_activated: 1
38
+
39
+ usa-2-0-0: # Group Wholesale, all groups inactive by default, do not require activation for specific groups
40
+ is_activated: 0
41
+
42
+ usa-2-0-1: # Group Wholesale, all groups inactive by default, require activation for specific groups
43
+ is_activated: 0
44
+
45
+
46
+ usa-3-1-0: # Group Retailer, all groups active by default, do not require activation for specific groups
47
+ is_activated: 1
48
+
49
+ usa-3-0-0: # Group Retailer, all groups inactive by default, do not require activation for specific groups
50
+ is_activated: 0
51
+
52
+ usa-3-0-1: # Group Retailer, all groups inactive by default, require activation for specific groups
53
+ is_activated: 0
54
+
app/code/community/Netzarbeiter/CustomerActivation/Test/Model/providers/newCustomerActivationState.yaml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Netzarbeiter
3
+ #
4
+ # NOTICE OF LICENSE
5
+ #
6
+ # This source file is subject to the Open Software License (OSL 3.0)
7
+ # that is bundled with this package in the file LICENSE.txt.
8
+ # It is also available through the world-wide-web at this URL:
9
+ # http://opensource.org/licenses/osl-3.0.php
10
+ #
11
+ # DISCLAIMER
12
+ #
13
+ # Do not edit or add to this file if you wish to upgrade this Module to
14
+ # newer versions in the future.
15
+ #
16
+ # @category Netzarbeiter
17
+ # @package Netzarbeiter_CustomerActivation
18
+ # @copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com
19
+ # @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ #
21
+
22
+ - # Email, Store, Customer Group, newCustomersActiveByDefault, requireActivationForSpecificGroups
23
+ - test-customer1@example.com
24
+ - usa
25
+ - General
26
+ - true
27
+ - false
28
+ -
29
+ - test-customer2@example.com
30
+ - usa
31
+ - General
32
+ - false
33
+ - false
34
+ -
35
+ - test-customer2@example.com
36
+ - usa
37
+ - General
38
+ - false
39
+ - true
40
+
41
+ -
42
+ - test-customer3@example.com
43
+ - usa
44
+ - Wholesale
45
+ - true
46
+ - false
47
+ -
48
+ - test-customer4@example.com
49
+ - usa
50
+ - Wholesale
51
+ - false
52
+ - false
53
+ -
54
+ - test-customer4@example.com
55
+ - usa
56
+ - Wholesale
57
+ - false
58
+ - true
59
+
60
+ -
61
+ - test-customer5@example.com
62
+ - usa
63
+ - Retailer
64
+ - true
65
+ - false
66
+ -
67
+ - test-customer6@example.com
68
+ - usa
69
+ - Retailer
70
+ - false
71
+ - false
72
+ -
73
+ - test-customer6@example.com
74
+ - usa
75
+ - Retailer
76
+ - false
77
+ - true
app/code/community/Netzarbeiter/CustomerActivation/Test/fixtures/customers.yaml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # One customer record is declared in the global.yaml shared fixture
3
+ eav:
4
+ customer:
5
+
6
+ - entity_id: 1 # Activated Account (same as in global.yaml)
7
+ customer_activated: 1
8
+ email: test1@example.com
9
+ firstname: Jane1
10
+ group_id: 1
11
+ lastname: Doe1
12
+ password_hash: 098f6bcd4621d373cade4e832627b4f6 # md5(test)
13
+ store_id: 2
14
+ website_id: 2
15
+
16
+ - entity_id: 2 # Deactivated Account
17
+ customer_activated: 0
18
+ email: test2@example.com
19
+ firstname: Jane2
20
+ group_id: 1
21
+ lastname: Doe2
22
+ password_hash: 098f6bcd4621d373cade4e832627b4f6 # md5(test)
23
+ store_id: 2
24
+ website_id: 2
25
+
26
+ - entity_id: 3 # No attribute value for customer_activated
27
+ customer_activated: null
28
+ email: test3@example.com
29
+ firstname: Jon3
30
+ group_id: 1
31
+ lastname: Doe3
32
+ password_hash: 098f6bcd4621d373cade4e832627b4f6 # md5(test)
33
+ store_id: 2
34
+ website_id: 2
app/code/community/Netzarbeiter/CustomerActivation/Test/fixtures/global.yaml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Netzarbeiter
3
+ #
4
+ # NOTICE OF LICENSE
5
+ #
6
+ # This source file is subject to the Open Software License (OSL 3.0)
7
+ # that is bundled with this package in the file LICENSE.txt.
8
+ # It is also available through the world-wide-web at this URL:
9
+ # http://opensource.org/licenses/osl-3.0.php
10
+ #
11
+ # DISCLAIMER
12
+ #
13
+ # Do not edit or add to this file if you wish to upgrade this Module to
14
+ # newer versions in the future.
15
+ #
16
+ # @category Netzarbeiter
17
+ # @package Netzarbeiter_CustomerActivation
18
+ # @copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com
19
+ # @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ #
21
+
22
+ scope:
23
+ website: # Initialize websites
24
+ - website_id: 2
25
+ code: usa_website
26
+ name: USA Website
27
+ default_group_id: 2
28
+ - website_id: 3
29
+ code: canada_website
30
+ name: Canada Website
31
+ default_group_id: 3
32
+ - website_id: 4
33
+ code: german_website
34
+ name: German Website
35
+ default_group_id: 4
36
+ group: # Initializes store groups
37
+ - group_id: 2
38
+ website_id: 2
39
+ name: USA Store Group
40
+ default_store_id: 2
41
+ root_category_id: 2 # Default Category
42
+ - group_id: 3
43
+ website_id: 3
44
+ name: Canada Store Group
45
+ default_store_id: 3
46
+ root_category_id: 2 # Default Category
47
+ - group_id: 4
48
+ website_id: 4
49
+ name: German Store Group
50
+ default_store_id: 4
51
+ root_category_id: 2 # Default Category
52
+ store: # Initializes store views
53
+ - store_id: 2
54
+ website_id: 2
55
+ group_id: 2
56
+ code: usa
57
+ name: USA Store
58
+ is_active: 1
59
+ - store_id: 6
60
+ website_id: 2
61
+ group_id: 2
62
+ code: usa2
63
+ name: USA Store 2
64
+ is_active: 1
65
+ - store_id: 3
66
+ website_id: 3
67
+ group_id: 3
68
+ code: canada
69
+ name: Canada Store
70
+ is_active: 1
71
+ - store_id: 4
72
+ website_id: 4
73
+ group_id: 4
74
+ code: germany
75
+ name: Germany Store
76
+ is_active: 1
77
+ - store_id: 5
78
+ website_id: 4
79
+ group_id: 4
80
+ code: germany2
81
+ name: Germany Store 2
82
+ is_active: 1
83
+
84
+ tables:
85
+ customer/customer_group:
86
+ - customer_group_id: 0
87
+ customer_group_code: NOT LOGGED IN
88
+ tax_class_id: 3 # default customer tax class id
89
+ - customer_group_id: 1
90
+ customer_group_code: General
91
+ tax_class_id: 3
92
+ - customer_group_id: 2
93
+ customer_group_code: Wholesale
94
+ tax_class_id: 3
95
+ - customer_group_id: 3
96
+ customer_group_code: Retailer
97
+ tax_class_id: 3
98
+
99
+ eav:
100
+ customer:
101
+
102
+ - entity_id: 1 # Activated Account
103
+ customer_activated: 1
104
+ email: test1@example.com
105
+ firstname: Jane1
106
+ group_id: 1
107
+ lastname: Doe1
108
+ password_hash: 098f6bcd4621d373cade4e832627b4f6 # md5(test)
109
+ store_id: 2
110
+ website_id: 2
111
+
112
+ config:
113
+ default/customer/customeractivation/disable_ext: 0
114
+ default/customer/customeractivation/always_active_in_admin: 0
115
+ default/customer/customeractivation/alert_admin: 0
116
+ default/customer/customeractivation/alert_customer: 0
117
+ default/customer/customeractivation/activation_status_default: 0
118
+ default/customer/customeractivation/always_send_admin_email: 0
119
+ default/customer/customeractivation/require_activation_for_specific_groups: 0
120
+ default/customer/customeractivation/require_activation_groups: 2,3 # Wholesale, Retailer
app/code/community/Netzarbeiter/CustomerActivation/controllers/AdminController.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Netzarbeiter_CustomerActivation_AdminController extends Mage_Adminhtml_Controller_Action
21
+ {
22
+ /**
23
+ * Activate or deactivate all selected customers
24
+ */
25
+ public function massActivationAction()
26
+ {
27
+ $customerIds = $this->getRequest()->getParam('customer');
28
+
29
+ if (!is_array($customerIds)) {
30
+ Mage::getSingleton('adminhtml/session')->addError(
31
+ Mage::helper('customeractivation')->__('Please select item(s)')
32
+ );
33
+ } else {
34
+ $paramValue = $this->getRequest()->getParam('customer_activated');
35
+
36
+ try {
37
+ $updatedCustomerIds = Mage::getResourceModel('customeractivation/customer')
38
+ ->massSetActivationStatus(
39
+ $customerIds, $this->_shouldSetToActivated($paramValue)
40
+ );
41
+
42
+ Mage::getSingleton('adminhtml/session')->addSuccess(
43
+ Mage::helper('customeractivation')->__(
44
+ 'Total of %d record(s) were successfully saved', count($updatedCustomerIds)
45
+ )
46
+ );
47
+
48
+ if ($this->_shouldSendActivationNotification($paramValue)) {
49
+ $this->_sendActivationNotificationEmails($updatedCustomerIds);
50
+ }
51
+ } catch (Exception $e) {
52
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
53
+ }
54
+ }
55
+
56
+ $this->_redirect('adminhtml/customer');
57
+ }
58
+
59
+ /**
60
+ * Based on the mass action query parameter, should customers be activated or not.
61
+ *
62
+ * @param $paramValue
63
+ * @return int
64
+ */
65
+ protected function _shouldSetToActivated($paramValue)
66
+ {
67
+ switch ($paramValue) {
68
+ case Netzarbeiter_CustomerActivation_Helper_Data::STATUS_ACTIVATE_WITH_EMAIL:
69
+ case Netzarbeiter_CustomerActivation_Helper_Data::STATUS_ACTIVATE_WITHOUT_EMAIL:
70
+ $activationStatus = 1;
71
+ break;
72
+ case Netzarbeiter_CustomerActivation_Helper_Data::STATUS_DEACTIVATE:
73
+ default:
74
+ $activationStatus = 0;
75
+ break;
76
+ }
77
+ return $activationStatus;
78
+ }
79
+
80
+ /**
81
+ * Based on the mass action query parameter, should customer notifications be sent or not
82
+ *
83
+ * @param $paramValue
84
+ * @return bool
85
+ */
86
+ protected function _shouldSendActivationNotification($paramValue)
87
+ {
88
+ switch ($paramValue) {
89
+ case Netzarbeiter_CustomerActivation_Helper_Data::STATUS_ACTIVATE_WITH_EMAIL:
90
+ $sendEmail = true;
91
+ break;
92
+ case Netzarbeiter_CustomerActivation_Helper_Data::STATUS_ACTIVATE_WITHOUT_EMAIL:
93
+ case Netzarbeiter_CustomerActivation_Helper_Data::STATUS_DEACTIVATE:
94
+ default:
95
+ $sendEmail = false;
96
+ break;
97
+ }
98
+ return $sendEmail;
99
+ }
100
+
101
+ /**
102
+ * Send notification emails to all selected customers
103
+ *
104
+ * @param array $customerIds
105
+ */
106
+ protected function _sendActivationNotificationEmails(array $customerIds)
107
+ {
108
+ $helper = Mage::helper('customeractivation');
109
+ $customers = Mage::getResourceModel('customer/customer_collection')
110
+ ->addAttributeToFilter('entity_id', array('in' => $customerIds))
111
+ ->addAttributeToSelect('*')
112
+ ->addNameToSelect();
113
+ foreach ($customers as $customer) {
114
+ $helper->sendCustomerNotificationEmail($customer);
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Check the admin user is allowed to manage customer accounts
120
+ *
121
+ * @return bool
122
+ */
123
+ protected function _isAllowed()
124
+ {
125
+ return Mage::getSingleton('admin/session')->isAllowed('customer/manage');
126
+ }
127
+ }
app/code/community/Netzarbeiter/CustomerActivation/etc/config.xml ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * package Netzarbeiter_CustomerActivation
17
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
18
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+ <config>
22
+ <modules>
23
+ <Netzarbeiter_CustomerActivation>
24
+ <version>0.5.4</version>
25
+ </Netzarbeiter_CustomerActivation>
26
+ </modules>
27
+ <global>
28
+ <models>
29
+ <customeractivation>
30
+ <class>Netzarbeiter_CustomerActivation_Model</class>
31
+ <resourceModel>customeractivation_resource</resourceModel>
32
+ </customeractivation>
33
+ <customeractivation_resource>
34
+ <class>Netzarbeiter_CustomerActivation_Model_Resource</class>
35
+ </customeractivation_resource>
36
+ </models>
37
+ <helpers>
38
+ <customeractivation>
39
+ <class>Netzarbeiter_CustomerActivation_Helper</class>
40
+ </customeractivation>
41
+ </helpers>
42
+ <blocks>
43
+ <customeractivation>
44
+ <class>Netzarbeiter_CustomerActivation_Block</class>
45
+ </customeractivation>
46
+ </blocks>
47
+ <resources>
48
+ <customeractivation_setup>
49
+ <setup>
50
+ <module>Netzarbeiter_CustomerActivation</module>
51
+ <class>Mage_Customer_Model_Entity_Setup</class>
52
+ </setup>
53
+ </customeractivation_setup>
54
+ </resources>
55
+ <template>
56
+ <email>
57
+ <customer_customeractivation_registration_admin_template translate="label" module="customeractivation">
58
+ <label>Customer Registration Admin Notification</label>
59
+ <file>netzarbeiter/customeractivation/customer_registration_admin.html</file>
60
+ <type>html</type>
61
+ </customer_customeractivation_registration_admin_template>
62
+ <customer_customeractivation_activation_template translate="label" module="customeractivation">
63
+ <label>Customer Activation Notification</label>
64
+ <file>netzarbeiter/customeractivation/customer_activation.html</file>
65
+ <type>html</type>
66
+ </customer_customeractivation_activation_template>
67
+ </email>
68
+ </template>
69
+ <events>
70
+ <customer_save_before>
71
+ <observers>
72
+ <customeractivation>
73
+ <type>singleton</type>
74
+ <class>customeractivation/observer</class>
75
+ <method>customerSaveBefore</method>
76
+ </customeractivation>
77
+ </observers>
78
+ </customer_save_before>
79
+ <customer_save_after>
80
+ <observers>
81
+ <customeractivation>
82
+ <type>model</type>
83
+ <class>customeractivation/observer</class>
84
+ <method>customerSaveAfter</method>
85
+ </customeractivation>
86
+ </observers>
87
+ </customer_save_after>
88
+ </events>
89
+ </global>
90
+ <admin>
91
+ <routers>
92
+ <customeractivation>
93
+ <use>admin</use>
94
+ <args>
95
+ <module>Netzarbeiter_CustomerActivation</module>
96
+ <frontName>customeractivation</frontName>
97
+ </args>
98
+ </customeractivation>
99
+ </routers>
100
+ </admin>
101
+ <frontend>
102
+ <events>
103
+ <customer_login>
104
+ <observers>
105
+ <customeractivation>
106
+ <type>singleton</type>
107
+ <class>customeractivation/observer</class>
108
+ <method>customerLogin</method>
109
+ </customeractivation>
110
+ </observers>
111
+ </customer_login>
112
+ <sales_convert_quote_address_to_order>
113
+ <observers>
114
+ <customeractivation>
115
+ <type>singleton</type>
116
+ <class>customeractivation/observer</class>
117
+ <method>salesConvertQuoteAddressToOrder</method>
118
+ </customeractivation>
119
+ </observers>
120
+ </sales_convert_quote_address_to_order>
121
+ <controller_action_postdispatch_customer_account_resetpasswordpost>
122
+ <observers>
123
+ <customeractivation>
124
+ <type>singleton</type>
125
+ <class>customeractivation/observer</class>
126
+ <method>controllerActionPostdispatchCustomerAccountResetPasswordPost</method>
127
+ </customeractivation>
128
+ </observers>
129
+ </controller_action_postdispatch_customer_account_resetpasswordpost>
130
+ </events>
131
+ <translate>
132
+ <modules>
133
+ <Netzarbeiter_CustomerActivation>
134
+ <files>
135
+ <default>Netzarbeiter_CustomerActivation.csv</default>
136
+ </files>
137
+ </Netzarbeiter_CustomerActivation>
138
+ </modules>
139
+ </translate>
140
+ </frontend>
141
+ <default>
142
+ <customer>
143
+ <customeractivation>
144
+ <disable_ext>0</disable_ext>
145
+ <always_active_in_admin>1</always_active_in_admin>
146
+ <alert_admin>1</alert_admin>
147
+ <admin_email></admin_email>
148
+ <registration_admin_template>customer_customeractivation_registration_admin_template</registration_admin_template>
149
+ <alert_customer>0</alert_customer>
150
+ <activation_template>customer_customeractivation_activation_template</activation_template>
151
+ <activation_status_default>0</activation_status_default>
152
+ <always_send_admin_email>0</always_send_admin_email>
153
+ <require_activation_for_specific_groups>0</require_activation_for_specific_groups>
154
+ <require_activation_groups></require_activation_groups>
155
+ </customeractivation>
156
+ </customer>
157
+ </default>
158
+ <adminhtml>
159
+ <translate>
160
+ <modules>
161
+ <Netzarbeiter_CustomerActivation>
162
+ <files>
163
+ <default>Netzarbeiter_CustomerActivation.csv</default>
164
+ </files>
165
+ </Netzarbeiter_CustomerActivation>
166
+ </modules>
167
+ </translate>
168
+ <events>
169
+
170
+ <!-- The massaction block can't be added in the block abstract event, this needs to be used -->
171
+ <adminhtml_block_html_before>
172
+ <observers>
173
+ <customeractivation>
174
+ <type>model</type>
175
+ <class>customeractivation/observer</class>
176
+ <method>adminhtmlBlockHtmlBefore</method>
177
+ </customeractivation>
178
+ </observers>
179
+ </adminhtml_block_html_before>
180
+
181
+ <!-- Add attribute to grid collection -->
182
+ <eav_collection_abstract_load_before>
183
+ <observers>
184
+ <customeractivation>
185
+ <type>model</type>
186
+ <class>customeractivation/observer</class>
187
+ <method>eavCollectionAbstractLoadBefore</method>
188
+ </customeractivation>
189
+ </observers>
190
+ </eav_collection_abstract_load_before>
191
+
192
+ <!-- Add column to grid, also for csv and xml export -->
193
+ <core_block_abstract_prepare_layout_after>
194
+ <observers>
195
+ <customeractivation>
196
+ <type>singleton</type>
197
+ <class>customeractivation/observer</class>
198
+ <method>coreBlockAbstractPrepareLayoutAfter</method>
199
+ </customeractivation>
200
+ </observers>
201
+ </core_block_abstract_prepare_layout_after>
202
+ </events>
203
+ </adminhtml>
204
+ <phpunit>
205
+ <suite>
206
+ <modules>
207
+ <Netzarbeiter_CustomerActivation/>
208
+ </modules>
209
+ </suite>
210
+ </phpunit>
211
+ </config>
app/code/community/Netzarbeiter/CustomerActivation/etc/system.xml ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * package Netzarbeiter_CustomerActivation
17
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
18
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+ <config>
22
+ <sections>
23
+ <customer translate="label" module="customer">
24
+ <groups>
25
+ <customeractivation translate="label" module="customeractivation">
26
+ <label>Customer Activation</label>
27
+ <sort_order>768</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ <fields>
32
+ <disable_ext translate="label" module="customeractivation">
33
+ <label>Disable CustomerActivation</label>
34
+ <frontend_type>select</frontend_type>
35
+ <source_model>adminhtml/system_config_source_yesno</source_model>
36
+ <sort_order>10</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ </disable_ext>
41
+ <always_active_in_admin translate="label" module="customeractivation">
42
+ <label>Always enable in admin interface</label>
43
+ <frontend_type>select</frontend_type>
44
+ <source_model>adminhtml/system_config_source_yesno</source_model>
45
+ <sort_order>11</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>0</show_in_website>
48
+ <show_in_store>0</show_in_store>
49
+ <comment>If you want to activate accounts created via the admin interface</comment>
50
+ <depends>
51
+ <disable_ext>1</disable_ext>
52
+ </depends>
53
+ </always_active_in_admin>
54
+ <alert_admin translate="label" module="customeractivation">
55
+ <label>Notify Admin on Customer Registration</label>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>adminhtml/system_config_source_yesno</source_model>
58
+ <sort_order>20</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>0</show_in_store>
62
+ <depends>
63
+ <disable_ext>0</disable_ext>
64
+ </depends>
65
+ </alert_admin>
66
+ <admin_email translate="label" module="customeractivation">
67
+ <label>Admin Email Address</label>
68
+ <fontend_type>text</fontend_type>
69
+ <sort_order>30</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ <depends>
74
+ <alert_admin>1</alert_admin>
75
+ <disable_ext>0</disable_ext>
76
+ </depends>
77
+ </admin_email>
78
+ <registration_admin_template translate="label" module="customeractivation">
79
+ <label>Admin Notification Email Template</label>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>adminhtml/system_config_source_email_template</source_model>
82
+ <sort_order>40</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>0</show_in_website>
85
+ <show_in_store>0</show_in_store>
86
+ <depends>
87
+ <alert_admin>1</alert_admin>
88
+ <disable_ext>0</disable_ext>
89
+ </depends>
90
+ </registration_admin_template>
91
+ <alert_customer translate="label" module="customeractivation">
92
+ <label>Notify Customer of Account Activation</label>
93
+ <frontend_type>select</frontend_type>
94
+ <source_model>adminhtml/system_config_source_yesno</source_model>
95
+ <sort_order>50</sort_order>
96
+ <show_in_default>1</show_in_default>
97
+ <show_in_website>1</show_in_website>
98
+ <show_in_store>0</show_in_store>
99
+ <depends>
100
+ <disable_ext>0</disable_ext>
101
+ </depends>
102
+ </alert_customer>
103
+ <activation_template translate="label" module="customeractivation">
104
+ <label>Customer Notification Email Template</label>
105
+ <frontend_type>select</frontend_type>
106
+ <source_model>adminhtml/system_config_source_email_template</source_model>
107
+ <sort_order>60</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>1</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ <depends>
112
+ <alert_customer>1</alert_customer>
113
+ <disable_ext>0</disable_ext>
114
+ </depends>
115
+ </activation_template>
116
+ <activation_status_default translate="label" module="customeractivation">
117
+ <label>Activate new Customer Accounts by Default</label>
118
+ <frontend_type>select</frontend_type>
119
+ <source_model>adminhtml/system_config_source_yesno</source_model>
120
+ <sort_order>70</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>1</show_in_website>
123
+ <show_in_store>1</show_in_store>
124
+ <depends>
125
+ <disable_ext>0</disable_ext>
126
+ </depends>
127
+ </activation_status_default>
128
+ <require_activation_for_specific_groups translate="label" module="customeractivation">
129
+ <label>Require Activation for Specific Groups only</label>
130
+ <frontend_type>select</frontend_type>
131
+ <source_model>adminhtml/system_config_source_yesno</source_model>
132
+ <sort_order>90</sort_order>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>1</show_in_website>
135
+ <show_in_store>1</show_in_store>
136
+ <depends>
137
+ <activation_status_default>0</activation_status_default>
138
+ <disable_ext>0</disable_ext>
139
+ </depends>
140
+ </require_activation_for_specific_groups>
141
+ <require_activation_groups>
142
+ <label>Require Activation for Groups</label>
143
+ <frontend_type>multiselect</frontend_type>
144
+ <source_model>customeractivation/adminhtml_system_config_source_customer_group_multiselect</source_model>
145
+ <sort_order>100</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>1</show_in_store>
149
+ <depends>
150
+ <require_activation_for_specific_groups>1</require_activation_for_specific_groups>
151
+ <activation_status_default>0</activation_status_default>
152
+ <disable_ext>0</disable_ext>
153
+ </depends>
154
+ </require_activation_groups>
155
+ <always_send_admin_email translate="label comment" module="customeractivation">
156
+ <label>Always send Admin Notification</label>
157
+ <frontend_type>select</frontend_type>
158
+ <source_model>adminhtml/system_config_source_yesno</source_model>
159
+ <sort_order>110</sort_order>
160
+ <show_in_default>1</show_in_default>
161
+ <show_in_website>1</show_in_website>
162
+ <show_in_store>1</show_in_store>
163
+ <comment>Send the Admin notification email even if new accounts are activated by default</comment>
164
+ <depends>
165
+ <disable_ext>0</disable_ext>
166
+ </depends>
167
+ </always_send_admin_email>
168
+ </fields>
169
+ </customeractivation>
170
+ </groups>
171
+ </customer>
172
+ </sections>
173
+ </config>
app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ $this->startSetup();
21
+
22
+ $this->addAttribute('customer', 'customer_activated', array(
23
+ 'type' => 'int',
24
+ 'input' => 'text',
25
+ 'label' => 'Is activated',
26
+ 'global' => 1,
27
+ 'visible' => 1,
28
+ 'required' => 0,
29
+ 'user_defined' => 1,
30
+ 'default' => '0',
31
+ 'visible_on_front' => 0,
32
+ ));
33
+
34
+ $this->endSetup();
35
+
36
+
app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.3-0.2.4.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ $this->startSetup();
21
+
22
+ $this->updateAttribute('customer', 'customer_activated', 'frontend_input', 'select');
23
+ $this->updateAttribute('customer', 'customer_activated', 'source_model', 'eav/entity_attribute_source_boolean');
24
+
25
+ $this->endSetup();
app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.4-0.2.5.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ /* @var $this Mage_Customer_Model_Entity_Setup */
21
+ $this->startSetup();
22
+
23
+ $customer = Mage::getModel('customer/customer');
24
+ $attrSetId = $customer->getResource()->getEntityType()->getDefaultAttributeSetId();
25
+
26
+ $this->addAttributeToSet('customer', $attrSetId, 'General', 'customer_activated');
27
+
28
+ $this->endSetup();
29
+
app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.7-0.2.8.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ /* @var $installer Mage_Customer_Model_Entity_Setup */
21
+ $installer = $this;
22
+
23
+ $installer->startSetup();
24
+
25
+ /*
26
+ * Add required information for Magento 1.4.2 and newer
27
+ */
28
+ if (version_compare(Mage::getVersion(), '1.4.2', '>=')) {
29
+ Mage::getSingleton('eav/config')
30
+ ->getAttribute('customer', 'customer_activated')
31
+ ->setData('used_in_forms', array('adminhtml_customer'))
32
+ ->save();
33
+ }
34
+
35
+ $installer->endSetup();
app/code/community/Netzarbeiter/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.8-0.2.9.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * package Netzarbeiter_CustomerActivation
16
+ * copyright Copyright (c) 2014 Vinai Kopp http://netzarbeiter.com/
17
+ * license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ /* @var $installer Mage_Customer_Model_Entity_Setup */
21
+ $installer = $this;
22
+
23
+ $installer->startSetup();
24
+
25
+ $resource = Mage::getResourceModel('customer/customer');
26
+
27
+ // Set activation status for existing customers to true
28
+ $select = $installer->getConnection()->select()
29
+ ->from($resource->getEntityTable(), $resource->getEntityIdField());
30
+ $customerIds = $installer->getConnection()->fetchCol($select);
31
+
32
+ $updatedCustomerIds = Mage::getResourceModel('customeractivation/customer')
33
+ ->massSetActivationStatus($customerIds, 1);
34
+
35
+ $installer->endSetup();
app/code/community/Sitewards/B2BProfessional/Docs/Sitewards_B2B_Professional_DE.pdf CHANGED
Binary file
app/code/community/Sitewards/B2BProfessional/Docs/Sitewards_B2B_Professional_EN.pdf CHANGED
Binary file
app/code/community/Sitewards/B2BProfessional/Helper/Redirects.php CHANGED
@@ -135,7 +135,11 @@ class Sitewards_B2BProfessional_Helper_Redirects extends Sitewards_B2BProfession
135
  */
136
  /* @var $oSession Mage_Core_Model_Session */
137
  $oSession = Mage::getSingleton('core/session');
138
- $oSession->addNotice(Mage::helper('sitewards_b2bprofessional')->__('Please login'));
 
 
 
 
139
  session_write_close();
140
  }
141
  }
135
  */
136
  /* @var $oSession Mage_Core_Model_Session */
137
  $oSession = Mage::getSingleton('core/session');
138
+ $oSession->addUniqueMessages(
139
+ Mage::getSingleton('core/message')->notice(
140
+ Mage::helper('sitewards_b2bprofessional')->__('Please login')
141
+ )
142
+ );
143
  session_write_close();
144
  }
145
  }
app/code/community/Sitewards/B2BProfessional/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Sitewards_B2BProfessional>
5
- <version>3.0.4</version>
6
  </Sitewards_B2BProfessional>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Sitewards_B2BProfessional>
5
+ <version>3.0.5</version>
6
  </Sitewards_B2BProfessional>
7
  </modules>
8
  <global>
app/etc/modules/Netzarbeiter_CustomerActivation.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Netzarbeiter_CustomerActivation>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Core />
9
+ <Mage_Customer />
10
+ <Mage_Adminhtml />
11
+ </depends>
12
+ </Netzarbeiter_CustomerActivation>
13
+ </modules>
14
+ </config>
app/locale/de_DE/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "This account is not activated.","Dieses Konto wurde (noch) nicht freigeschaltet."
2
+ "Is activated","Kunde ist aktiviert"
3
+ "Deactivated","Nicht aktiviert"
4
+ "Activated","Aktiviert"
5
+ "Customer Activation","Kunden Aktivierung"
6
+ "Disable CustomerActivation","Erweiterung deaktivieren"
7
+ "Please wait for your account to be activated","Bitte haben Sie etwas Geduld bis Ihr Konto freigeschaltet wird."
8
+ "Customer Registration Admin Notification","Kunden Registrierungs-Benachrichtigung"
9
+ "Customer Activation Notification","Kunden Aktivierungs-Benachrichtigung"
10
+ "Notify Admin on Customer Registration","Admin bei Neuanmeldungen benachrichtigen"
11
+ "Admin Email Address","Admin Email Adresse"
12
+ "Admin Notification Email Template","Admin Benachrichtigung Email Template"
13
+ "Notify Customer of Account Activation","Kunde über Kontoaktivierung benachrichtigen"
14
+ "Customer Notification Email Template","Kunde Benachrichtigung Email Template"
15
+ "Always enable in admin interface","Im Admin Backend immer aktiv"
16
+ "If you want to activate accounts created via the admin interface","Zum Aktivieren von Kontos die im Admin Interface erstellt wurden"
17
+ "Activate new Customer Accounts by Default","Neue Kunden automatisch aktivieren"
18
+ "Always send Admin Notification","Admin Benachrichtigung immer senden"
19
+ "Send the Admin notification email even if new accounts are activated by default","Admin Benachrichtigen auch wenn das Konto automatisch aktiviert wurde"
20
+ "Customer Activated","Konto aktiviert"
21
+ "Yes","Ja"
22
+ "Yes (With Notification)","Ja (Sende Email)"
23
+ "Yes (No Notification)","Ja (Ohne Email)"
24
+ "No","Nein"
25
+ "Please select item(s)","Bitte wählen Sie Datensätze aus"
26
+ "Total of %d record(s) were successfully saved","Es wurden %d Datensätze erfolgreich gespeichert"
app/locale/de_DE/template/email/netzarbeiter/customeractivation/customer_activation.html ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Ihr Konto wurde aktiviert, {{var customer.getName()}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top">
15
+ <a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="Magento" style="margin-bottom:10px;" border="0"/></a></td>
16
+ </tr>
17
+ </table>
18
+
19
+ <!-- [ middle starts here] -->
20
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
21
+ <tr>
22
+ <td valign="top">
23
+ <p><strong>Hallo {{var customer.name}}</strong>,<br/>
24
+ ihr Konto wurde aktiviert. Um sich bei Ihrem nächsten Besuch in unserem Shop einzuloggen,
25
+ klicken Sie einfach auf <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Login</a> oder
26
+ <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Mein Kundenkonto</a> im oberen Bereich jeder Seite,
27
+ und geben Sie Ihre E-Mail-Adresse und Passwort ein.</p>
28
+
29
+ <p>Sollten Sie Fragen zu Ihrem Kundenkonto oder andere Anfragen haben, senden Sie uns eine E-Mail an <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> oder rufen Sie uns von Montag bis Freitag von 8.00 bis 17.00 Uhr unter {{config path='general/store_information/phone'}} an.</p>
30
+
31
+ <p>Vielen Dank!</p>
32
+
33
+
34
+ </td>
35
+ </tr>
36
+ </table>
37
+
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
app/locale/de_DE/template/email/netzarbeiter/customeractivation/customer_registration_admin.html ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Neue Kundenregistrierung bei {{var store.getName()}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
12
+ <tr>
13
+ <td valign="top">
14
+ <p>
15
+ Neue Kundenregistrierung bei {{var store.getName()}}.<br />
16
+ Name: {{var customer.getName()}}<br />
17
+ Email: {{var customer.getEmail()}}
18
+ </p>
19
+
20
+ <p>
21
+ Um den Kunden frei zu schalten, gehen sie im <a href="{{store url="adminhtml/customer"}}">Admin Interface</a> auf Kunden &gt; Kunden verwalten &gt; {{var customer.getName()}} &gt; Benutzerkonto Informationen und
22
+ aktivieren sie das Konto.
23
+ </p>
24
+
25
+ </td>
26
+ </tr>
27
+ </table>
28
+
29
+ </td>
30
+ </tr>
31
+ </table>
32
+ </div>
app/locale/el_GR/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+  "Is activated","ΕΝΕΡΓΟΠΟΙΗΘΗΚΕ"
2
+ "This account is not activated.","Ο ΛΟΓΑΡΙΑΣΜΟΣ ΑΥΤΟΣ ΔΕΝ ΕΧΕΙ ΕΝΕΡΓΟΠΟΙΗΘΕΙ."
3
+ "Deactivated","ΑΠΕΝΕΡΓΟΠΟΙΗΜΕΝΟΣ"
4
+ "Activated","ΕΝΕΡΓΟΠΟΙΗΜΕΝΟΣ"
5
+ "Customer Activation","ΕΝΕΡΓΟΠΟΙΗΣΗ ΠΕΛΑΤΗ"
6
+ "Disable CustomerActivation","ΑΠΕΝΕΡΓΟΠΟΙΗΣΗ ΕΦΑΡΜΟΓΗΣ"
7
+ "Please wait for your account to be activated","ΠΑΡΑΚΑΛΩ ΠΕΡΙΜΕΝΕΤΕ ΝΑ ΕΝΕΡΓΟΠΟΙΗΘΕΙ Ο ΛΟΓΑΡΙΑΣΜΟΣ ΣΑΣ."
app/locale/en_US/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "This account is not activated.","This account is not activated."
2
+ "Is activated","Is activated"
3
+ "Deactivated","Deactivated"
4
+ "Activated","Activated"
5
+ "Customer Activation","Customer Activation"
6
+ "Disable CustomerActivation","Disable Extension"
7
+ "Please wait for your account to be activated","Please wait for your account to be activated"
8
+ "Customer Registration Admin Notification","Customer Registration Admin Notification"
9
+ "Customer Activation Notification","Customer Activation Notification"
10
+ "Notify Admin on Customer Registration","Notify Admin on Customer Registration"
11
+ "Admin Email Address","Admin Email Address"
12
+ "Admin Notification Email Template","Admin Notification Email Template"
13
+ "Notify Customer of Account Activation","Notify Customer of Account Activation"
14
+ "Customer Notification Email Template","Customer Notification Email Template"
15
+ "Always enable in admin interface","Always enable in admin interface"
16
+ "If you want to activate accounts created via the admin interface","If you want to activate accounts created via the admin interface"
17
+ "Activate new Customer Accounts by Default","Activate new Customer Accounts by Default"
18
+ "Always send Admin Notification","Always send Admin Notification"
19
+ "Send the Admin notification email even if new accounts are activated by default","Send the Admin notification email even if new accounts are activated by default"
20
+ "Customer Activated","Customer Activated"
21
+ "Yes","Yes"
22
+ "Yes (With Notification)","Yes (With Notification)"
23
+ "Yes (No Notification)","Yes (No Notification)"
24
+ "No","No"
25
+ "Please select item(s)","Please select item(s)"
26
+ "Total of %d record(s) were successfully saved","Total of %d record(s) were successfully saved"
app/locale/en_US/template/email/netzarbeiter/customeractivation/customer_activation.html ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Your account has been activated, {{var customer.getName()}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top">
15
+ <a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="Magento" style="margin-bottom:10px;" border="0"/></a></td>
16
+ </tr>
17
+ </table>
18
+
19
+ <!-- [ middle starts here] -->
20
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
21
+ <tr>
22
+ <td valign="top">
23
+ <p>
24
+ <strong>Hello {{var customer.name}}</strong>,<br/>
25
+ your account has been activated.<br/>
26
+ To log in when visiting our site just click <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Login</a> or
27
+ <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">My Account</a> at the top of every page, and then enter your e-mail address and password.
28
+ </p>
29
+
30
+ <p>If you have any questions about your account or any other matter, please feel free to contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or by phone at {{config path='general/store_information/phone'}}.</p>
31
+ <p>Thanks again!</p>
32
+
33
+
34
+ </td>
35
+ </tr>
36
+ </table>
37
+
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
app/locale/en_US/template/email/netzarbeiter/customeractivation/customer_registration_admin.html ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject New customer registration at {{var store.getName()}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
12
+ <tr>
13
+ <td valign="top">
14
+ <p>
15
+ New customer registration at {{var store.getName()}}.<br />
16
+ Name: {{var customer.getName()}}<br />
17
+ Email: {{var customer.getEmail()}}
18
+ </p>
19
+
20
+ <p>
21
+ To enable the customer, please visit the <a href="{{store url="adminhtml/customer"}}">Admin Interface</a> and go to
22
+ Customers &gt; Manage Customers &gt; {{var customer.getName()}} &gt; Account Information and
23
+ activate the account.
24
+ </p>
25
+
26
+ </td>
27
+ </tr>
28
+ </table>
29
+
30
+ </td>
31
+ </tr>
32
+ </table>
33
+ </div>
app/locale/fr_FR/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ "Is activated","Est activé"
2
+ "This account is not activated.","Ce compte n'est pas encore activé."
3
+ "Deactivated","Non activé"
4
+ "Activated","Activé"
5
+ "Customer Activation","Activation client"
6
+ "Disable CustomerActivation","Désactiver l'extension ""Activation client"""
7
+ "Customer Notification Email Template","Email de notification d'activation"
8
+ "Please wait for your account to be activated","Merci d'attendre que votre compte soit activé."
9
+
app/locale/it_IT/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "This account is not activated.","Questo account non � stato attivato."
2
+ "Is activated","E' attivato"
3
+ "Deactivated","Disattivato"
4
+ "Activated","Attivato"
5
+ "Customer Activation","Attivazione Cliente"
6
+ "Disable CustomerActivation","Disabilita l'\estensione"
7
+ "Please wait for your account to be activated","Per favore attendi che il Tuo account sia attivato"
8
+ "Customer Registration Admin Notification","Notifica amministratore registrazione cliente"
9
+ "Customer Activation Notification","Notifica al cliente dell'attivazione"
10
+ "Notify Admin on Customer Registration","Notifica amministratore alla registrazione del cliente"
11
+ "Admin Email Address","Indirizzo emai amministratore"
12
+ "Admin Notification Email Template","Template email di notifica amministratore"
13
+ "Notify Customer of Account Activation","Notifica al Cliente l'attivazione"
14
+ "Customer Notification Email Template","Template email della notifica al cliente"
15
+ "Always enable in admin interface","Abilita sempre nel backend amministrativo"
16
+ "If you want to activate accounts created via the admin interface","Se vuoi attivare gli account creati dal backend amministrativo"
app/locale/it_IT/Sitewards_B2BProfessional.csv DELETED
@@ -1,19 +0,0 @@
1
- "Your account is not allowed to access this store.","Al tuo account non è concesso accedere a questo Negozio."
2
- "Please login","Prego connettersi"
3
- "General settings","Impostazioni Generali"
4
- "Enable B2B extension","Abilita estensione B2B"
5
- "Activate by category","Attiva per categoria"
6
- "Active categories","Categorie attive"
7
- "Activate by customer group","Attiva per gruppo cliente"
8
- "Active customer groups","Attiva gruppi clienti"
9
- "Enable or disable extension. Customer activation behaviour can be configured under <br />""Customer Configuration > Customer activation""","Abilita o disabilita l'estensione. L'attivazione per i gruppi Cliente puo' essere attivata in <br />""Configurazione Cliente > Attivazione Cliente"""
10
- "Activate customers for all stores. Otherwise they will only see the prices in the store, they have registered for.","Activate customers for all stores. Otherwise they will only see the prices in the store, they have registered for."
11
- "Activate extension only for categories selected below","Attiva l'estensione solo per le categorie selezionate di seguito"
12
- "Select categories for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.<br />Be aware, that a product with multiple categories can not be checked out if one of its categories is selected here.","Seleziona le categoria per le quali l'estensione deve essere attiva.<br />Premi il tasto Ctrl per selezioni multiple.<br />Sappi che, un prodotto con categorie multiple non puo' essere deselezionato se una delle sue categorie e presente in questa lista."
13
- "Activate extension only for customer groups selected below","Attiva l'estensione solo per i gruppi cliente selezionati di seguito"
14
- "Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.","Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection."
15
- "When activating this extension by customer group the guest user is also included.","Quando questa estensione e' attivata per gruppo cliente gli utenti ospite sono sempre inclusi."
16
- "Require User Login","Richiede Login Utente"
17
- "The user is required to login before they can view pages in this shop. <br /> Note: CMS pages are always allowed.","All' utente e' richiesto il login prima di poter vedere le pagine di questo negozio. <br /> Nota: le pagine CMS sono sempre concesse."
18
- "Redirect User To Page","Ridirigi Utente alla Pagina"
19
- "Select which page to redirect a user to.","Seleziona a quale pagina ridirigere l'utente."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/it_IT/template/email/netzarbeiter/customeractivation/customer_activation.html ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Il Tuo account è attivo, {{var customer.getName()}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top">
15
+ <a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="Magento" style="margin-bottom:10px;" border="0"/></a></td>
16
+ </tr>
17
+ </table>
18
+
19
+ <!-- [ middle starts here] -->
20
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
21
+ <tr>
22
+ <td valign="top">
23
+ <p>
24
+ <strong>Ciao {{var customer.name}}</strong>,<br/>
25
+ il Tuo account &egrave; stato attivato.<br/>
26
+ Per accedere direttamente clicca <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">QUI</a> oppure
27
+ <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Mio Account</a> dalla Home Page del sito inserendo email e password.
28
+ </p>
29
+
30
+ <p>Per qualsiasi informazione o chiarimento non esitare a scriverci <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> o chiamaci allo {{config path='general/store_information/phone'}}.</p>
31
+ <p>Grazie, a presto!</p>
32
+
33
+
34
+ </td>
35
+ </tr>
36
+ </table>
37
+
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
app/locale/it_IT/template/email/netzarbeiter/customeractivation/customer_registration_admin.html ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Nuova registrazione Cliente in {{var store.getName()}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
12
+ <tr>
13
+ <td valign="top">
14
+ <p>
15
+ Nuova registrazione Cliente in {{var store.getName()}}.<br />
16
+ Nome: {{var customer.getName()}}<br />
17
+ Email: {{var customer.getEmail()}}
18
+ </p>
19
+
20
+ <p>
21
+ Per abilitare il Cliente, accedi al <a href="{{store url="adminhtml/customer"}}">Backend</a> e vai a
22
+ Clienti &gt; Gestisci Clienti &gt; {{var customer.getName()}} &gt; Informazioni account e
23
+ Attiva Account.
24
+ </p>
25
+
26
+ </td>
27
+ </tr>
28
+ </table>
29
+
30
+ </td>
31
+ </tr>
32
+ </table>
33
+ </div>
app/locale/ja_JP/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "This account is not activated.","このアカウントは有効化されていません。"
2
+ "Is activated","有効"
3
+ "Deactivated","無効"
4
+ "Activated","有効"
5
+ "Customer Activation","顧客の有効化"
6
+ "Disable CustomerActivation","CustomerActivationエクステンションを使用できないようにする"
7
+ "Please wait for your account to be activated","アカウントが有効化されるのをお待ちください。"
8
+ "Customer Registration Admin Notification","顧客新規登録のお知らせ"
9
+ "Customer Activation Notification","有効化のお知らせ"
10
+ "Notify Admin on Customer Registration","顧客新規登録があったら管理者へ連絡する"
11
+ "Admin Email Address","管理者のメールアドレス"
12
+ "Admin Notification Email Template","管理者へのお知らせのテンプレート"
13
+ "Notify Customer of Account Activation","アカウントが有効化されたら顧客へ連絡する"
14
+ "Customer Notification Email Template","顧客へのお知らせのテンプレート"
15
+ "Always enable in admin interface","管理パネルで常に有効化の設定をできるようにする"
16
+ "If you want to activate accounts created via the admin interface","管理パネルから作成した顧客も有効化できるようになります。"
17
+
app/locale/nl_NL/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Is activated","Is geactiveerd"
2
+ "This account is not activated.","Dit account is nog niet geactiveerd."
3
+ "Deactivated","Gedeactiveerd"
4
+ "Activated","Geactiveerd"
5
+ "Customer Activation","Klantactivering"
6
+ "Disable CustomerActivation","Klantactivering uitschakelen"
7
+ "Please wait for your account to be activated","Even geduld alstublieft - uw account moet nog geactiveerd worden."
8
+ "Customer Registration Admin Notification","Notificatie van klantregistratie aan beheer"
9
+ "Customer Activation Notification","Notificatie van klantactivering aan klant"
10
+ "Notify Admin on Customer Registration","Breng de beheerder op de hoogte van een klantregistratie"
11
+ "Admin Email Address","E-mailadres van beheerder"
12
+ "Admin Notification Email Template","E-mailsjabloon voor beheernotificatie"
13
+ "Notify Customer of Account Activation","Breng de klant op de hoogte van accountactivering"
14
+ "Customer Notification Email Template","E-mailsjabloon voor klantnotificatie"
15
+ "Always enable in admin interface","Altijd inschakelen in beheeromgeving"
16
+ "If you want to activate accounts created via the admin interface","Of u accounts wilt activeren die via de beheeromgeving zijn aangemaakt."
app/locale/pt_BR/Netzarbeiter_CustomerActivation.csv ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "This account is not activated.","Esta conta está desativada."
2
+ "Is activated","Está ativo"
3
+ "Deactivated","Desativar"
4
+ "Activated","Ativo"
5
+ "Customer Activation","Ativação de cliente"
6
+ "Disable CustomerActivation","Desabilitar CustomerActivation"
7
+ "Please wait for your account to be activated","Por favor espere que sua conta seja ativada"
8
+ "Customer Registration Admin Notification","Aviso para administrador de cadastro de cliente"
9
+ "Customer Activation Notification","Aviso de ativação de cliente"
10
+ "Notify Admin on Customer Registration","Avisar administrador quando ocorrer novo cadastro de cliente"
11
+ "Admin Email Address","Endereço de email do administrador"
12
+ "Admin Notification Email Template","Template de email de aviso para administrador"
13
+ "Notify Customer of Account Activation","Avisar cliente ao ativar a conta"
14
+ "Customer Notification Email Template","Template de email de aviso para cliente"
15
+ "Always enable in admin interface","Sempre habilitar na interface administrativa"
16
+ "If you want to activate accounts created via the admin interface","Se você quer ativar contas criadas pela interface administrativa"
17
+ "Activate new Customer Accounts by Default","Ativar novas contas de cliente por padrão"
18
+ "Always send Admin Notification","Sempre enviar aviso para Administrador"
19
+ "Send the Admin notification email even if new accounts are activated by default","Enviar para Administrador aviso de email mesmo se novas contas são ativas por padrão"
20
+ "Customer Activated","Cliente ativo"
21
+ "Yes","Sim"
22
+ "No","Não"
23
+ "Please select item(s)","Por favor selecione algum item"
24
+ "Total of %d record(s) were successfully saved","Total de %d registro(s) foram salvos com sucesso"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sitewards_B2BProfessional</name>
4
- <version>3.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
@@ -20,11 +20,11 @@ Features of the B2BProfessional Extension:&#xD;
20
  &#xB7; Activation for specific product categories&#xD;
21
  &#xB7; Activation for specific customer groups&#xD;
22
  &#xB7; Optional require login to access store</description>
23
- <notes>Updated availability information and add-to-cart functionality</notes>
24
  <authors><author><name>Sitewards Magento Team</name><user>sitewards</user><email>magento@sitewards.com</email></author></authors>
25
- <date>2014-12-15</date>
26
- <time>10:10:23</time>
27
- <contents><target name="magecommunity"><dir name="Sitewards"><dir name="B2BProfessional"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="List.php" hash="d69eb2648f4596835abe8a24cee566dc"/></dir></dir></dir><dir name="Docs"><file name="Sitewards_B2B_Professional_DE.pdf" hash="a857acd1c9a66db2da34ec77130d2d0d"/><file name="Sitewards_B2B_Professional_EN.pdf" hash="e60a445e495af6d1f8ebd42d86353c28"/></dir><dir name="Helper"><file name="Category.php" hash="72689cd7ea584379faf651d5dab7c351"/><file name="Core.php" hash="42335338c141593bc65b1e7913e4faf1"/><file name="Customer.php" hash="66f0f771c367e84181392f08efd693a4"/><file name="Data.php" hash="b5c6ab8a1117e73c967c06e64f644ea1"/><file name="Redirects.php" hash="9d1e940c32a08849db7fb5af2f85bf49"/></dir><dir name="Model"><file name="Observer.php" hash="a26d37e0cc36fc72de97927a30e8803a"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Category.php" hash="c45ee6c8eaaec42d239705b591c77919"/><file name="Page.php" hash="4527fdfc9bba40aa98dffc6db8fa5d3e"/></dir></dir></dir></dir><dir name="Test"><dir name="Helper"><dir name="Data"><dir name="fixtures"><file name="testIsExtensionActive.yaml" hash="1597dbaa9909bf2cd6cdc41188d79a40"/></dir></dir><file name="Data.php" hash="1c57859446ccbe78bdd3cf14cace8f19"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="4a2fcabe901e2baae0eea97a08f05363"/><file name="config.xml" hash="98c2cc6b3f6b37d960bbc914bdbb6756"/><file name="system.xml" hash="2b37ce38dd2ef8ed6fde97ebe503eac3"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sitewards_B2BProfessional.xml" hash="023a28f2a21cd706dea246807465b99f"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Sitewards_B2BProfessional.csv" hash="6015eda25375bedb1b91182fbf61b2af"/></dir><dir name="en_US"><file name="Sitewards_B2BProfessional.csv" hash="44feec9f9e16dcc49cb2576c3244df4b"/></dir><dir name="it_IT"><file name="Sitewards_B2BProfessional.csv" hash="6f0a26855c54dd742bd9638b97b416f4"/></dir></target></contents>
28
  <compatible/>
29
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Netzarbeiter_CustomerActivation</name><channel>community</channel><min>0.3.0</min><max>0.4.6</max></package></required></dependencies>
30
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sitewards_B2BProfessional</name>
4
+ <version>3.0.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
20
  &#xB7; Activation for specific product categories&#xD;
21
  &#xB7; Activation for specific customer groups&#xD;
22
  &#xB7; Optional require login to access store</description>
23
+ <notes>Updated documentation, added customer-activation as internal dependency</notes>
24
  <authors><author><name>Sitewards Magento Team</name><user>sitewards</user><email>magento@sitewards.com</email></author></authors>
25
+ <date>2014-12-22</date>
26
+ <time>15:04:09</time>
27
+ <contents><target name="magecommunity"><dir name="Sitewards"><dir name="B2BProfessional"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="List.php" hash="d69eb2648f4596835abe8a24cee566dc"/></dir></dir></dir><dir name="Docs"><file name="Sitewards_B2B_Professional_DE.pdf" hash="c60fafdaefead82b08237cabe6986d80"/><file name="Sitewards_B2B_Professional_EN.pdf" hash="18eea7066a3b4730088565cfcc8f6142"/></dir><dir name="Helper"><file name="Category.php" hash="72689cd7ea584379faf651d5dab7c351"/><file name="Core.php" hash="42335338c141593bc65b1e7913e4faf1"/><file name="Customer.php" hash="66f0f771c367e84181392f08efd693a4"/><file name="Data.php" hash="b5c6ab8a1117e73c967c06e64f644ea1"/><file name="Redirects.php" hash="44f9e00269c171d0c08b5dad298472f9"/></dir><dir name="Model"><file name="Observer.php" hash="a26d37e0cc36fc72de97927a30e8803a"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Category.php" hash="c45ee6c8eaaec42d239705b591c77919"/><file name="Page.php" hash="4527fdfc9bba40aa98dffc6db8fa5d3e"/></dir></dir></dir></dir><dir name="Test"><dir name="Helper"><dir name="Data"><dir name="fixtures"><file name="testIsExtensionActive.yaml" hash="1597dbaa9909bf2cd6cdc41188d79a40"/></dir></dir><file name="Data.php" hash="1c57859446ccbe78bdd3cf14cace8f19"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="4a2fcabe901e2baae0eea97a08f05363"/><file name="config.xml" hash="d5a5f61185c9a8cc6f0b0556150e7712"/><file name="system.xml" hash="2b37ce38dd2ef8ed6fde97ebe503eac3"/></dir></dir></dir><dir name="Netzarbeiter"><dir name="CustomerActivation"><dir name="Block"><dir name="Adminhtml"><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Boolean.php" hash="88a7eb4022aa91be0d8ea9fa8d08e715"/></dir></dir></dir></dir></dir></dir><file name="Changelog" hash="14c0d29ba3f5a54058589bb950090bd9"/><dir name="Helper"><file name="Data.php" hash="6179cf5b628d94ce38280562cbc2f3c0"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Customer"><dir name="Group"><file name="Multiselect.php" hash="6f558bf7c32d8eb16e7e6607e6f096cc"/></dir></dir></dir></dir></dir></dir><file name="Observer.php" hash="abb0a6a19b5871c598018d78405d1344"/><dir name="Resource"><file name="Customer.php" hash="a295e45c985a8beab17d54d24687d5a8"/></dir></dir><file name="README.md" hash="33df55a217f667afcd87c19496b80350"/><dir name="Test"><dir name="Controller"><dir name="Adminhtml"><file name="AbstractController.php" hash="ef7f942febfb04b2dde0450e58cbd82d"/><file name="AdminControllerTest.php" hash="4ddd98a65923e7297207408cade32c71"/><file name="CustomerGridTest.php" hash="8fa6ad9b308ebe1ec4abbdd3b635a26b"/><dir name="expectations"><file name="massActivation.yaml" hash="ebffda234a21235a2f3b203855bd7246"/></dir><dir name="providers"><file name="massActivation.yaml" hash="6d457618db2ce0a6728dabc921960717"/></dir></dir></dir><dir name="Helper"><dir name="Data"><dir name="Mock"><dir name="Zend"><file name="Mail.php" hash="bd135a5d8fe6da03e3848ef037044db9"/></dir></dir></dir><file name="DataTest.php" hash="2c9535b34f16b7723946ae93760ba667"/><dir name="fixtures"><file name="emailConfig.yaml" hash="2732b496ed842950bf2c33a422995282"/></dir></dir><dir name="Model"><file name="ObserverTest.php" hash="ccbb7ec182fc383fc3a19c7a93afa524"/><dir name="expectations"><file name="newCustomerActivationState.yaml" hash="24e63898053b0293e2c6d57931228dab"/></dir><dir name="providers"><file name="newCustomerActivationState.yaml" hash="4bf3c1699bc55da5c49852ba5d59c97f"/></dir></dir><dir name="fixtures"><file name="customers.yaml" hash="4b6862c2e9bd6bec4f610373a2e074e1"/><file name="global.yaml" hash="44644168f39d68e1114de369751cc3a5"/></dir></dir><dir name="controllers"><file name="AdminController.php" hash="8adb72029bc9d3ed3f2d97a7bf7e8e03"/></dir><dir name="etc"><file name="config.xml" hash="54ca37f92611a24e79f51b9575c42464"/><file name="system.xml" hash="8b3b906d33a61b2d8190c1dae3573774"/></dir><dir name="sql"><dir name="customeractivation_setup"><file name="mysql4-install-0.1.0.php" hash="7995bf06959e2a428e3bb6da2704e24c"/><file name="mysql4-upgrade-0.2.3-0.2.4.php" hash="a6bff43d0c10b10970e4120999b9377c"/><file name="mysql4-upgrade-0.2.4-0.2.5.php" hash="2f70f826b0790a2fbd1fa010c218069b"/><file name="mysql4-upgrade-0.2.7-0.2.8.php" hash="a293b26f0917de131ee10e2d98fd80df"/><file name="mysql4-upgrade-0.2.8-0.2.9.php" hash="1f03b47b77e8918899ffb2447658d26d"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sitewards_B2BProfessional.xml" hash="023a28f2a21cd706dea246807465b99f"/><file name="Netzarbeiter_CustomerActivation.xml" hash="6d16bbbce072b7c3786408870e94ac5d"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Sitewards_B2BProfessional.csv" hash="6015eda25375bedb1b91182fbf61b2af"/><file name="Netzarbeiter_CustomerActivation.csv" hash="00d9a97321b11a0cc32ce87fce670345"/><dir name="template"><dir name="email"><dir name="netzarbeiter"><dir name="customeractivation"><file name="customer_activation.html" hash="7835bbfe7aa6ef0a93d7e554419cbb0c"/><file name="customer_registration_admin.html" hash="49c09816c75c23782f31e845fd4d5561"/></dir></dir></dir></dir></dir><dir name="en_US"><file name="Sitewards_B2BProfessional.csv" hash="44feec9f9e16dcc49cb2576c3244df4b"/><file name="Netzarbeiter_CustomerActivation.csv" hash="2ada4e5d6c2579ae95025fa347237281"/><dir name="template"><dir name="email"><dir name="netzarbeiter"><dir name="customeractivation"><file name="customer_activation.html" hash="2f098f042ea40f988cd33bebb0b4e7ee"/><file name="customer_registration_admin.html" hash="a000b423edb7ab68107ef5a11fcfab22"/></dir></dir></dir></dir></dir><dir name="el_GR"><file name="Netzarbeiter_CustomerActivation.csv" hash="182b91397e9c875c0e587b881c267b49"/></dir><dir name="fr_FR"><file name="Netzarbeiter_CustomerActivation.csv" hash="fa6d984bdd5a833f3080d5dd5294995b"/></dir><dir name="it_IT"><file name="Netzarbeiter_CustomerActivation.csv" hash="912b3a3e3a8f67bdba88386c7cc595e3"/><dir name="template"><dir name="email"><dir name="netzarbeiter"><dir name="customeractivation"><file name="customer_activation.html" hash="4d7922617c7f5e783ca96f0ad279ef35"/><file name="customer_registration_admin.html" hash="e852880eb395d191f8688c3f67f1269c"/></dir></dir></dir></dir></dir><dir name="nl_NL"><file name="Netzarbeiter_CustomerActivation.csv" hash="ecabd445bdcf4e01dcead98129300d22"/></dir><dir name="ja_JP"><file name="Netzarbeiter_CustomerActivation.csv" hash="8dd790bec56409a98b7757563507eef5"/></dir><dir name="pt_BR"><file name="Netzarbeiter_CustomerActivation.csv" hash="337f72cd22dcb8975e24f7fe0c1e9215"/></dir></target></contents>
28
  <compatible/>
29
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>