Theme My Login - Version 6.4.1

Version Description

  • Allow array of actions in Theme_My_Login::is_tml_page()
  • Lost Password nav menu item will only show when not logged in
  • Hide action links on Reset Password page
  • Fix false password reset error caused by referer redirection
  • Fix PHP strict warning about abstract class constructor compatibility
Download this release

Release Info

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

Code changes from version 6.4 to 6.4.1

admin/class-theme-my-login-admin.php CHANGED
@@ -96,7 +96,7 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
96
  register_setting( 'theme_my_login', 'theme_my_login', array( &$this, 'save_settings' ) );
97
 
98
  // Install/Upgrade
99
- if ( version_compare( $this->get_option( 'version', 0 ), Theme_My_Login::version, '<' ) )
100
  $this->install();
101
 
102
  // Add sections
@@ -116,7 +116,7 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
116
  * @access public
117
  */
118
  public function admin_enqueue_scripts() {
119
- wp_enqueue_script( 'theme-my-login-admin', plugins_url( 'theme-my-login/admin/js/theme-my-login-admin.js' ), array( 'jquery' ), Theme_My_Login::version, true );
120
  wp_localize_script( 'theme-my-login-admin', 'tmlAdmin', array(
121
  'interim_login_url' => site_url( 'wp-login.php?interim-login=1', 'login' )
122
  ) );
@@ -256,7 +256,7 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
256
  global $wpdb;
257
 
258
  // Current version
259
- $version = $this->get_option( 'version', Theme_My_Login::version );
260
 
261
  // Check if legacy page exists
262
  if ( $page_id = $this->get_option( 'page_id' ) ) {
@@ -351,7 +351,7 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
351
  do_action( 'tml_activate_' . $module );
352
  }
353
 
354
- $this->set_option( 'version', Theme_My_Login::version );
355
  $this->save_options();
356
  }
357
 
96
  register_setting( 'theme_my_login', 'theme_my_login', array( &$this, 'save_settings' ) );
97
 
98
  // Install/Upgrade
99
+ if ( version_compare( $this->get_option( 'version', 0 ), Theme_My_Login::VERSION, '<' ) )
100
  $this->install();
101
 
102
  // Add sections
116
  * @access public
117
  */
118
  public function admin_enqueue_scripts() {
119
+ wp_enqueue_script( 'theme-my-login-admin', plugins_url( 'theme-my-login/admin/js/theme-my-login-admin.js' ), array( 'jquery' ), Theme_My_Login::VERSION, true );
120
  wp_localize_script( 'theme-my-login-admin', 'tmlAdmin', array(
121
  'interim_login_url' => site_url( 'wp-login.php?interim-login=1', 'login' )
122
  ) );
256
  global $wpdb;
257
 
258
  // Current version
259
+ $version = $this->get_option( 'version', Theme_My_Login::VERSION );
260
 
261
  // Check if legacy page exists
262
  if ( $page_id = $this->get_option( 'page_id' ) ) {
351
  do_action( 'tml_activate_' . $module );
352
  }
353
 
354
+ $this->set_option( 'version', Theme_My_Login::VERSION );
355
  $this->save_options();
356
  }
357
 
