Google Authenticator – WordPress Two Factor Authentication (2FA) - Version 5.2.5

Version Description

  • Google Authenticator-Two Factor Authentication (2FA) : Some warnings in remote post.
Download this release

Release Info

Developer cyberlord92
Plugin Icon 128x128 Google Authenticator – WordPress Two Factor Authentication (2FA)
Version 5.2.5
Comparing to
See all releases

Code changes from version 5.2.4 to 5.2.5

api/class-customer-setup.php CHANGED
@@ -38,23 +38,15 @@ class Customer_Setup {
38
  function check_customer() {
39
  $url = MO_HOST_NAME . "/moas/rest/customer/check-if-exists";
40
  $email = get_option( "mo2f_email" );
41
-
42
  $fields = array (
43
  'email' => $email
44
  );
45
  $field_string = json_encode ( $fields );
46
 
47
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
48
- // $args = array(
49
- // 'method' => 'POST',
50
- // 'body' => $field_string,
51
- // 'timeout' => '5',
52
- // 'redirection' => '5',
53
- // 'httpversion' => '1.0',
54
- // 'blocking' => true,
55
- // 'headers' => $headers
56
- // );
57
- $response = Mo2f_Api::make_curl_call( $url, $field_string );
58
  return $response;
59
 
60
  }
@@ -62,12 +54,12 @@ class Customer_Setup {
62
  function send_email_alert( $email, $phone, $message ) {
63
 
64
  $url = MO_HOST_NAME . '/moas/api/notify/send';
65
- $ch = curl_init( $url );
66
-
67
  $customerKey = "16555";
68
  $apiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
69
 
70
- $currentTimeInMillis = Mo2f_Api::get_timestamp();
71
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
72
  $hashValue = hash( "sha512", $stringToHash );
73
  $fromEmail = $email;
@@ -106,19 +98,9 @@ class Customer_Setup {
106
  );
107
  $field_string = json_encode( $fields );
108
 
109
- $headers = Mo2f_Api::get_http_header_array();
110
- // $args = array(
111
- // 'method' => 'POST',
112
- // 'body' => $field_string,
113
- // 'timeout' => '5',
114
- // 'redirection' => '5',
115
- // 'httpversion' => '1.0',
116
- // 'blocking' => true,
117
- // 'headers' => $headers
118
- // );
119
-
120
- // $response = Mo2f_Api::mo2f_wp_remote_post($url, $args);
121
- $response = Mo2f_Api::make_curl_call( $url, $field_string, $headers );
122
  return $response;
123
 
124
 
@@ -133,7 +115,7 @@ class Customer_Setup {
133
  }
134
 
135
  $url = MO_HOST_NAME . '/moas/rest/customer/add';
136
-
137
  global $user;
138
  $user = wp_get_current_user();
139
  $this->email = get_option( 'mo2f_email' );
@@ -151,16 +133,8 @@ class Customer_Setup {
151
  );
152
  $field_string = json_encode( $fields );
153
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
154
- // $args = array(
155
- // 'method' => 'POST',
156
- // 'body' => $field_string,
157
- // 'timeout' => '5',
158
- // 'redirection' => '5',
159
- // 'httpversion' => '1.0',
160
- // 'blocking' => true,
161
- // 'headers' => $headers
162
- // );
163
- $content = Mo2f_Api::make_curl_call( $url, $field_string );
164
 
165
  return $content;
166
  }
@@ -174,10 +148,10 @@ class Customer_Setup {
174
  }
175
 
176
  $url = MO_HOST_NAME . "/moas/rest/customer/key";
177
- $ch = curl_init( $url );
178
  $email = get_option( "mo2f_email" );
179
  $password = get_option( "mo2f_password" );
180
-
181
  $fields = array(
182
  'email' => $email,
183
  'password' => $password
@@ -185,16 +159,7 @@ class Customer_Setup {
185
  $field_string = json_encode( $fields );
186
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
187
 
188
- // $args = array(
189
- // 'method' => 'POST',
190
- // 'body' => $field_string,
191
- // 'timeout' => '5',
192
- // 'redirection' => '5',
193
- // 'httpversion' => '1.0',
194
- // 'blocking' => true,
195
- // 'headers' => $headers
196
- // );
197
- $content = Mo2f_Api::make_curl_call( $url, $field_string );
198
 
199
  return $content;
200
  }
@@ -208,7 +173,7 @@ class Customer_Setup {
208
  }
209
 
210
  $url = MO_HOST_NAME . '/moas/api/auth/challenge';
211
-
212
  /* The customer Key provided to you */
213
  $customerKey = $cKey;
214
 
@@ -216,13 +181,13 @@ class Customer_Setup {
216
  $apiKey = $apiKey;
217
 
218
  /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
219
- $currentTimeInMillis = Mo2f_Api::get_timestamp();
220
 
221
  /* Creating the Hash using SHA-512 algorithm */
222
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
223
  $hashValue = hash( "sha512", $stringToHash );
224
 
225
- $headers = Mo2f_Api::get_http_header_array();
226
 
227
  $fields = '';
228
  if ( $authType == 'EMAIL' || $authType == 'OUT OF BAND EMAIL' ) {
@@ -259,7 +224,7 @@ class Customer_Setup {
259
  'blocking' => true,
260
  'headers' => $headers
261
  );
262
- $content = Mo2f_Api::make_curl_call( $url, $field_string, $headers );
263
  return $content;
264
  }
265
 
@@ -270,8 +235,8 @@ class Customer_Setup {
270
 
271
  $customerKey = $cKey;
272
  $apiKey = $apiKey;
273
-
274
- $currentTimeInMillis = Mo2f_Api::get_timestamp();
275
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
276
  $hashValue = hash( "sha512", $stringToHash );
277
 
@@ -284,18 +249,9 @@ class Customer_Setup {
284
 
285
  $field_string = json_encode( $fields );
286
 
287
- $headers = Mo2f_Api::get_http_header_array();
288
 
289
- // $args = array(
290
- // 'method' => 'POST',
291
- // 'body' => $field_string,
292
- // 'timeout' => '5',
293
- // 'redirection' => '5',
294
- // 'httpversion' => '1.0',
295
- // 'blocking' => true,
296
- // 'headers' => $headers
297
- // );
298
- $content = Mo2f_Api::make_curl_call( $url, $field_string, $headers );
299
 
300
  return $content;
301
  }
@@ -309,7 +265,7 @@ class Customer_Setup {
309
  }
310
 
311
  $url = MO_HOST_NAME . '/moas/api/auth/validate';
312
-
313
  /* The customer Key provided to you */
314
  $customerKey = $cKey;
315
 
@@ -317,13 +273,13 @@ class Customer_Setup {
317
  $apiKey = $customerApiKey;
318
 
319
  /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
320
- $currentTimeInMillis = Mo2f_Api::get_timestamp();
321
 
322
  /* Creating the Hash using SHA-512 algorithm */
323
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
324
  $hashValue = hash( "sha512", $stringToHash );
325
 
326
- $headers = Mo2f_Api::get_http_header_array();
327
  $fields = '';
328
  if ( $authType == 'SOFT TOKEN' || $authType == 'GOOGLE AUTHENTICATOR' ) {
329
  /*check for soft token*/
@@ -356,16 +312,8 @@ class Customer_Setup {
356
  }
357
  $field_string = json_encode( $fields );
358
 
359
- // $args = array(
360
- // 'method' => 'POST',
361
- // 'body' => $field_string,
362
- // 'timeout' => '5',
363
- // 'redirection' => '5',
364
- // 'httpversion' => '1.0',
365
- // 'blocking' => true,
366
- // 'headers' => $headers
367
- // );
368
- $content = Mo2f_Api::make_curl_call( $url, $field_string, $headers );
369
 
370
  return $content;
371
  }
@@ -383,7 +331,7 @@ class Customer_Setup {
383
  $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
384
  $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
385
 
386
-
387
  $customer_feature = "";
388
 
389
  if ( $is_ec_with_1_user ) {
@@ -405,17 +353,8 @@ class Customer_Setup {
405
  $field_string = json_encode( $fields );
406
 
407
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
408
-
409
- // $args = array(
410
- // 'method' => 'POST',
411
- // 'body' => $field_string,
412
- // 'timeout' => '5',
413
- // 'redirection' => '5',
414
- // 'httpversion' => '1.0',
415
- // 'blocking' => true,
416
- // 'headers' => $headers
417
- // );
418
- $content = Mo2f_Api::make_curl_call( $url, $field_string );
419
 
420
  return true;
421
  }
38
  function check_customer() {
39
  $url = MO_HOST_NAME . "/moas/rest/customer/check-if-exists";
40
  $email = get_option( "mo2f_email" );
41
+ $mo2fApi= new Mo2f_Api();
42
  $fields = array (
43
  'email' => $email
44
  );
45
  $field_string = json_encode ( $fields );
46
 
47
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
48
+
49
+ $response = $mo2fApi->make_curl_call( $url, $field_string );
 
 
 
 
 
 
 
 
50
  return $response;
51
 
52
  }
54
  function send_email_alert( $email, $phone, $message ) {
55
 
56
  $url = MO_HOST_NAME . '/moas/api/notify/send';
57
+
58
+ $mo2fApi= new Mo2f_Api();
59
  $customerKey = "16555";
60
  $apiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
61
 
62
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
63
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
64
  $hashValue = hash( "sha512", $stringToHash );
65
  $fromEmail = $email;
98
  );
99
  $field_string = json_encode( $fields );
100
 
101
+ $headers = $mo2fApi->get_http_header_array();
102
+
103
+ $response = $mo2fApi->make_curl_call( $url, $field_string, $headers );
 
 
 
 
 
 
 
 
 
 
104
  return $response;
105
 
106
 
115
  }
116
 
117
  $url = MO_HOST_NAME . '/moas/rest/customer/add';
118
+ $mo2fApi= new Mo2f_Api();
119
  global $user;
120
  $user = wp_get_current_user();
121
  $this->email = get_option( 'mo2f_email' );
133
  );
134
  $field_string = json_encode( $fields );
135
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
136
+
137
+ $content = $mo2fApi->make_curl_call( $url, $field_string );
 
 
 
 
 
 
 
 
138
 
139
  return $content;
140
  }
148
  }
149
 
150
  $url = MO_HOST_NAME . "/moas/rest/customer/key";
151
+
152
  $email = get_option( "mo2f_email" );
153
  $password = get_option( "mo2f_password" );
154
+ $mo2fApi= new Mo2f_Api();
155
  $fields = array(
156
  'email' => $email,
157
  'password' => $password
159
  $field_string = json_encode( $fields );
160
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
161
 
162
+ $content = $mo2fApi->make_curl_call( $url, $field_string );
 
 
 
 
 
 
 
 
 
163
 
164
  return $content;
165
  }
173
  }
174
 
175
  $url = MO_HOST_NAME . '/moas/api/auth/challenge';
176
+ $mo2fApi= new Mo2f_Api();
177
  /* The customer Key provided to you */
178
  $customerKey = $cKey;
179
 
181
  $apiKey = $apiKey;
182
 
183
  /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
184
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
185
 
186
  /* Creating the Hash using SHA-512 algorithm */
187
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
188
  $hashValue = hash( "sha512", $stringToHash );
189
 
190
+ $headers = $mo2fApi->get_http_header_array();
191
 
192
  $fields = '';
193
  if ( $authType == 'EMAIL' || $authType == 'OUT OF BAND EMAIL' ) {
224
  'blocking' => true,
225
  'headers' => $headers
226
  );
227
+ $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
228
  return $content;
229
  }
230
 
235
 
236
  $customerKey = $cKey;
237
  $apiKey = $apiKey;
238
+ $mo2fApi= new Mo2f_Api();
239
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
240
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
241
  $hashValue = hash( "sha512", $stringToHash );
242
 
249
 
250
  $field_string = json_encode( $fields );
251
 
252
+ $headers = $mo2fApi->get_http_header_array();
253
 
254
+ $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
 
 
 
 
 
 
 
 
 
255
 
256
  return $content;
257
  }
265
  }
