Changeset 3790914
- Timestamp:
- 11/08/2026 11:35:50 AM (less than one hour ago)
- Location:
- tso-login-organizer/trunk
- Files:
-
- 1 added
- 3 edited
-
changelog.txt (added)
-
includes/tsolo-actions.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
tso-login-organizer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tso-login-organizer/trunk/includes/tsolo-actions.php
r3788843 r3790914 582 582 tsolo_set_errors( $errors ); 583 583 584 if ( $reauth ) { 584 // wp-admin sends visitors here with reauth=1 whenever it cannot validate the auth cookie. When it was 585 // opened on another host (e.g. non-www) than the one that holds the session, the session on THIS host 586 // is still valid: do not wipe it, or one stray admin link logs the user out. Same-host reauth keeps 587 // the standard behaviour (clear the cookies so the login form is shown again). 588 $request_host = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized above. 589 $cross_host = tsolo_reauth_is_cross_host_bounce( $redirect_to, $request_host ); 590 if ( tsolo_reauth_should_clear_auth_cookie( $reauth, is_user_logged_in(), $cross_host ) ) { 585 591 wp_clear_auth_cookie(); 586 592 } … … 589 595 tsolo_send_ajax_error( array( 'errors' => tsolo_render_errors_html( $errors ) ) ); 590 596 } 597 } 598 599 /** 600 * Whether a reauth=1 request is a bounce from wp-admin opened on another host (e.g. non-www). 601 * 602 * @param string $redirect_to redirect_to request value (the wp-admin URL that bounced). 603 * @param string $request_host Host of the current (login page) request. 604 * @return bool True only when both hosts are known and differ (port ignored). 605 */ 606 function tsolo_reauth_is_cross_host_bounce( $redirect_to, $request_host ) { 607 $target = wp_parse_url( (string) $redirect_to, PHP_URL_HOST ); 608 $here = preg_replace( '/:\d+$/', '', strtolower( (string) $request_host ) ); 609 if ( ! is_string( $target ) || '' === $target || '' === $here ) { 610 return false; 611 } 612 return strtolower( $target ) !== $here; 613 } 614 615 /** 616 * Whether the login page must clear the auth cookies on a reauth=1 request. 617 * 618 * Clears like WordPress core, except when the visitor already has a valid session on this host and 619 * wp-admin bounced from a different host: that session is fine and must be kept. 620 * 621 * @param bool $reauth Whether reauth was requested. 622 * @param bool $logged_in Whether the visitor has a valid session on this host. 623 * @param bool $cross_host Whether the bounce came from another host. 624 * @return bool 625 */ 626 function tsolo_reauth_should_clear_auth_cookie( $reauth, $logged_in, $cross_host = false ) { 627 return (bool) $reauth && ! ( $logged_in && $cross_host ); 591 628 } 592 629 -
tso-login-organizer/trunk/readme.txt
r3789986 r3790914 6 6 Tested up to: 7.1 7 7 Requires PHP: 7.4 8 Stable tag: 1.0. 38 Stable tag: 1.0.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 102 102 == Changelog == 103 103 104 = 1.0.4 = 105 * Fix: opening wp-admin on another host (for example without "www") no longer logs you out; the login page keeps a session that is still valid. 106 104 107 = 1.0.3 = 105 108 * Improvement: avatars no longer repeat the same database lookup for commenters' emails on every avatar. … … 131 134 * Front: widgets no longer get extra bottom spacing on mobile, 2FA backup codes wrap and social buttons are easier to tap. 132 135 133 = 1.0.1 = 134 * Two-factor: wrong codes are limited, a code cannot be reused, XML-RPC needs an application password and the code field also shows on wp-login.php. 135 * Security: old lockout attempts are purged, and Hide wp-login.php no longer blocks when the plugin login page is not reachable. 136 * Profile: the current password is needed to change email, password or turn two-factor off. 137 * Password reset: an empty password now shows an error. 138 * Social login and email confirmation: clear message when cancelled or when the link is invalid. 139 * Module settings keep the line breaks of email texts. 140 * Avatars use random file names and are removed when the user is deleted. 141 * Secret keys are masked in the settings screen. 142 * Default role can only be set to a role the admin may assign. 143 * Uninstall also removes the new two-factor and restriction data. 144 * Uninstall keeps your data unless "Delete all plugin data" is ticked in Core settings. 145 * Security: choose the visitor IP source (Cloudflare, X-Forwarded-For, X-Real-IP) and list IPs that are never locked out. 146 * Two-factor: users of a role that requires it are kept on their profile until they enable it. 147 * Restrictions: the role box is available on every public post type and restricted content is blocked completely (login redirect or 403). 148 * Email confirmation links expire after 48 hours and a new link is sent automatically; approved users get an email. 149 * Social login: administrator accounts are never linked by email and the requested redirect is kept. 150 * Captcha: new filter tsolo_captcha_fail_open for provider outages. 151 * Mailchimp subscriptions run in the background so registration is not delayed. 152 * Avatars are resized to 256 px. 153 * Reserved page slugs are refused and page lookups are cached. 154 * Favorites: the button recovers by itself when a cached page has an expired security token. 155 156 = 1.0.0 = 157 * First plugin version. 136 See changelog.txt in the plugin folder for older versions. -
tso-login-organizer/trunk/tso-login-organizer.php
r3789986 r3790914 3 3 * Plugin Name: TSO Login Organizer 4 4 * Description: Your own login, registration and password-reset pages inside your site, instead of wp-login.php, plus optional 2FA, security and social login. 5 * Version: 1.0. 35 * Version: 1.0.4 6 6 * Author: Tu Soporte Online 7 7 * Author URI: https://www.tusoporteonline.es/blog … … 26 26 27 27 if ( ! defined( 'TSOLO_VERSION' ) ) { 28 define( 'TSOLO_VERSION', '1.0. 3' );28 define( 'TSOLO_VERSION', '1.0.4' ); 29 29 } 30 30
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)