includes/class-theme-my-login-abstract.php CHANGED
@@ -73,9 +73,13 @@ abstract class Theme_My_Login_Abstract {
73
  * @param string $class Class to instantiate
74
  * @return object Instance of $class
75
  */
76
- public static function get_object( $class ) {
 
 
 
77
  if ( ! isset( self::$objects[$class] ) )
78
  self::$objects[$class] = new $class;
 
79
  return self::$objects[$class];
80
  }
81
 
73
  * @param string $class Class to instantiate
74
  * @return object Instance of $class
75
  */
76
+ public static function get_object( $class = null ) {
77
+ if ( ! class_exists( $class ) )
78
+ return null;
79
+
80
  if ( ! isset( self::$objects[$class] ) )
81
  self::$objects[$class] = new $class;
82
+
83
  return self::$objects[$class];
84
  }
85
 
includes/class-theme-my-login-common.php CHANGED
@@ -100,7 +100,7 @@ class Theme_My_Login_Common {
100
 
101
  // Iterate through matches
102
  foreach ( $matches[0] as $key => $match ) {
103
- if ( ! isset( $replacements[$match] ) ) {
104
  if ( $user && isset( $user->{$matches[1][$key]} ) ) // Replacement from WP_User object
105
  $replacements[$match] = $user->{$matches[1][$key]};
106
  else
@@ -122,6 +122,30 @@ class Theme_My_Login_Common {
122
 
123
  return str_replace( $search, $replace, $input );
124
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
  endif; // Class exists
127
 
100
 
101
  // Iterate through matches
102
  foreach ( $matches[0] as $key => $match ) {
103
+ if ( ! isset( $replacements[$match] ) ) {
104
  if ( $user && isset( $user->{$matches[1][$key]} ) ) // Replacement from WP_User object
105
  $replacements[$match] = $user->{$matches[1][$key]};
106
  else
122
 
123
  return str_replace( $search, $replace, $input );
124
  }
125
+
126
+ /**
127
+ * Strip unwanted query arguments from a URL
128
+ *
129
+ * @since 6.4.1
130
+ *
131
+ * @param string $url The URL
132
+ * @return string The URL
133
+ */
134
+ public static function strip_query_args( $url ) {
135
+ return remove_query_arg( array(
136
+ 'instance',
137
+ 'action',
138
+ 'checkemail',
139
+ 'error',
140
+ 'loggedout',
141
+ 'registered',
142
+ 'redirect_to',
143
+ 'updated',
144
+ 'key',
145
+ '_wpnonce',
146
+ 'reauth'
147
+ ), $url );
148
+ }
149
  }
150
  endif; // Class exists
151
 
includes/class-theme-my-login.php CHANGED
@@ -21,7 +21,7 @@ class Theme_My_Login extends Theme_My_Login_Abstract {
21
  * @since 6.3.2
22
  * @const string
23
  */
24
- const version = '6.4';
25
 
26
  /**
27
  * Holds options key
@@ -778,12 +778,8 @@ if(typeof wpOnload=='function')wpOnload()
778
  // User is logged in
779
  if ( is_user_logged_in() ) {
780
 
781
- // Change Login to Logout
782
- if ( self::is_tml_page( 'login', $menu_item->object_id ) ) {
783
- $menu_item->_invalid = true;
784
-
785
- // Hide Register
786
- } elseif ( self::is_tml_page( 'register', $menu_item->object_id ) ) {
787
  $menu_item->_invalid = true;
788
  }
789
 
@@ -899,7 +895,7 @@ if(typeof wpOnload=='function')wpOnload()
899
  *
900
  * @since 6.3
901
  *
902
- * @param string $action The action to check
903
  * @param int|object Post ID or object
904
  * @return bool True if $action is for $page, false otherwise
905
  */
@@ -913,7 +909,10 @@ if(typeof wpOnload=='function')wpOnload()
913
  if ( ! $page_action = self::get_page_action( $page->ID ) )
914
  return false;
915
 
916
- if ( empty( $action ) || $action == $page_action )
 
 
 
917
  return true;
918
 
919
  return false;
21
  * @since 6.3.2
22
  * @const string
23
  */
24
+ const VERSION = '6.4.1';
25
 
26
  /**
27
  * Holds options key
778
  // User is logged in
779
  if ( is_user_logged_in() ) {
780
 
781
+ // Hide login, register and lost password
782
+ if ( self::is_tml_page( array( 'login', 'register', 'lostpassword' ), $menu_item->object_id ) ) {
 
 
 
 
783
  $menu_item->_invalid = true;
784
  }
785
 
895
  *
896
  * @since 6.3
897
  *
898
+ * @param array|string $action An action or array of actions to check
899
  * @param int|object Post ID or object
900
  * @return bool True if $action is for $page, false otherwise
901
  */
909
  if ( ! $page_action = self::get_page_action( $page->ID ) )
910
  return false;
911
 
912
+ if ( empty( $action ) )
913
+ return true;
914
+
915
+ if ( in_array( $page_action, (array) $action ) )
916
  return true;
917
 
918
  return false;
language/theme-my-login.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Theme My Login package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Theme My Login 6.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/theme-my-login\n"
7
- "POT-Creation-Date: 2015-08-31 18:58:35+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -70,167 +70,167 @@ msgstr ""
70
  msgid "Enable %s"
71
  msgstr ""
72
 
73
- #: includes/class-theme-my-login-ms-signup.php:109
74
  msgctxt "Multisite active signup type"
75
  msgid "all"
76
  msgstr ""
77
 
78
- #: includes/class-theme-my-login-ms-signup.php:110
79
  msgctxt "Multisite active signup type"
80
  msgid "none"
81
  msgstr ""
82
 
83
- #: includes/class-theme-my-login-ms-signup.php:111
84
  msgctxt "Multisite active signup type"
85
  msgid "blog"
86
  msgstr ""
87
 
88
- #: includes/class-theme-my-login-ms-signup.php:112
89
  msgctxt "Multisite active signup type"
90
  msgid "user"
91
  msgstr ""
92
 
93
- #: includes/class-theme-my-login-ms-signup.php:115
94
  msgid ""
95
  "Greetings Site Administrator! You are currently allowing &#8220;%s&#8221; "
96
  "registrations. To change or disable registration go to your <a href=\"%s"
97
  "\">Options page</a>."
98
  msgstr ""
99
 
100
- #: includes/class-theme-my-login-ms-signup.php:121
101
  msgid "Registration has been disabled."
102
  msgstr ""
103
 
104
- #: includes/class-theme-my-login-ms-signup.php:123
105
  msgid ""
106
  "You must first <a href=\"%s\">log in</a>, and then you can create a new site."
107
  msgstr ""
108
 
109
- #: includes/class-theme-my-login-ms-signup.php:147
110
  msgid "%s is your new username"
111
  msgstr ""
112
 
113
- #: includes/class-theme-my-login-ms-signup.php:148
114
  msgid ""
115
  "But, before you can start using your new username, <strong>you must activate "
116
  "it</strong>."
117
  msgstr ""
118
 
119
- #: includes/class-theme-my-login-ms-signup.php:149
120
  msgid "Check your inbox at <strong>%1$s</strong> and click the link given."
121
  msgstr ""
122
 
123
- #: includes/class-theme-my-login-ms-signup.php:150
124
  msgid ""
125
  "If you do not activate your username within two days, you will have to sign "
126
  "up again."
127
  msgstr ""
128
 
129
- #: includes/class-theme-my-login-ms-signup.php:154
130
  msgid "User registration has been disabled."
131
  msgstr ""
132
 
133
- #: includes/class-theme-my-login-ms-signup.php:186
134
  msgid "Congratulations! Your new site, %s, is almost ready."
135
  msgstr ""
136
 
137
- #: includes/class-theme-my-login-ms-signup.php:188
138
  msgid ""
139
  "But, before you can start using your site, <strong>you must activate it</"
140
  "strong>."
141
  msgstr ""
142
 
143
- #: includes/class-theme-my-login-ms-signup.php:189
144
  msgid "Check your inbox at <strong>%s</strong> and click the link given."
145
  msgstr ""
146
 
147
- #: includes/class-theme-my-login-ms-signup.php:190
148
  msgid ""
149
  "If you do not activate your site within two days, you will have to sign up "
150
  "again."
151
  msgstr ""
152
 
153
- #: includes/class-theme-my-login-ms-signup.php:191
154
  msgid "Still waiting for your email?"
155
  msgstr ""
156
 
157
- #: includes/class-theme-my-login-ms-signup.php:193
158
  msgid ""
159
  "If you haven&#8217;t received your email yet, there are a number of things "
160
  "you can do:"
161
  msgstr ""
162
 
163
- #: includes/class-theme-my-login-ms-signup.php:195
164
  msgid ""
165
  "Wait a little longer. Sometimes delivery of email can be delayed by "
166
  "processes outside of our control."
167
  msgstr ""
168
 
169
- #: includes/class-theme-my-login-ms-signup.php:196
170
  msgid ""
171
  "Check the junk or spam folder of your email client. Sometime emails wind up "
172
  "there by mistake."
173
  msgstr ""
174
 
175
- #: includes/class-theme-my-login-ms-signup.php:197
176
  msgid ""
177
  "Have you entered your email correctly? You have entered %s, if it&#8217;s "
178
  "incorrect, you will not receive your email."
179
  msgstr ""
180
 
181
- #: includes/class-theme-my-login-ms-signup.php:203
182
  msgid "Site registration has been disabled."
183
  msgstr ""
184
 
185
- #: includes/class-theme-my-login-ms-signup.php:227
186
  msgid "The site %s is yours."
187
  msgstr ""
188
 
189
- #: includes/class-theme-my-login-ms-signup.php:229
190
  msgid ""
191
  "<a href=\"http://%1$s\">http://%2$s</a> is your new site. <a href=\"%3$s"
192
  "\">Log in</a> as &#8220;%4$s&#8221; using your existing password."
193
  msgstr ""
194
 
195
- #: includes/class-theme-my-login-ms-signup.php:245
196
  msgid "Sorry, new registrations are not allowed at this time."
197
  msgstr ""
198
 
199
- #: includes/class-theme-my-login-ms-signup.php:247
200
  msgid "You are logged in already. No need to register again!"
201
  msgstr ""
202
 
203
- #: includes/class-theme-my-login-ms-signup.php:253
204
  msgid ""
205
  "<p><em>The site you were looking for, <strong>%s</strong> does not exist, "
206
  "but you can create it now!</em></p>"
207
  msgstr ""
208
 
209
- #: includes/class-theme-my-login-ms-signup.php:255
210
  msgid ""
211
  "<p><em>The site you were looking for, <strong>%s</strong>, does not exist.</"
212
  "em></p>"
213
  msgstr ""
214
 
215
- #: includes/class-theme-my-login-ms-signup.php:397
216
  msgid "Activation Key Required"
217
  msgstr ""
218
 
219
- #: includes/class-theme-my-login-ms-signup.php:400
220
  msgid "Activation Key:"
221
  msgstr ""
222
 
223
- #: includes/class-theme-my-login-ms-signup.php:404
224
- #: includes/class-theme-my-login-ms-signup.php:476
225
  msgid "Activate"
226
  msgstr ""
227
 
228
- #: includes/class-theme-my-login-ms-signup.php:416
229
- #: includes/class-theme-my-login-ms-signup.php:436
230
  msgid "Your account is now active!"
231
  msgstr ""
232
 
233
- #: includes/class-theme-my-login-ms-signup.php:420
234
  msgid ""
235
  "Your account has been activated. You may now <a href=\"%1$s\">login</a> to "
236
  "the site using your chosen username of &#8220;%2$s&#8221;. Please check "
@@ -240,7 +240,7 @@ msgid ""
240
  "password</a>."
241
  msgstr ""
242
 
243
- #: includes/class-theme-my-login-ms-signup.php:422
244
  msgid ""
245
  "Your site at <a href=\"%1$s\">%2$s</a> is active. You may now log in to your "
246
  "site using your chosen username of &#8220;%3$s&#8221;. Please check your "
@@ -250,27 +250,27 @@ msgid ""
250
  "password</a>."
251
  msgstr ""
252
 
253
- #: includes/class-theme-my-login-ms-signup.php:427
254
  msgid "An error occurred during the activation"
255
  msgstr ""
256
 
257
- #: includes/class-theme-my-login-ms-signup.php:439
258
  #: templates/ms-signup-user-form.php:14
259
  msgid "Username:"
260
  msgstr ""
261
 
262
- #: includes/class-theme-my-login-ms-signup.php:440
263
  #: modules/custom-passwords/custom-passwords.php:95
264
  msgid "Password:"
265
  msgstr ""
266
 
267
- #: includes/class-theme-my-login-ms-signup.php:444
268
  msgid ""
269
  "Your account is now activated. <a href=\"%1$s\">View your site</a> or <a "
270
  "href=\"%2$s\">Login</a>"
271
  msgstr ""
272
 
273
- #: includes/class-theme-my-login-ms-signup.php:446
274
  msgid ""
275
  "Your account is now activated. <a href=\"%1$s\">Login</a> or go back to the "
276
  "<a href=\"%2$s\">homepage</a>."
@@ -429,92 +429,92 @@ msgstr ""
429
  msgid "Please log in to continue."
430
  msgstr ""
431
 
432
- #: includes/class-theme-my-login.php:1134
433
  msgid "<strong>ERROR</strong>: Enter a username or e-mail address."
434
  msgstr ""
435
 
436
- #: includes/class-theme-my-login.php:1138
437
  msgid ""
438
  "<strong>ERROR</strong>: There is no user registered with that email address."
439
  msgstr ""
440
 
441
- #: includes/class-theme-my-login.php:1150
442
  msgid "<strong>ERROR</strong>: Invalid username or e-mail."
443
  msgstr ""
444
 
445
- #: includes/class-theme-my-login.php:1164
446
  msgid "Password reset is not allowed for this user"
447
  msgstr ""
448
 
449
- #: includes/class-theme-my-login.php:1181
450
  msgid "Someone requested that the password be reset for the following account:"
451
  msgstr ""
452
 
453
- #: includes/class-theme-my-login.php:1183
454
- #: modules/custom-email/custom-email.php:840
455
- #: modules/custom-email/custom-email.php:869
456
  #: modules/user-moderation/admin/user-moderation-admin.php:382
457
  #: modules/user-moderation/user-moderation.php:460
458
  msgid "Username: %s"
459
  msgstr ""
460
 
461
- #: includes/class-theme-my-login.php:1184
462
  msgid "If this was a mistake, just ignore this email and nothing will happen."
463
  msgstr ""
464
 
465
- #: includes/class-theme-my-login.php:1185
466
  msgid "To reset your password, visit the following address:"
467
  msgstr ""
468
 
469
- #: includes/class-theme-my-login.php:1196
470
  msgid "[%s] Password Reset"
471
  msgstr ""
472
 
473
- #: includes/class-theme-my-login.php:1202
474
  #: modules/user-moderation/admin/user-moderation-admin.php:252
475
  #: modules/user-moderation/admin/user-moderation-admin.php:394
476
  #: modules/user-moderation/admin/user-moderation-admin.php:436
477
  msgid "The e-mail could not be sent."
478
  msgstr ""
479
 
480
- #: includes/class-theme-my-login.php:1202
481
  #: modules/user-moderation/admin/user-moderation-admin.php:252
482
  #: modules/user-moderation/admin/user-moderation-admin.php:394
483
  #: modules/user-moderation/admin/user-moderation-admin.php:436
484
  msgid "Possible reason: your host may have disabled the mail() function..."
485
  msgstr ""
486
 
487
- #: includes/class-theme-my-login.php:1244
488
  msgid "<strong>ERROR</strong>: Please enter a username."
489
  msgstr ""
490
 
491
- #: includes/class-theme-my-login.php:1246
492
  msgid ""
493
  "<strong>ERROR</strong>: This username is invalid because it uses illegal "
494
  "characters. Please enter a valid username."
495
  msgstr ""
496
 
497
- #: includes/class-theme-my-login.php:1249
498
  msgid ""
499
  "<strong>ERROR</strong>: This username is already registered, please choose "
500
  "another one."
501
  msgstr ""
502
 
503
- #: includes/class-theme-my-login.php:1254
504
  msgid "<strong>ERROR</strong>: Please type your e-mail address."
505
  msgstr ""
506
 
507
- #: includes/class-theme-my-login.php:1256
508
  msgid "<strong>ERROR</strong>: The email address isn&#8217;t correct."
509
  msgstr ""
510
 
511
- #: includes/class-theme-my-login.php:1259
512
  msgid ""
513
  "<strong>ERROR</strong>: This email is already registered, please choose "
514
  "another one."
515
  msgstr ""
516
 
517
- #: includes/class-theme-my-login.php:1272
518
  msgid ""
519
  "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a "
520
  "href=\"mailto:%s\">webmaster</a> !"
@@ -738,33 +738,33 @@ msgstr ""
738
  msgid "Disable Notification"
739
  msgstr ""
740
 
741
- #: modules/custom-email/custom-email.php:839
742
  msgid "New user registration on your site %s:"
743
  msgstr ""
744
 
745
- #: modules/custom-email/custom-email.php:841
746
  #: modules/user-moderation/user-moderation.php:461
747
  msgid "E-mail: %s"
748
  msgstr ""
749
 
750
- #: modules/custom-email/custom-email.php:843
751
  msgid "[%s] New User Registration"
752
  msgstr ""
753
 
754
- #: modules/custom-email/custom-email.php:870
755
  #: modules/user-moderation/admin/user-moderation-admin.php:383
756
  msgid "To set your password, visit the following address:"
757
  msgstr ""
758
 
759
- #: modules/custom-email/custom-email.php:875
760
  msgid "[%s] Your username and password info"
761
  msgstr ""
762
 
763
- #: modules/custom-email/custom-email.php:903
764
  msgid "[%s] Password Lost/Changed"
765
  msgstr ""
766
 
767
- #: modules/custom-email/custom-email.php:904
768
  msgid "Password Lost and Changed for user: %s"
769
  msgstr ""
770
 
2
  # This file is distributed under the same license as the Theme My Login package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Theme My Login 6.4.x\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/theme-my-login\n"
7
+ "POT-Creation-Date: 2015-10-16 15:51:39+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
70
  msgid "Enable %s"
71
  msgstr ""
72
 
73
+ #: includes/class-theme-my-login-ms-signup.php:104
74
  msgctxt "Multisite active signup type"
75
  msgid "all"
76
  msgstr ""
77
 
78
+ #: includes/class-theme-my-login-ms-signup.php:105
79
  msgctxt "Multisite active signup type"
80
  msgid "none"
81
  msgstr ""
82
 
83
+ #: includes/class-theme-my-login-ms-signup.php:106
84
  msgctxt "Multisite active signup type"
85
  msgid "blog"
86
  msgstr ""
87
 
88
+ #: includes/class-theme-my-login-ms-signup.php:107
89
  msgctxt "Multisite active signup type"
90
  msgid "user"
91
  msgstr ""
92
 
93
+ #: includes/class-theme-my-login-ms-signup.php:110
94
  msgid ""
95
  "Greetings Site Administrator! You are currently allowing &#8220;%s&#8221; "
96
  "registrations. To change or disable registration go to your <a href=\"%s"
97
  "\">Options page</a>."
98
  msgstr ""
99
 
100
+ #: includes/class-theme-my-login-ms-signup.php:116
101
  msgid "Registration has been disabled."
102
  msgstr ""
103
 
104
+ #: includes/class-theme-my-login-ms-signup.php:118
105
  msgid ""
106
  "You must first <a href=\"%s\">log in</a>, and then you can create a new site."
107
  msgstr ""
108
 
109
+ #: includes/class-theme-my-login-ms-signup.php:142
110
  msgid "%s is your new username"
111
  msgstr ""
112
 
113
+ #: includes/class-theme-my-login-ms-signup.php:143
114
  msgid ""
115
  "But, before you can start using your new username, <strong>you must activate "
116
  "it</strong>."
117
  msgstr ""
118
 
119
+ #: includes/class-theme-my-login-ms-signup.php:144
120
  msgid "Check your inbox at <strong>%1$s</strong> and click the link given."
121
  msgstr ""
122
 
123
+ #: includes/class-theme-my-login-ms-signup.php:145
124
  msgid ""
125
  "If you do not activate your username within two days, you will have to sign "
126
  "up again."
127
  msgstr ""
128
 
129
+ #: includes/class-theme-my-login-ms-signup.php:149
130
  msgid "User registration has been disabled."
131
  msgstr ""
132
 
133
+ #: includes/class-theme-my-login-ms-signup.php:181
134
  msgid "Congratulations! Your new site, %s, is almost ready."
135
  msgstr ""
136
 
137
+ #: includes/class-theme-my-login-ms-signup.php:183
138
  msgid ""
139
  "But, before you can start using your site, <strong>you must activate it</"
140
  "strong>."
141
  msgstr ""
142
 
143
+ #: includes/class-theme-my-login-ms-signup.php:184
144
  msgid "Check your inbox at <strong>%s</strong> and click the link given."
145
  msgstr ""
146
 
147
+ #: includes/class-theme-my-login-ms-signup.php:185
148
  msgid ""
149
  "If you do not activate your site within two days, you will have to sign up "
150
  "again."
151
  msgstr ""
152
 
153
+ #: includes/class-theme-my-login-ms-signup.php:186
154
  msgid "Still waiting for your email?"
155
  msgstr ""
156
 
157
+ #: includes/class-theme-my-login-ms-signup.php:188
158
  msgid ""
159
  "If you haven&#8217;t received your email yet, there are a number of things "
160
  "you can do:"
161
  msgstr ""
162
 
163
+ #: includes/class-theme-my-login-ms-signup.php:190
164
  msgid ""
165
  "Wait a little longer. Sometimes delivery of email can be delayed by "
166
  "processes outside of our control."
167
  msgstr ""
168
 
169
+ #: includes/class-theme-my-login-ms-signup.php:191
170
  msgid ""
171
  "Check the junk or spam folder of your email client. Sometime emails wind up "
172
  "there by mistake."
173
  msgstr ""
174
 
175
+ #: includes/class-theme-my-login-ms-signup.php:192
176
  msgid ""
177
  "Have you entered your email correctly? You have entered %s, if it&#8217;s "
178
  "incorrect, you will not receive your email."
179
  msgstr ""
180
 
181
+ #: includes/class-theme-my-login-ms-signup.php:198
182
  msgid "Site registration has been disabled."
183
  msgstr ""
184
 
185
+ #: includes/class-theme-my-login-ms-signup.php:222
186
  msgid "The site %s is yours."
187
  msgstr ""
188
 
189
+ #: includes/class-theme-my-login-ms-signup.php:224
190
  msgid ""
191
  "<a href=\"http://%1$s\">http://%2$s</a> is your new site. <a href=\"%3$s"
192
  "\">Log in</a> as &#8220;%4$s&#8221; using your existing password."
193
  msgstr ""
194
 
195
+ #: includes/class-theme-my-login-ms-signup.php:240
196
  msgid "Sorry, new registrations are not allowed at this time."
197
  msgstr ""
198
 
199
+ #: includes/class-theme-my-login-ms-signup.php:242
200
  msgid "You are logged in already. No need to register again!"
201
  msgstr ""
202
 
203
+ #: includes/class-theme-my-login-ms-signup.php:248
204
  msgid ""
205
  "<p><em>The site you were looking for, <strong>%s</strong> does not exist, "
206
  "but you can create it now!</em></p>"
207
  msgstr ""
208
 
209
+ #: includes/class-theme-my-login-ms-signup.php:250
210
  msgid ""
211
  "<p><em>The site you were looking for, <strong>%s</strong>, does not exist.</"
212
  "em></p>"
213
  msgstr ""
214
 
215
+ #: includes/class-theme-my-login-ms-signup.php:392
216
  msgid "Activation Key Required"
217
  msgstr ""
218
 
219
+ #: includes/class-theme-my-login-ms-signup.php:395
220
  msgid "Activation Key:"
221
  msgstr ""
222
 
223
+ #: includes/class-theme-my-login-ms-signup.php:399
224
+ #: includes/class-theme-my-login-ms-signup.php:471
225
  msgid "Activate"
226
  msgstr ""
227
 
228
+ #: includes/class-theme-my-login-ms-signup.php:411
229
+ #: includes/class-theme-my-login-ms-signup.php:431
230
  msgid "Your account is now active!"
231
  msgstr ""
232
 
233
+ #: includes/class-theme-my-login-ms-signup.php:415
234
  msgid ""
235
  "Your account has been activated. You may now <a href=\"%1$s\">login</a> to "
236
  "the site using your chosen username of &#8220;%2$s&#8221;. Please check "
240
  "password</a>."
241
  msgstr ""
242
 
243
+ #: includes/class-theme-my-login-ms-signup.php:417
244
  msgid ""
245
  "Your site at <a href=\"%1$s\">%2$s</a> is active. You may now log in to your "
246
  "site using your chosen username of &#8220;%3$s&#8221;. Please check your "
250
  "password</a>."
251
  msgstr ""
252
 
253
+ #: includes/class-theme-my-login-ms-signup.php:422
254
  msgid "An error occurred during the activation"
255
  msgstr ""
256
 
257
+ #: includes/class-theme-my-login-ms-signup.php:434
258
  #: templates/ms-signup-user-form.php:14
259
  msgid "Username:"
260
  msgstr ""
261
 
262
+ #: includes/class-theme-my-login-ms-signup.php:435
263
  #: modules/custom-passwords/custom-passwords.php:95
264
  msgid "Password:"
265
  msgstr ""
266
 
267
+ #: includes/class-theme-my-login-ms-signup.php:439
268
  msgid ""
269
  "Your account is now activated. <a href=\"%1$s\">View your site</a> or <a "
270
  "href=\"%2$s\">Login</a>"
271
  msgstr ""
272
 
273
+ #: includes/class-theme-my-login-ms-signup.php:441
274
  msgid ""
275
  "Your account is now activated. <a href=\"%1$s\">Login</a> or go back to the "
276
  "<a href=\"%2$s\">homepage</a>."
429
  msgid "Please log in to continue."
430
  msgstr ""
431
 
432
+ #: includes/class-theme-my-login.php:1133
433
  msgid "<strong>ERROR</strong>: Enter a username or e-mail address."
434
  msgstr ""
435
 
436
+ #: includes/class-theme-my-login.php:1137
437
  msgid ""
438
  "<strong>ERROR</strong>: There is no user registered with that email address."
439
  msgstr ""
440
 
441
+ #: includes/class-theme-my-login.php:1149
442
  msgid "<strong>ERROR</strong>: Invalid username or e-mail."
443
  msgstr ""
444
 
445
+ #: includes/class-theme-my-login.php:1163
446
  msgid "Password reset is not allowed for this user"
447
  msgstr ""
448
 
449
+ #: includes/class-theme-my-login.php:1180
450
  msgid "Someone requested that the password be reset for the following account:"
451
  msgstr ""
452
 
453
+ #: includes/class-theme-my-login.php:1182
454
+ #: modules/custom-email/custom-email.php:841
455
+ #: modules/custom-email/custom-email.php:870
456
  #: modules/user-moderation/admin/user-moderation-admin.php:382
457
  #: modules/user-moderation/user-moderation.php:460
458
  msgid "Username: %s"
459
  msgstr ""
460
 
461
+ #: includes/class-theme-my-login.php:1183
462
  msgid "If this was a mistake, just ignore this email and nothing will happen."
463
  msgstr ""
464
 
465
+ #: includes/class-theme-my-login.php:1184
466
  msgid "To reset your password, visit the following address:"
467
  msgstr ""
468
 
469
+ #: includes/class-theme-my-login.php:1195
470
  msgid "[%s] Password Reset"
471
  msgstr ""
472
 
473
+ #: includes/class-theme-my-login.php:1201
474
  #: modules/user-moderation/admin/user-moderation-admin.php:252
475
  #: modules/user-moderation/admin/user-moderation-admin.php:394
476
  #: modules/user-moderation/admin/user-moderation-admin.php:436
477
  msgid "The e-mail could not be sent."
478
  msgstr ""
479
 
480
+ #: includes/class-theme-my-login.php:1201
481
  #: modules/user-moderation/admin/user-moderation-admin.php:252
482
  #: modules/user-moderation/admin/user-moderation-admin.php:394
483
  #: modules/user-moderation/admin/user-moderation-admin.php:436
484
  msgid "Possible reason: your host may have disabled the mail() function..."
485
  msgstr ""
486
 
487
+ #: includes/class-theme-my-login.php:1245
488
  msgid "<strong>ERROR</strong>: Please enter a username."
489
  msgstr ""
490
 
491
+ #: includes/class-theme-my-login.php:1247
492
  msgid ""
493
  "<strong>ERROR</strong>: This username is invalid because it uses illegal "
494
  "characters. Please enter a valid username."
495
  msgstr ""
496
 
497
+ #: includes/class-theme-my-login.php:1250
498
  msgid ""
499
  "<strong>ERROR</strong>: This username is already registered, please choose "
500
  "another one."
501
  msgstr ""
502
 
503
+ #: includes/class-theme-my-login.php:1255
504
  msgid "<strong>ERROR</strong>: Please type your e-mail address."
505
  msgstr ""
506
 
507
+ #: includes/class-theme-my-login.php:1257
508
  msgid "<strong>ERROR</strong>: The email address isn&#8217;t correct."
509
  msgstr ""
510
 
511
+ #: includes/class-theme-my-login.php:1260
512
  msgid ""
513
  "<strong>ERROR</strong>: This email is already registered, please choose "
514
  "another one."
515
  msgstr ""
516
 
517
+ #: includes/class-theme-my-login.php:1273
518
  msgid ""
519
  "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a "
520
  "href=\"mailto:%s\">webmaster</a> !"
738
  msgid "Disable Notification"
739
  msgstr ""
740
 
741
+ #: modules/custom-email/custom-email.php:840
742
  msgid "New user registration on your site %s:"
743
  msgstr ""
744
 
745
+ #: modules/custom-email/custom-email.php:842
746
  #: modules/user-moderation/user-moderation.php:461
747
  msgid "E-mail: %s"
748
  msgstr ""
749
 
750
+ #: modules/custom-email/custom-email.php:844
751
  msgid "[%s] New User Registration"
752
  msgstr ""
753
 
754
+ #: modules/custom-email/custom-email.php:871
755
  #: modules/user-moderation/admin/user-moderation-admin.php:383
756
  msgid "To set your password, visit the following address:"
757
  msgstr ""
758
 
759
+ #: modules/custom-email/custom-email.php:876
760
  msgid "[%s] Your username and password info"
761
  msgstr ""
762
 
763
+ #: modules/custom-email/custom-email.php:904
764
  msgid "[%s] Password Lost/Changed"
765
  msgstr ""
766
 
767
+ #: modules/custom-email/custom-email.php:905
768
  msgid "Password Lost and Changed for user: %s"
769
  msgstr ""
770
 
modules/custom-redirection/custom-redirection.php CHANGED
@@ -79,6 +79,89 @@ class Theme_My_Login_Custom_Redirection extends Theme_My_Login_Abstract {
79
  return $options;
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * Adds "_wp_original_referer" field to login form
84
  *
@@ -89,7 +172,14 @@ class Theme_My_Login_Custom_Redirection extends Theme_My_Login_Abstract {
89
  * @access public
90
  */
91
  public function login_form() {
92
- echo wp_original_referer_field( false, Theme_My_Login::is_tml_page() ? 'previous' : 'current' ) . "\n";
 
 
 
 
 
 
 
93
  }
94
 
95
  /**
@@ -107,46 +197,8 @@ class Theme_My_Login_Custom_Redirection extends Theme_My_Login_Abstract {
107
  * @return string New redirect
108
  */
109
  public function login_redirect( $redirect_to, $request, $user ) {
110
- // Determine the correct referer
111
- if ( ! $http_referer = wp_get_original_referer() )
112
- $http_referer = wp_get_referer();
113
-
114
- // Remove some arguments that may be present and shouldn't be
115
- $http_referer = remove_query_arg( array( 'instance', 'action', 'checkemail', 'error', 'loggedout', 'registered', 'redirect_to', 'updated', 'key', '_wpnonce', 'reauth' ), $http_referer );
116
-
117
- // Make sure $user object exists and is a WP_User instance
118
- if ( ! is_wp_error( $user ) && is_a( $user, 'WP_User' ) ) {
119
- if ( is_multisite() && empty( $user->roles ) ) {
120
- $user->roles = array( 'subscriber' );
121
- }
122
-
123
- $user_role = reset( $user->roles );
124
-
125
- $redirection = $this->get_option( $user_role, array() );
126
-
127
- if ( 'referer' == $redirection['login_type'] ) {
128
- // Send 'em back to the referer
129
- $redirect_to = $http_referer;
130
- } elseif ( 'custom' == $redirection['login_type'] ) {
131
- // Send 'em to the specified URL
132
- $redirect_to = $redirection['login_url'];
133
-
134
- // Allow a few user specific variables
135
- $redirect_to = Theme_My_Login_Common::replace_vars( $redirect_to, $user->ID, array(
136
- '%user_id%' => $user->ID
137
- ) );
138
- }
139
- }
140
-
141
- // If a redirect is requested, it takes precedence
142
- if ( ! empty( $request ) && admin_url() != $request && admin_url( 'profile.php' ) != $request )
143
- $redirect_to = $request;
144
-
145
- // Make sure $redirect_to isn't empty
146
- if ( empty( $redirect_to ) )
147
- $redirect_to = get_option( 'home' );
148
-
149
- return $redirect_to;
150
  }
151
 
152
  /**
@@ -164,41 +216,14 @@ class Theme_My_Login_Custom_Redirection extends Theme_My_Login_Abstract {
164
  * @return string New redirect
165
  */
166
  public function logout_redirect( $redirect_to, $request, $user ) {
167
- // Determine the correct referer
168
- if ( ! $http_referer = wp_get_original_referer() )
169
- $http_referer = wp_get_referer();
170
 
171
- // Remove some arguments that may be present and shouldn't be
172
- $http_referer = remove_query_arg( array( 'instance', 'action', 'checkemail', 'error', 'loggedout', 'registered', 'redirect_to', 'updated', 'key', '_wpnonce' ), $http_referer );
173
-
174
- // Make sure $user object exists and is a WP_User instance
175
- if ( ! is_wp_error( $user ) && is_a( $user, 'WP_User' ) ) {
176
- if ( is_multisite() && empty( $user->roles ) ) {
177
- $user->roles = array( 'subscriber' );
178
- }
179
-
180
- $user_role = reset( $user->roles );
181
-
182
- $redirection = $this->get_option( $user_role, array() );
183
-
184
- if ( 'referer' == $redirection['logout_type'] ) {
185
- // Send 'em back to the referer
186
- $redirect_to = $http_referer;
187
- } elseif ( 'custom' == $redirection['logout_type'] ) {
188
- // Send 'em to the specified URL
189
- $redirect_to = $redirection['logout_url'];
190
-
191
- // Allow a few user specific variables
192
- $redirect_to = Theme_My_Login_Common::replace_vars( $redirect_to, $user->ID, array(
193
- '%user_id%' => $user->ID
194
- ) );
195
- }
196
- }
197
-
198
- // Make sure $redirect_to isn't empty or pointing to an admin URL (causing an endless loop)
199
- if ( empty( $redirect_to ) || false !== strpos( $redirect_to, 'wp-admin' ) )
200
  $redirect_to = add_query_arg( 'loggedout', 'true', wp_login_url() );
201
 
 
202
  return $redirect_to;
203
  }
204
  }
@@ -209,5 +234,3 @@ endif;
209
 
210
  if ( is_admin() )
211
  include_once( dirname( __FILE__ ) . '/admin/custom-redirection-admin.php' );
212
-
213
-
79
  return $options;
80
  }
81
 
82
+ /**
83
+ * Get the redirect URL for a user.
84
+ *
85
+ * @since 6.4.1
86
+ *
87
+ * @param WP_User $user User object
88
+ * @param string $type Optional. Type of redirect. Accepts 'login'
89
+ * or 'logout'. Default is 'login'.
90
+ * @param string $default Optional. Default URL if somehow not found
91
+ * @return string Redirect URL
92
+ */
93
+ public function get_redirect_for_user( $user, $type = 'login', $default = '' ) {
94
+ // Make sure we have a default
95
+ if ( empty( $default ) )
96
+ $default = admin_url( 'profile.php' );
97
+
98
+ // Bail if $user is not a WP_User
99
+ if ( ! $user instanceof WP_User )
100
+ return $default;
101
+
102
+ // Make sure $type is valid
103
+ if ( ! ( 'login' == $type || 'logout' == $type ) )
104
+ $type = 'login';
105
+
106
+ // Make sure the user has a role
107
+ if ( is_multisite() && empty( $user->roles ) ) {
108
+ $user->roles = array( 'subscriber' );
109
+ }
110
+
111
+ // Get the user's role
112
+ $user_role = reset( $user->roles );
113
+
114
+ // Get the redirection settings for the user's role
115
+ $redirection = $this->get_option( $user_role, array() );
116
+
117
+ // Determine which redirection type is being used
118
+ switch ( $redirection["{$type}_type"] ) {
119
+
120
+ case 'referer' :
121
+ // Get the referer
122
+ if ( ! $referer = wp_get_original_referer() )
123
+ $referer = wp_get_referer();
124
+
125
+ // Strip unwanted arguments from the referer
126
+ $referer = Theme_My_Login_Common::strip_query_args( $referer );
127
+
128
+ // Is the URL a single post type?
129
+ if ( $page_id = url_to_postid( $referer ) ) {
130
+ // Bail if the referer is TML page
131
+ if ( Theme_My_Login::is_tml_page( null, $page_id ) )
132
+ return $default;
133
+ }
134
+
135
+ // Send 'em back to the referer
136
+ $redirect_to = $referer;
137
+ break;
138
+
139
+ case 'custom' :
140
+ // Send 'em to the specified URL
141
+ $redirect_to = $redirection["{$type}_url"];
142
+
143
+ // Allow a few user specific variables
144
+ $redirect_to = str_replace(
145
+ array(
146
+ '%user_id%',
147
+ '%user_nicename%'
148
+ ),
149
+ array(
150
+ $user->ID,
151
+ $user->user_nicename
152
+ ),
153
+ $redirect_to
154
+ );
155
+ break;
156
+ }
157
+
158
+ // Make sure $redirect_to isn't empty
159
+ if ( empty( $redirect_to ) )
160
+ $redirect_to = $default;
161
+
162
+ return $redirect_to;
163
+ }
164
+
165
  /**
166
  * Adds "_wp_original_referer" field to login form
167
  *
172
  * @access public
173
  */
174
  public function login_form() {
175
+ if ( ! empty( $_REQUEST['redirect_to'] ) ) {
176
+ $referer = wp_unslash( $_REQUEST['redirect_to'] );
177
+ } elseif ( wp_get_original_referer() ) {
178
+ $referer = wp_get_original_referer();
179
+ } else {
180
+ $referer = Theme_My_Login::is_tml_page() ? wp_get_referer() : wp_unslash( $_SERVER['REQUEST_URI'] );
181
+ }
182
+ echo '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( $referer ) . '" />';
183
  }
184
 
185
  /**
197
  * @return string New redirect
198
  */
199
  public function login_redirect( $redirect_to, $request, $user ) {
200
+ // Return the redirect URL for the user
201
+ return $this->get_redirect_for_user( $user, 'login', $redirect_to );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  }
203
 
204
  /**
216
  * @return string New redirect
217
  */
218
  public function logout_redirect( $redirect_to, $request, $user ) {
219
+ // Get the redirect URL for the user
220
+ $redirect_to = $this->get_redirect_for_user( $user, 'logout', $redirect_to );
 
221
 
222
+ // Make sure we're not trying to redirect to an admin URL
223
+ if ( false !== strpos( $redirect_to, 'wp-admin' ) )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  $redirect_to = add_query_arg( 'loggedout', 'true', wp_login_url() );
225
 
226
+ // Return the redirect URL for the user
227
  return $redirect_to;
228
  }
229
  }
234
 
235
  if ( is_admin() )
236
  include_once( dirname( __FILE__ ) . '/admin/custom-redirection-admin.php' );
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
5
  Requires at least: 4.3.1
6
  Tested up to: 4.3
7
- Stable tag: 6.4
8
 
9
  Themes the WordPress login pages according to your theme.
10
 
@@ -57,6 +57,13 @@ Please visit http://www.jfarthing.com/development/theme-my-login.
57
 
58
  == Changelog ==
59
 
 
 
 
 
 
 
 
60
  = 6.4 =
61
  * Add option to login using either username only, email only or both
62
  * Add option to disable user denial notification when admin approval is active
4
  Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
5
  Requires at least: 4.3.1
6
  Tested up to: 4.3
7
+ Stable tag: 6.4.1
8
 
9
  Themes the WordPress login pages according to your theme.
10
 
57
 
58
  == Changelog ==
59
 
60
+ = 6.4.1 =
61
+ * Allow array of actions in Theme_My_Login::is_tml_page()
62
+ * Lost Password nav menu item will only show when not logged in
63
+ * Hide action links on Reset Password page
64
+ * Fix false password reset error caused by referer redirection
65
+ * Fix PHP strict warning about abstract class constructor compatibility
66
+
67
  = 6.4 =
68
  * Add option to login using either username only, email only or both
69
  * Add option to disable user denial notification when admin approval is active
templates/resetpass-form.php CHANGED
@@ -35,5 +35,9 @@ Theme My Login will always look in your theme's directory first, before using th
35
  <input type="hidden" name="action" value="resetpass" />
36
  </p>
37
  </form>
38
- <?php $template->the_action_links( array( 'lostpassword' => false ) ); ?>
 
 
 
 
39
  </div>
35
  <input type="hidden" name="action" value="resetpass" />
36
  </p>
37
  </form>
38
+ <?php $template->the_action_links( array(
39
+ 'login' => false,
40
+ 'register' => false,
41
+ 'lostpassword' => false
42
+ ) ); ?>
43
  </div>
theme-my-login.php CHANGED
@@ -3,7 +3,7 @@
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.4
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login
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.4.1
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login