266
 
267
  $url = MO_HOST_NAME . '/moas/api/auth/validate';
268
+ $mo2fApi= new Mo2f_Api();
269
  /* The customer Key provided to you */
270
  $customerKey = $cKey;
271
 
273
  $apiKey = $customerApiKey;
274
 
275
  /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
276
+ $currentTimeInMillis = $mo2fApi->get_timestamp();
277
 
278
  /* Creating the Hash using SHA-512 algorithm */
279
  $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
280
  $hashValue = hash( "sha512", $stringToHash );
281
 
282
+ $headers = $mo2fApi->get_http_header_array();
283
  $fields = '';
284
  if ( $authType == 'SOFT TOKEN' || $authType == 'GOOGLE AUTHENTICATOR' ) {
285
  /*check for soft token*/
312
  }
313
  $field_string = json_encode( $fields );
314
 
315
+
316
+ $content = $mo2fApi->make_curl_call( $url, $field_string, $headers );
 
 
 
 
 
 
 
 
317
 
318
  return $content;
319
  }
331
  $is_nc_with_1_user = get_option( 'mo2f_is_NC' ) && get_option( 'mo2f_is_NNC' );
332
  $is_ec_with_1_user = ! get_option( 'mo2f_is_NC' );
333
 
334
+ $mo2fApi= new Mo2f_Api();
335
  $customer_feature = "";
