Changeset 3041265
- Timestamp:
- 02/26/2024 12:37:55 PM (22 months ago)
- Location:
- passwordless-login
- Files:
-
- 11 added
- 3 edited
-
tags/1.1.3 (added)
-
tags/1.1.3/assets (added)
-
tags/1.1.3/assets/logo_150_150.png (added)
-
tags/1.1.3/assets/style-back-end.css (added)
-
tags/1.1.3/assets/style-front-end.css (added)
-
tags/1.1.3/inc (added)
-
tags/1.1.3/inc/wpa.class.notices.php (added)
-
tags/1.1.3/languages (added)
-
tags/1.1.3/languages/passwordless-login.pot (added)
-
tags/1.1.3/passwordless_login.php (added)
-
tags/1.1.3/readme.txt (added)
-
trunk/inc/wpa.class.notices.php (modified) (1 diff)
-
trunk/passwordless_login.php (modified) (10 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
passwordless-login/trunk/inc/wpa.class.notices.php
r2190567 r3041265 49 49 50 50 function dismiss_notification() { 51 52 if( empty( $_GET['_wpnonce'] ) || !wp_verify_nonce( sanitize_text_field( $_GET['_wpnonce'] ), 'wpa_notice_dismiss' ) ) 53 return; 54 51 55 global $current_user; 52 56 -
passwordless-login/trunk/passwordless_login.php
r2761240 r3041265 2 2 /** 3 3 * Plugin Name: Passwordless Login 4 * Plugin URI: http ://www.cozmoslabs.com4 * Plugin URI: https://www.cozmoslabs.com 5 5 * Description: Shortcode based login form. Enter an email/username and get link via email that will automatically log you in. 6 * Version: 1.1. 26 * Version: 1.1.3 7 7 * Author: Cozmoslabs, sareiodata 8 * Author URI: http :/www.cozmoslabs.com8 * Author URI: https://www.cozmoslabs.com 9 9 * License: GPL2 10 10 * Text Domain: passwordless-login … … 35 35 * 36 36 */ 37 define( 'PASSWORDLESS_LOGIN_VERSION', '1.1. 2' );37 define( 'PASSWORDLESS_LOGIN_VERSION', '1.1.3' ); 38 38 define( 'WPA_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) ); 39 39 define( 'WPA_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); … … 146 146 function wpa_front_end_login(){ 147 147 ob_start(); 148 $account = ( isset( $_POST['user_email_username']) ) ? $account = sanitize_text_field( $_POST['user_email_username'] ) : false;149 $error_token = ( isset( $_GET['wpa_error_token']) ) ? $error_token= sanitize_key( $_GET['wpa_error_token'] ) : false;148 $account = ( isset( $_POST['user_email_username']) ) ? $account = sanitize_text_field( $_POST['user_email_username'] ) : false; 149 $error_token = ( isset( $_GET['wpa_error_token']) ) ? $error_token = sanitize_key( $_GET['wpa_error_token'] ) : false; 150 150 $adminapp_error = ( isset( $_GET['wpa_adminapp_error']) ) ? sanitize_key( $_GET['wpa_adminapp_error'] ) : false; 151 151 … … 156 156 } elseif ( is_user_logged_in() ) { 157 157 $current_user = wp_get_current_user(); 158 echo '<p class="wpa-box wpa-alert">'.apply_filters('wpa_success_login_msg', sprintf(__( 'You are currently logged in as %1$s. %2$s', 'passwordless-login' ), '<a href="'. $authorPostsUrl = get_author_posts_url( $current_user->ID ).'" title="'.$current_user->display_name.'">'.$current_user->display_name.'</a>', '<a href="'.wp_logout_url( $redirectTo = wpa_curpageurl() ).'" title="'.__( 'Log out of this account', 'passwordless-login' ).'">'. __( 'Log out', 'passwordless-login').' »</a>' ) ) . '</p><!-- .alert-->';158 echo '<p class="wpa-box wpa-alert">'.apply_filters('wpa_success_login_msg', sprintf(__( 'You are currently logged in as %1$s. %2$s', 'passwordless-login' ), '<a href="'.esc_url( get_author_posts_url( $current_user->ID ) ).'" title="'.esc_attr( $current_user->display_name ).'">'.esc_html( $current_user->display_name ).'</a>', '<a href="'.esc_url( wp_logout_url( $redirectTo = wpa_curpageurl() ) ).'" title="'.__( 'Log out of this account', 'passwordless-login' ).'">'. __( 'Log out', 'passwordless-login').' »</a>' ) ) . '</p><!-- .alert-->'; 159 159 } else { 160 160 if ( is_wp_error($sent_link) ){ 161 echo '<p class="wpa-box wpa-error">' . apply_filters( 'wpa_error', $sent_link->get_error_message() ) . '</p>';161 echo '<p class="wpa-box wpa-error">' . esc_html( apply_filters( 'wpa_error', $sent_link->get_error_message() ) ) . '</p>'; 162 162 } 163 163 if( $error_token ) { … … 186 186 <form name="wpaloginform" id="wpaloginform" action="" method="post"> 187 187 <p> 188 <label for="user_email_username"><?php echo ( apply_filters('wpa_change_form_label', $label)); ?></label>188 <label for="user_email_username"><?php echo esc_html( apply_filters('wpa_change_form_label', $label ) ); ?></label> 189 189 <input type="text" name="user_email_username" id="user_email_username" class="input" value="<?php echo esc_attr( $account ); ?>" size="25" /> 190 190 <input type="submit" name="wpa-submit" id="wpa-submit" class="button-primary" value="<?php esc_attr_e('Log In', 'passwordless-login'); ?>" /> … … 233 233 } 234 234 235 return new WP_Error( 'invalid_account', __( 'The username or email you provided do not exist. Please try again.', 'passwordless-login' ) );235 return new WP_Error( 'invalid_account', __( 'The username or email you provided does not exist. Please try again.', 'passwordless-login' ) ); 236 236 } 237 237 … … 339 339 340 340 if( isset( $_GET['token'] ) && isset( $_GET['uid'] ) && isset( $_GET['nonce'] ) ){ 341 $uid = sanitize_key( $_GET['uid'] );342 $token =sanitize_key( $_REQUEST['token'] );343 $nonce = sanitize_key( $_REQUEST['nonce'] );344 345 $hash_meta = get_user_meta( $uid, 'wpa_' . $uid, true);341 $uid = sanitize_key( $_GET['uid'] ); 342 $token = sanitize_key( $_REQUEST['token'] ); 343 $nonce = sanitize_key( $_REQUEST['nonce'] ); 344 345 $hash_meta = get_user_meta( $uid, 'wpa_' . $uid, true); 346 346 $hash_meta_expiration = get_user_meta( $uid, 'wpa_' . $uid . '_expiration', true); 347 $arr_params = array( 'uid', 'token', 'nonce' );348 $current_page_url = remove_query_arg( $arr_params, wpa_curpageurl() );347 $arr_params = array( 'uid', 'token', 'nonce' ); 348 $current_page_url = remove_query_arg( $arr_params, wpa_curpageurl() ); 349 349 350 350 require_once( ABSPATH . 'wp-includes/class-phpass.php'); 351 351 $wp_hasher = new PasswordHash(8, TRUE); 352 $time = time();352 $time = time(); 353 353 354 354 $wppb_generalSettings = get_option('wppb_general_settings', 'not_found');//profile builder settings are required for admin approval compatibility … … 369 369 update_option( 'wpa_total_logins', $total_logins + 1); 370 370 371 if (function_exists('wppb_custom_redirect_url')){ 372 wp_redirect( apply_filters('wpa_after_login_redirect', wppb_custom_redirect_url('after_login', $current_page_url ) ) ); 373 exit; 374 } 375 376 wp_redirect( apply_filters('wpa_after_login_redirect', $current_page_url ) ); 371 if ( function_exists('wppb_custom_redirect_url') ){ 372 $wppb_custom_redirects_url = wppb_custom_redirect_url( 'after_login', $current_page_url ); 373 } 374 375 $redirect_url = !empty( $wppb_custom_redirects_url ) ? $wppb_custom_redirects_url : $current_page_url; 376 377 wp_redirect( apply_filters('wpa_after_login_redirect', $redirect_url ) ); 377 378 exit; 378 379 } 380 379 381 } 380 382 } … … 421 423 $req_uri = $_SERVER['REQUEST_URI']; 422 424 423 $home_path = trim( parse_url( home_url(), PHP_URL_PATH ), '/' ); 425 $parsed_url = parse_url( home_url(), PHP_URL_PATH ); 426 427 if( !empty( $parsed_url ) ) 428 $home_path = trim( $parsed_url, '/' ); 429 else 430 $home_path = $parsed_url; 431 432 if( $home_path === null || $home_path === false ) 433 $home_path = ''; 434 424 435 $home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) ); 425 436 … … 440 451 * @return string 441 452 */ 442 443 include_once("inc/wpa.class.notices.php"); 444 $learn_more_notice = new WPA_Add_Notices( 445 'wpa_learn_more', 446 sprintf( __( '<p>Use [passwordless-login] shortcode in your pages or widgets. %1$sLearn more.%2$s %3$sDismiss%4$s</p>', 'passwordless-login'), "<a href='users.php?page=passwordless-login&wpa_learn_more_dismiss_notification=0'>", "</a>", "<a href='". add_query_arg( 'wpa_learn_more_dismiss_notification', '0' ) ."' class='wpa-dismiss-notification' style='float:right;margin-left:20px;'> ", "</a>" ), 447 'updated', '', '' 448 ); 453 add_action( 'admin_init', 'wpa_admin_general_notices', 9 ); 454 function wpa_admin_general_notices(){ 455 include_once("inc/wpa.class.notices.php"); 456 $learn_more_notice = new WPA_Add_Notices( 457 'wpa_learn_more', 458 sprintf( __( '<p>Use [passwordless-login] shortcode in your pages or widgets. %1$sLearn more.%2$s %3$sDismiss%4$s</p>', 'passwordless-login'), "<a href='users.php?page=passwordless-login&wpa_learn_more_dismiss_notification=0'>", "</a>", "<a href='". wp_nonce_url( add_query_arg( 'wpa_learn_more_dismiss_notification', '0' ), 'wpa_notice_dismiss' ) ."' class='wpa-dismiss-notification' style='float:right;margin-left:20px;'> ", "</a>" ), 459 'updated', '', '' 460 ); 461 } -
passwordless-login/trunk/readme.txt
r2761240 r3041265 5 5 Tags: passwordless login, passwordless, front-end login, login shortcode, custom login form, login without password, passwordless authentication 6 6 Requires at least: 3.9 7 Tested up to: 6. 0.18 Stable tag: 1.1. 27 Tested up to: 6.4.3 8 Stable tag: 1.1.3 9 9 10 10 … … 77 77 78 78 == Changelog == 79 = 1.1.3 = 80 * Fix: XSS issue with the already logged in message. Thanks to Mat Rollings 81 * Fix: Added nonce check for the admin notice dismiss action 82 * Fix: Sanitize additional output 83 * Fix: A compatibility bug with Profile Builder when an after login redirect returned an empty string 79 84 80 85 = 1.1.2 =
Note: See TracChangeset
for help on using the changeset viewer.