PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/dynamics/acychecker/plugin.php +18 -3 10.0.1 → 11.1.0 View file →
@@ -88,23 +88,38 @@
88 88 }
89 89
90 90 public function onAcymBeforeUserCreate(&$user)
91 91 {
92 + // CTE isn't installed
92 93 if (!acym_isAcyCheckerInstalled()) return true;
93 94
95 + // The email verification is disabled in the configuration
94 96 if ($this->config->get('email_verification') == 0) return true;
95 97
96 98 $this->loadAcychecker();
97 99
98 - $cteConfig = new ConfigurationClass();
100 + $cteConfig = ConfigurationClass::getConfiguration();
99 101 $conditions = $cteConfig->get('registration_conditions');
100 102
103 + // If no condition is selected, return
101 104 if (empty($conditions) || $conditions === 'domain_not_exists') return true;
102 105
106 + // Perform test using CTE code API
103 107 $apiService = new ApiService();
104 - $emailOk = $apiService->testEmail($user->email, $conditions);
108 +
109 + // Retro compatibility for AcyChecker 1.4
110 + if (method_exists($apiService, 'testUser')) {
111 + $testUser = new stdClass();
112 + $testUser->email = $user->email;
113 + $testUser->name = $user->name;
114 + $emailOk = $apiService->testUser($testUser, $conditions);
115 + } else {
116 + $emailOk = $apiService->testEmail($user->email, $conditions);
117 + }
118 +
105 119 if ($emailOk !== true) {
106 - acym_setVar('acychecker_error', acym_translation('ACYM_INVALID_EMAIL_ADDRESS'));
120 + $message = $emailOk === 'blacklisted_name' ? 'ACYM_INVALID_NAME' : 'ACYM_INVALID_EMAIL_ADDRESS';
121 + acym_setVar('acychecker_error', acym_translation($message));
107 122
108 123 return false;
109 124 }
110 125