336
 
337
  if ( $is_ec_with_1_user ) {
353
  $field_string = json_encode( $fields );
354
 
355
  $headers = array("Content-Type"=>"application/json","charset"=>"UTF-8","Authorization"=>"Basic");
356
+
357
+ $content = $mo2fApi->make_curl_call( $url, $field_string );
 
 
 
 
 
 
 
 
 
358
 
359
  return true;
360
  }
api/class-rba-attributes.php CHANGED
@@ -39,10 +39,10 @@ class Miniorange_Rba_Attributes {
39
  $url = MO_HOST_NAME . '/moas/rest/rba/acs';
40
  $customerKey = get_option( 'mo2f_customerKey' );
41
  $field_string = "{\"customerKey\":\"" . $customerKey . "\",\"userKey\":\"" . $useremail . "\",\"attributes\":" . $rba_attributes . "}";
 
 
42
 
43
- $http_header_array = Mo2f_Api::get_http_header_array();
44
-
45
- return Mo2f_Api::make_curl_call( $url, $field_string, $http_header_array );
46
  }
47
 
48
  function get_curl_error_message() {
@@ -69,10 +69,11 @@ class Miniorange_Rba_Attributes {
69
  'userKey' => $useremail,
70
  'sessionUuid' => $sessionUuid
71
  );
 
 
 
72
 
73
- $http_header_array = Mo2f_Api::get_http_header_array();
74
-
75
- return Mo2f_Api::make_curl_call( $url, $field_string, $http_header_array );
76
  }
