Theme My Login - Version 6.2.1

Version Description

  • Add post password handling
  • Don't block admin when DOING_AJAX
  • Add WordPress updated message
  • Replace deprecated get_userdatabylogin with get_user_by
Download this release

Release Info

Developer jfarthing84
Plugin Icon 128x128 Theme My Login
Version 6.2.1
Comparing to
See all releases

Code changes from version 6.2 to 6.2.1

includes/class-theme-my-login.php CHANGED
@@ -217,6 +217,22 @@ class Theme_My_Login {
217
  } else {
218
  $http_post = ( 'POST' == $_SERVER['REQUEST_METHOD'] );
219
  switch ( $action ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  case 'logout' :
221
  check_admin_referer( 'log-out' );
222
 
@@ -303,7 +319,7 @@ class Theme_My_Login {
303
  // If the user wants ssl but the session is not ssl, force a secure cookie.
304
  if ( !empty( $_POST['log'] ) && !force_ssl_admin() ) {
305
  $user_name = sanitize_user( $_POST['log'] );
306
- if ( $user = get_userdatabylogin( $user_name ) ) {
307
  if ( get_user_option( 'use_ssl', $user->ID ) ) {
308
  $secure_cookie = true;
309
  force_ssl_admin( true );
@@ -379,6 +395,8 @@ class Theme_My_Login {
379
  $errors->add( 'registered', __( 'Registration complete. Please check your e-mail.', 'theme-my-login' ), 'message' );
380
  elseif ( $interim_login )
381
  $errors->add( 'expired', __( 'Your session has expired. Please log-in again.', 'theme-my-login' ), 'message' );
 
 
382
  elseif ( $reauth )
383
  $errors->add( 'reauth', __( 'Please log in to continue.', 'theme-my-login' ), 'message' );
384
 
217
  } else {
218
  $http_post = ( 'POST' == $_SERVER['REQUEST_METHOD'] );
219
  switch ( $action ) {
220
+ case 'postpass' :
221
+ global $wp_hasher;
222
+
223
+ if ( empty( $wp_hasher ) ) {
224
+ require_once( ABSPATH . 'wp-includes/class-phpass.php' );
225
+ // By default, use the portable hash from phpass
226
+ $wp_hasher = new PasswordHash( 8, true );
227
+ }
228
+
229
+ // 10 days
230
+ setcookie( 'wp-postpass_' . COOKIEHASH, $wp_hasher->HashPassword( stripslashes( $_POST['post_password'] ) ), time() + 864000, COOKIEPATH );
231
+
232
+ wp_safe_redirect( wp_get_referer() );
233
+ exit;
234
+
235
+ break;
236
  case 'logout' :
237
  check_admin_referer( 'log-out' );
238
 
319
  // If the user wants ssl but the session is not ssl, force a secure cookie.
320
  if ( !empty( $_POST['log'] ) && !force_ssl_admin() ) {
321
  $user_name = sanitize_user( $_POST['log'] );
322
+ if ( $user = get_user_by( 'login', $user_name ) ) {
323
  if ( get_user_option( 'use_ssl', $user->ID ) ) {
324
  $secure_cookie = true;
325
  force_ssl_admin( true );
395
  $errors->add( 'registered', __( 'Registration complete. Please check your e-mail.', 'theme-my-login' ), 'message' );
396
  elseif ( $interim_login )
397
  $errors->add( 'expired', __( 'Your session has expired. Please log-in again.', 'theme-my-login' ), 'message' );
398
+ elseif ( strpos( $redirect_to, 'about.php?updated' ) )
399
+ $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' );
400
  elseif ( $reauth )
401
  $errors->add( 'reauth', __( 'Please log in to continue.', 'theme-my-login' ), 'message' );
402
 
modules/themed-profiles/themed-profiles.php CHANGED
@@ -30,7 +30,7 @@ class Theme_My_Login_Themed_Profiles extends Theme_My_Login_Module {
30
  if ( is_multisite() && empty( $user_role ) ) {
31
  $user_role = 'subscriber';
32
  }
33
- if ( 'profile.php' == $pagenow && !isset( $_REQUEST['page'] ) ) {
34
  if ( $theme_my_login->options->get_option( array( 'themed_profiles', $user_role, 'theme_profile' ) ) ) {
35
  if ( !empty( $_GET ) )
36
  $redirect_to = add_query_arg( (array) $_GET, $redirect_to );
@@ -39,8 +39,10 @@ class Theme_My_Login_Themed_Profiles extends Theme_My_Login_Module {
39
  }
40
  } else {
41
  if ( $theme_my_login->options->get_option( array( 'themed_profiles', $user_role, 'restrict_admin' ) ) ) {
42
- wp_redirect( $redirect_to );
43
- exit();
 
 
44
  }
45
  }
46
  }
30
  if ( is_multisite() && empty( $user_role ) ) {
31
  $user_role = 'subscriber';
32
  }
33
+ if ( 'profile.php' == $pagenow && ! isset( $_REQUEST['page'] ) ) {
34
  if ( $theme_my_login->options->get_option( array( 'themed_profiles', $user_role, 'theme_profile' ) ) ) {
35
  if ( !empty( $_GET ) )
36
  $redirect_to = add_query_arg( (array) $_GET, $redirect_to );
39
  }
40
  } else {
41
  if ( $theme_my_login->options->get_option( array( 'themed_profiles', $user_role, 'restrict_admin' ) ) ) {
42
+ if ( ! defined( 'DOING_AJAX' ) ) {
43
+ wp_redirect( $redirect_to );
44
+ exit;
45
+ }
46
  }
47
  }
48
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: jfarthing84
3
  Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
4
  Requires at least: 3.1
5
  Tested up to: 3.4
6
- Stable tag: 6.2
7
 
8
  Themes the WordPress login pages according to your theme.
9
 
@@ -41,6 +41,12 @@ Please visit http://www.jfarthing.com/docs/category/theme-my-login first and the
41
 
42
  == Changelog ==
43
 
 
 
 
 
 
 
44
  = 6.2 =
45
  * Fix FORCE_SSL_ADMIN logic
46
  * Add tabindex to password fields
3
  Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
4
  Requires at least: 3.1
5
  Tested up to: 3.4
6
+ Stable tag: 6.2.1
7
 
8
  Themes the WordPress login pages according to your theme.
9
 
41
 
42
  == Changelog ==
43
 
44
+ = 6.2.1 =
45
+ * Add post password handling
46
+ * Don't block admin when DOING_AJAX
47
+ * Add WordPress updated message
48
+ * Replace deprecated get_userdatabylogin with get_user_by
49
+
50
  = 6.2 =
51
  * Fix FORCE_SSL_ADMIN logic
52
  * Add tabindex to password fields
theme-my-login.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: Theme My Login
4
- Plugin URI: http://www.jfarthing.com/extend/wordpress-plugins/theme-my-login/
5
  Description: Themes the WordPress login, registration and forgot password pages according to your theme.
6
- Version: 6.2
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login
1
  <?php
2
  /*
3
  Plugin Name: Theme My Login
4
+ Plugin URI: http://www.jfarthing.com/development/theme-my-login/
5
  Description: Themes the WordPress login, registration and forgot password pages according to your theme.
6
+ Version: 6.2.1
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login