PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.11.0
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.11.0
2.11.0 2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 All 78 releases
← All changes | Modules/Auth/AuthModdule.php +22 -0 2.9.02.11.0 View file →
@@ -28,8 +28,19 @@
28 28 add_action('wp_ajax_fcom_user_registration', [$this, 'handleUserSignup']);
29 29 add_action('wp_ajax_nopriv_fcom_user_login_form', [$this, 'handleUserLogin']);
30 30 add_action('wp_ajax_fcom_user_login_form', [$this, 'handleUserLogin']);
31 31
32 + /*
33 + * Declared here rather than where the auth screen renders, because the form that
34 + * screen draws posts back to admin-ajax and that is a different request: nothing
35 + * survives into it but what the browser sent. FluentAuth answers those posts only
36 + * for a host it already knows about.
37 + *
38 + * `is_fcom_auth` is the field the login form has always carried; FluentAuth's own
39 + * signed marker travels on the rest.
40 + */
41 + AuthHelper::registerWithFluentAuth();
42 +
32 43 add_filter('fluent_auth/login_redirect_url', function ($redirectUrl, $user) {
33 44 if (empty($_REQUEST['is_fcom_auth']) || empty($_REQUEST['fcom_redirect'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
34 45 return $redirectUrl;
35 46 }
@@ -190,8 +201,18 @@
190 201 $targetForm = 'accept_invitation';
191 202 }
192 203 }
193 204
205 + /*
206 + * Hand the screen to FluentAuth before asking whether it is available: adopting
207 + * is what makes it so. Its front end forms sit behind a site setting meant for
208 + * whether an editor may drop the shortcode into a page, and reading that as
209 + * "may this portal use FluentAuth" is what used to drop us onto a login form of
210 + * our own while FluentAuth went on injecting magic login and enforcing a second
211 + * factor against a DOM it no longer recognised.
212 + */
213 + AuthHelper::adoptFluentAuth();
214 +
194 215 $isFluentAuth = AuthHelper::isFluentAuthAvailable();
195 216 if (!$isFluentAuth && $targetForm == 'reset_password') {
196 217 $this->safeRedirectAndExit(wp_lostpassword_url(Helper::baseUrl()));
197 218 }
@@ -449,8 +470,9 @@
449 470 ], 422);
450 471 }
451 472
452 473 $data['email'] = sanitize_email($data['email']);
474 + $data['full_name'] = sanitize_text_field(Arr::get($data, 'full_name', ''));
453 475
454 476 $validations = [
455 477 'full_name' => 'required|max:100|string',
456 478 'username' => 'required|unique:users,user_login|unique:fcom_xprofile,username|min:4|max:30',