77
 
78
  function mo2f_register_rba_profile( $useremail, $sessionUuid ) {
@@ -88,10 +89,10 @@ class Miniorange_Rba_Attributes {
88
  'userKey' => $useremail,
89
  'sessionUuid' => $sessionUuid
90
  );
 
 
91
 
92
- $http_header_array = Mo2f_Api::get_http_header_array();
93
-
94
- return Mo2f_Api::make_curl_call( $url, $field_string, $http_header_array );
95
  }
96
 
97
  function mo2f_get_app_secret() {
@@ -99,6 +100,8 @@ class Miniorange_Rba_Attributes {
99
  if ( ! MO2f_Utility::is_curl_installed() ) {
100
  return $this->get_curl_error_message();
101
  }
 
 
102
 
103
  $url = MO_HOST_NAME . '/moas/rest/customer/getapp-secret';
104
  $customerKey = get_option( 'mo2f_customerKey' );
@@ -106,9 +109,9 @@ class Miniorange_Rba_Attributes {
106
  'customerId' => $customerKey
107
  );
108
 
109
- $http_header_array = Mo2f_Api::get_http_header_array();
110
 
111
- return Mo2f_Api::make_curl_call( $url, $field_string, $http_header_array );
112
  }
113
 
114
  function mo2f_google_auth_service( $useremail, $googleAuthenticatorName="" ) {
@@ -116,7 +119,7 @@ class Miniorange_Rba_Attributes {
116
  if ( ! MO2f_Utility::is_curl_installed() ) {
117
  return $this->get_curl_error_message();
118
  }
119
-
120
  $url = MO_HOST_NAME . '/moas/api/auth/google-auth-secret';
121
  $customerKey = get_option( 'mo2f_customerKey' );
122
  $field_string = array(
@@ -125,9 +128,9 @@ class Miniorange_Rba_Attributes {
125
  'googleAuthenticatorName' => $googleAuthenticatorName
126
  );
127
 
128
- $http_header_array = Mo2f_Api::get_http_header_array();
129
 
130
- return Mo2f_Api::make_curl_call( $url, $field_string, $http_header_array );
131
  }
132
 
133
  function mo2f_validate_google_auth( $useremail, $otptoken, $secret ) {
@@ -138,7 +141,8 @@ class Miniorange_Rba_Attributes {
138
 
139
 
140
  $url = MO_HOST_NAME . '/moas/api/auth/validate-google-auth-secret';
141
-
 
142
  $customerKey = get_option( 'mo2f_customerKey' );
143
  $field_string = array(
144
  'customerKey' => $customerKey,
@@ -147,9 +151,9 @@ class Miniorange_Rba_Attributes {
147
  'otpToken' => $otptoken
148
  );
149
 
150
- $http_header_array = Mo2f_Api::get_http_header_array();
151
 
152
- return Mo2f_Api::make_curl_call( $url, $field_string, $http_header_array );
153
  }
154
 
155
  }
39
  $url = MO_HOST_NAME . '/moas/rest/rba/acs';
40
  $customerKey = get_option( 'mo2f_customerKey' );
41
  $field_string = "{\"customerKey\":\"" . $customerKey . "\",\"userKey\":\"" . $useremail . "\",\"attributes\":" . $rba_attributes . "}";
42
+ $mo2fApi= new Mo2f_Api();
43
+ $http_header_array = $mo2fApi->get_http_header_array();
44
 
45
+ return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
 
 
46
  }
47
 
48
  function get_curl_error_message() {
69
  'userKey' => $useremail,
70
  'sessionUuid' => $sessionUuid
71
  );
72
+ $mo2fApi= new Mo2f_Api();
73
+
74
+ $http_header_array = $mo2fApi->get_http_header_array();
75
 
76
+ return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
 
 
77
  }
78
 
79
  function mo2f_register_rba_profile( $useremail, $sessionUuid ) {
89
  'userKey' => $useremail,
90
  'sessionUuid' => $sessionUuid
91
  );
92
+ $mo2fApi= new Mo2f_Api();
93
+ $http_header_array = $mo2fApi->get_http_header_array();
94
 
95
+ return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
 
 
96
  }
97
 
98
  function mo2f_get_app_secret() {
100
  if ( ! MO2f_Utility::is_curl_installed() ) {
101
  return $this->get_curl_error_message();
102
  }
103
+
104
+ $mo2fApi= new Mo2f_Api();
105
 
106
  $url = MO_HOST_NAME . '/moas/rest/customer/getapp-secret';
107
  $customerKey = get_option( 'mo2f_customerKey' );
109
  'customerId' => $customerKey
110
  );
111
 
112
+ $http_header_array = $mo2fApi->get_http_header_array();
113
 
114
+ return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
115
  }
116
 
117
  function mo2f_google_auth_service( $useremail, $googleAuthenticatorName="" ) {
119
  if ( ! MO2f_Utility::is_curl_installed() ) {
120
  return $this->get_curl_error_message();
121
  }
122
+ $mo2fApi= new Mo2f_Api();
123
  $url = MO_HOST_NAME . '/moas/api/auth/google-auth-secret';
124
  $customerKey = get_option( 'mo2f_customerKey' );
125
  $field_string = array(
128
  'googleAuthenticatorName' => $googleAuthenticatorName
129
  );
130
 
131
+ $http_header_array = $mo2fApi->get_http_header_array();
132
 
133
+ return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
134
  }
135
 
136
  function mo2f_validate_google_auth( $useremail, $otptoken, $secret ) {
141
 
142
 
143
  $url = MO_HOST_NAME . '/moas/api/auth/validate-google-auth-secret';
144
+ $mo2fApi= new Mo2f_Api();
145
+
146
  $customerKey = get_option( 'mo2f_customerKey' );
147
  $field_string = array(
148
  'customerKey' => $customerKey,
151
  'otpToken' => $otptoken
152
  );
153
 
154
+ $http_header_array = $mo2fApi->get_http_header_array();
155
 
156
+ return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
157
  }
158
 
159
  }
api/class-two-factor-setup.php CHANGED
@@ -40,10 +40,10 @@ class Two_Factor_Setup {
40
  $fields = array(
41
  'txId' => $tId
42
  );
 
 
43
 
44
- $http_header_array = Mo2f_Api::get_http_header_array();
45
-
46
- return Mo2f_Api::make_curl_call( $url, $fields, $http_header_array );
47
  }
48
 
49
 
@@ -69,10 +69,11 @@ class Two_Factor_Setup {
69
  'customerId' => $customerKey,
70
  'username' => $useremail
71
  );
 
72
 
73
- $http_header_array = Mo2f_Api::get_http_header_array();
74
 
75
- return Mo2f_Api::make_curl_call( $url, $fields, $http_header_array );
76
  }
77
 
78
  function mo_check_user_already_exist( $email ) {
@@ -87,10 +88,10 @@ class Two_Factor_Setup {
87
  'customerKey' => $customerKey,
88
  'username' => $email,
89
  );
 
 
90
 
91
- $http_header_array = Mo2f_Api::get_http_header_array();
92
-
93
- return Mo2f_Api::make_curl_call( $url, $fields, $http_header_array );
94
  }
95
 
96
  function mo_create_user( $currentuser, $email ) {
@@ -107,10 +108,10 @@ class Two_Factor_Setup {
107
  'firstName' => $currentuser->user_firstname,
108
  'lastName' => $currentuser->user_lastname
109
  );
 
 
110
 
111
- $http_header_array = Mo2f_Api::get_http_header_array();
112
-
113
- return Mo2f_Api::make_curl_call( $url, $fields, $http_header_array );
114
  }
115
 
116
  function mo2f_get_userinfo( $email ) {
@@ -125,10 +126,10 @@ class Two_Factor_Setup {
125
  'customerKey' => $customerKey,
126
  'username' => $email,
127
  );
 
 
128
 
129
- $http_header_array = Mo2f_Api::get_http_header_array();
130
-
131
- return Mo2f_Api::make_curl_call( $url, $fields, $http_header_array );
132
  }
133
 
134
  function mo2f_update_userinfo( $email, $authType, $phone, $tname, $enableAdminSecondFactor ) {
@@ -147,9 +148,12 @@ class Two_Factor_Setup {
147
  'transactionName' => $tname,
148
  'adminLoginSecondFactor' => $enableAdminSecondFactor
149
  );
150
- $http_header_array = Mo2f_Api::get_http_header_array();
 
 
 
151
 
152
- return Mo2f_Api::make_curl_call( $url, $fields, $http_header_array );
153
  }
154
 
155
  function register_kba_details( $email, $question1, $answer1, $question2, $answer2, $question3, $answer3 ) {
@@ -162,10 +166,11 @@ class Two_Factor_Setup {
162
  $customerKey = get_option( 'mo2f_customerKey' );
163
  $q_and_a_list = "[{\"question\":\"" . $question1 . "\",\"answer\":\"" . $answer1 . "\" },{\"question\":\"" . $question2 . "\",\"answer\":\"" . $answer2 . "\" },{\"question\":\"" . $question3 . "\",\"answer\":\"" . $answer3 . "\" }]";
164
  $field_string = "{\"customerKey\":\"" . $customerKey . "\",\"username\":\"" . $email . "\",\"questionAnswerList\":" . $q_and_a_list . "}";
 
 
 
165
 
166
- $http_header_array = Mo2f_Api::get_http_header_array();
167
-
168
- return Mo2f_Api::make_curl_call( $url, $field_string, $http_header_array );
169
 
170
  }
171
  }
40
  $fields = array(
41
  'txId' => $tId
42
  );
43
+ $mo2fApi= new Mo2f_Api();
44
+ $http_header_array = $mo2fApi->get_http_header_array();
45
 
46
+ return $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
 
 
47
  }
48
 
49
 
69
  'customerId' => $customerKey,
70
  'username' => $useremail
71
  );
72
+ $mo2fApi= new Mo2f_Api();
73
 
74
+ $http_header_array = $mo2fApi->get_http_header_array();
75
 
76
+ return $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
77
  }
78
 
79
  function mo_check_user_already_exist( $email ) {
88
  'customerKey' => $customerKey,
89
  'username' => $email,
90
  );
91
+ $mo2fApi= new Mo2f_Api();
92
+ $http_header_array = $mo2fApi->get_http_header_array();
93
 
94
+ return $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
 
 
95
  }
96
 
97
  function mo_create_user( $currentuser, $email ) {
108
  'firstName' => $currentuser->user_firstname,
109
  'lastName' => $currentuser->user_lastname
110
  );
111
+ $mo2fApi= new Mo2f_Api();
112
+ $http_header_array = $mo2fApi->get_http_header_array();
113
 
114
+ return $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
 
 
115
  }
116
 
117
  function mo2f_get_userinfo( $email ) {
126
  'customerKey' => $customerKey,
127
  'username' => $email,
128
  );
129
+ $mo2fApi= new Mo2f_Api();
130
+ $http_header_array = $mo2fApi->get_http_header_array();
131
 
132
+ return $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
 
 
133
  }
134
 
135
  function mo2f_update_userinfo( $email, $authType, $phone, $tname, $enableAdminSecondFactor ) {
148
  'transactionName' => $tname,
149
  'adminLoginSecondFactor' => $enableAdminSecondFactor
150
  );
151
+
152
+ $mo2fApi= new Mo2f_Api();
153
+
154
+ $http_header_array = $mo2fApi->get_http_header_array();
155
 
156
+ return $mo2fApi->make_curl_call( $url, $fields, $http_header_array );
157
  }
158
 
159
  function register_kba_details( $email, $question1, $answer1, $question2, $answer2, $question3, $answer3 ) {
166
  $customerKey = get_option( 'mo2f_customerKey' );
167
  $q_and_a_list = "[{\"question\":\"" . $question1 . "\",\"answer\":\"" . $answer1 . "\" },{\"question\":\"" . $question2 . "\",\"answer\":\"" . $answer2 . "\" },{\"question\":\"" . $question3 . "\",\"answer\":\"" . $answer3 . "\" }]";
168
  $field_string = "{\"customerKey\":\"" . $customerKey . "\",\"username\":\"" . $email . "\",\"questionAnswerList\":" . $q_and_a_list . "}";
169
+
170
+ $mo2fApi= new Mo2f_Api();
171
+ $http_header_array = $mo2fApi->get_http_header_array();
172
 
173
+ return $mo2fApi->make_curl_call( $url, $field_string, $http_header_array );
 
 
174
 
175
  }
176
  }
miniorange_2_factor_settings.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
- * Version: 5.2.4
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
@@ -26,7 +26,7 @@ require( 'class-miniorange-2-factor-pass2fa-login.php' );
26
  require('resources/constants.php');
27
  require('resources/messages.php');
28
  define( 'MOAUTH_PATH', plugins_url( __FILE__ ) );
29
- define( 'MO2F_VERSION', '5.2.4' );
30
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
31
 
32
 
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
+ * Version: 5.2.5
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
26
  require('resources/constants.php');
27
  require('resources/messages.php');
28
  define( 'MOAUTH_PATH', plugins_url( __FILE__ ) );
29
+ define( 'MO2F_VERSION', '5.2.5' );
30
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
31
 
32
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://miniorange.com/
5
  Requires at least: 3.0.1
6
  Tested up to: 5.2
7
  Requires PHP: 5.3.0
8
- Stable tag: 5.2.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -271,6 +271,9 @@ miniOrange authentication service has 15+ authentication methods.One time passco
271
 
272
  == Changelog ==
273
 
 
 
 
274
  = 5.2.4 =
275
  * Google Authenticator-Two Factor Authentication (2FA) : Removed curl calls and unncessary files.
276
 
@@ -653,6 +656,10 @@ More descriptive setup messages and UI changes.
653
 
654
  == Upgrade Notice ==
655
 
 
 
 
 
656
  = 5.2.4 =
657
  * Google Authenticator-Two Factor Authentication (2FA) : Removed curl calls and unncessary files.
658
 
5
  Requires at least: 3.0.1
6
  Tested up to: 5.2
7
  Requires PHP: 5.3.0
8
+ Stable tag: 5.2.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
271
 
272
  == Changelog ==
273
 
274
+ = 5.2.5 =
275
+ * Google Authenticator-Two Factor Authentication (2FA) : Some warnings in remote post.
276
+
277
  = 5.2.4 =
278
  * Google Authenticator-Two Factor Authentication (2FA) : Removed curl calls and unncessary files.
279
 
656
 
657
  == Upgrade Notice ==
658
 
659
+
660
+ = 5.2.5 =
661
+ * Google Authenticator-Two Factor Authentication (2FA) : Some warnings in remote post.
662
+
663
  = 5.2.4 =
664
  * Google Authenticator-Two Factor Authentication (2FA) : Removed curl calls and unncessary files.
665