Version Description
- Implement 3.1 password reset routine
- Add 3.1 fields to Themed Profiles
- Better default stylesheet for Themed Profiles
- Add 'nofollow' attribute to action links
- Check for SSL
- Add nofollow and noindex to login page
- Fix missing argument notices
- Fix deprecated argument notices
- Fix undefined method notices
- Fix install/uninstall routines
- Fix Custom user Links AJAX
- Fix Custom E-mail "From" filters
- Fix disabling of admin password change notification
- Fix "resent" custom activation e-mail
Download this release
Release Info
Developer | jfarthing84 |
Plugin | Theme My Login |
Version | 6.1.1 |
Comparing to | |
See all releases |
Code changes from version 6.1 to 6.1.1
- admin/class-theme-my-login-admin.php +2 -2
- includes/class-theme-my-login-template.php +40 -27
- includes/class-theme-my-login.php +102 -42
- modules/custom-email/admin/custom-email-admin.php +17 -31
- modules/custom-email/custom-email.php +14 -78
- modules/custom-passwords/custom-passwords.php +6 -217
- modules/custom-redirection/custom-redirection.php +17 -0
- modules/custom-user-links/admin/custom-user-links-admin.php +26 -9
- modules/security/admin/js/security-admin.js +1 -1
- modules/security/admin/security-admin.php +17 -0
- modules/themed-profiles/password-strength.css +0 -39
- modules/themed-profiles/themed-profiles.css +78 -0
- modules/themed-profiles/themed-profiles.php +4 -1
- modules/user-moderation/admin/user-moderation-admin.php +20 -2
- modules/user-moderation/user-moderation.php +9 -7
- readme.txt +17 -1
- templates/profile-form.php +36 -2
- templates/resetpass-form.php +9 -7
- theme-my-login.css +39 -0
- theme-my-login.php +1 -1
admin/class-theme-my-login-admin.php
CHANGED
@@ -680,8 +680,8 @@ class Theme_My_Login_Admin {
|
|
680 |
add_action( 'admin_notices', array( &$this, 'initial_nag' ) );
|
681 |
add_action( 'load-settings_page_theme-my-login', array( &$this, 'load_settings_page' ) );
|
682 |
|
683 |
-
register_activation_hook( TML_ABSPATH . '/theme-my-login.php', 'Theme_My_Login_Admin
|
684 |
-
register_uninstall_hook( TML_ABSPATH . '/theme-my-login.php', 'Theme_My_Login_Admin
|
685 |
}
|
686 |
}
|
687 |
|
680 |
add_action( 'admin_notices', array( &$this, 'initial_nag' ) );
|
681 |
add_action( 'load-settings_page_theme-my-login', array( &$this, 'load_settings_page' ) );
|
682 |
|
683 |
+
register_activation_hook( TML_ABSPATH . '/theme-my-login.php', array( 'Theme_My_Login_Admin', 'install' ) );
|
684 |
+
register_uninstall_hook( TML_ABSPATH . '/theme-my-login.php', array( 'Theme_My_Login_Admin', 'uninstall' ) );
|
685 |
}
|
686 |
}
|
687 |
|
includes/class-theme-my-login-template.php
CHANGED
@@ -81,29 +81,35 @@ class Theme_My_Login_Template {
|
|
81 |
do_action_ref_array( 'tml_display_' . $action, array( &$this ) );
|
82 |
} else {
|
83 |
$template = array();
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
if ( !empty( $this->options['login_template'] ) )
|
104 |
$template[] = $this->options['login_template'];
|
105 |
$template[] = 'login-form.php';
|
106 |
-
|
107 |
}
|
108 |
$this->get_template( $template );
|
109 |
}
|
@@ -288,7 +294,7 @@ class Theme_My_Login_Template {
|
|
288 |
if ( $action_links = $this->get_action_links( $args ) ) {
|
289 |
echo '<ul class="tml-action-links">' . "\n";
|
290 |
foreach ( (array) $action_links as $link ) {
|
291 |
-
echo '<li><a href="' . esc_url( $link['url'] ) . '">' . esc_html( $link['title'] ) . '</a></li>' . "\n";
|
292 |
}
|
293 |
echo '</ul>' . "\n";
|
294 |
}
|
@@ -350,12 +356,19 @@ class Theme_My_Login_Template {
|
|
350 |
* @return string The requested template message
|
351 |
*/
|
352 |
function get_action_template_message( $action = '' ) {
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
return apply_filters( 'tml_action_template_message', $message, $action );
|
360 |
}
|
361 |
|
81 |
do_action_ref_array( 'tml_display_' . $action, array( &$this ) );
|
82 |
} else {
|
83 |
$template = array();
|
84 |
+
if ( is_user_logged_in() ) {
|
85 |
+
if ( !empty( $this->options['user_template'] ) )
|
86 |
+
$template[] = $this->options['user_template'];
|
87 |
+
$template[] = 'user-panel.php';
|
88 |
+
} else {
|
89 |
+
switch ( $action ) {
|
90 |
+
case 'lostpassword':
|
91 |
+
case 'retrievepassword':
|
92 |
+
if ( !empty( $this->options['lostpassword_template'] ) )
|
93 |
+
$template[] = $this->options['lostpassword_template'];
|
94 |
+
$template[] = 'lostpassword-form.php';
|
95 |
+
break;
|
96 |
+
case 'resetpass':
|
97 |
+
case 'rp':
|
98 |
+
if ( !empty( $template->options['resetpass_template'] ) )
|
99 |
+
$template[] = $template->options['resetpass_template'];
|
100 |
+
$template[] = 'resetpass-form.php';
|
101 |
+
break;
|
102 |
+
case 'register':
|
103 |
+
if ( !empty( $this->options['register_template'] ) )
|
104 |
+
$template[] = $this->options['register_template'];
|
105 |
+
$template[] = 'register-form.php';
|
106 |
+
break;
|
107 |
+
case 'login':
|
108 |
+
default :
|
109 |
if ( !empty( $this->options['login_template'] ) )
|
110 |
$template[] = $this->options['login_template'];
|
111 |
$template[] = 'login-form.php';
|
112 |
+
}
|
113 |
}
|
114 |
$this->get_template( $template );
|
115 |
}
|
294 |
if ( $action_links = $this->get_action_links( $args ) ) {
|
295 |
echo '<ul class="tml-action-links">' . "\n";
|
296 |
foreach ( (array) $action_links as $link ) {
|
297 |
+
echo '<li><a href="' . esc_url( $link['url'] ) . '" rel="nofollow">' . esc_html( $link['title'] ) . '</a></li>' . "\n";
|
298 |
}
|
299 |
echo '</ul>' . "\n";
|
300 |
}
|
356 |
* @return string The requested template message
|
357 |
*/
|
358 |
function get_action_template_message( $action = '' ) {
|
359 |
+
switch ( $action ) {
|
360 |
+
case 'register':
|
361 |
+
$message = __( 'Register For This Site', 'theme-my-login' );
|
362 |
+
break;
|
363 |
+
case 'lostpassword':
|
364 |
+
$message = __( 'Please enter your username or email address. You will receive a link to create a new password via email.', 'theme-my-login' );
|
365 |
+
break;
|
366 |
+
case 'resetpass':
|
367 |
+
$message = __( 'Enter your new password below.', 'theme-my-login' );
|
368 |
+
break;
|
369 |
+
default:
|
370 |
+
$message = '';
|
371 |
+
}
|
372 |
return apply_filters( 'tml_action_template_message', $message, $action );
|
373 |
}
|
374 |
|
includes/class-theme-my-login.php
CHANGED
@@ -88,6 +88,8 @@ class Theme_My_Login {
|
|
88 |
add_action( 'widgets_init', array( &$this, 'widgets_init' ) );
|
89 |
add_action( 'parse_request', array( &$this, 'parse_request' ) );
|
90 |
|
|
|
|
|
91 |
add_action( 'wp_head', array( &$this, 'login_head' ) );
|
92 |
add_action( 'wp_print_footer_scripts', array( &$this, 'print_footer_scripts' ) );
|
93 |
|
@@ -211,6 +213,8 @@ class Theme_My_Login {
|
|
211 |
break;
|
212 |
case 'lostpassword' :
|
213 |
case 'retrievepassword' :
|
|
|
|
|
214 |
if ( $http_post ) {
|
215 |
$errors = $this->retrieve_password();
|
216 |
if ( !is_wp_error( $errors ) ) {
|
@@ -227,21 +231,42 @@ class Theme_My_Login {
|
|
227 |
break;
|
228 |
case 'resetpass' :
|
229 |
case 'rp' :
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
$redirect_to = add_query_arg( 'instance', $instance, $redirect_to );
|
236 |
wp_safe_redirect( $redirect_to );
|
237 |
exit();
|
238 |
}
|
239 |
|
240 |
-
$
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
break;
|
246 |
case 'register' :
|
247 |
if ( !get_option( 'users_can_register' ) ) {
|
@@ -249,6 +274,8 @@ class Theme_My_Login {
|
|
249 |
exit();
|
250 |
}
|
251 |
|
|
|
|
|
252 |
$user_login = '';
|
253 |
$user_email = '';
|
254 |
if ( $http_post ) {
|
@@ -264,7 +291,7 @@ class Theme_My_Login {
|
|
264 |
if ( !empty( $instance ) )
|
265 |
$redirect_to = add_query_arg( 'instance', $instance, $redirect_to );
|
266 |
$redirect_to = apply_filters( 'register_redirect', $redirect_to );
|
267 |
-
|
268 |
exit();
|
269 |
}
|
270 |
}
|
@@ -303,6 +330,8 @@ class Theme_My_Login {
|
|
303 |
$secure_cookie = false;
|
304 |
|
305 |
if ( $http_post ) {
|
|
|
|
|
306 |
// Set a cookie now to see if they are supported by the browser.
|
307 |
setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN );
|
308 |
if ( SITECOOKIEPATH != COOKIEPATH )
|
@@ -340,8 +369,8 @@ class Theme_My_Login {
|
|
340 |
$errors->add( 'registerdisabled', __( 'User registration is currently not allowed.', 'theme-my-login' ) );
|
341 |
elseif ( isset( $_GET['checkemail'] ) && 'confirm' == $_GET['checkemail'] )
|
342 |
$errors->add( 'confirm', __( 'Check your e-mail for the confirmation link.', 'theme-my-login' ), 'message' );
|
343 |
-
elseif
|
344 |
-
$errors->add( '
|
345 |
elseif ( isset( $_GET['checkemail'] ) && 'registered' == $_GET['checkemail'] )
|
346 |
$errors->add( 'registered', __( 'Registration complete. Please check your e-mail.', 'theme-my-login' ), 'message' );
|
347 |
elseif ( $interim_login )
|
@@ -357,6 +386,46 @@ class Theme_My_Login {
|
|
357 |
} // endif has_filter()
|
358 |
}
|
359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
/**
|
361 |
* Returns link for login page
|
362 |
*
|
@@ -389,7 +458,7 @@ class Theme_My_Login {
|
|
389 |
* @param int $post_id The current post ID
|
390 |
* @return string The modified post title
|
391 |
*/
|
392 |
-
function the_title( $title, $post_id ) {
|
393 |
if ( is_admin() )
|
394 |
return $title;
|
395 |
|
@@ -846,16 +915,18 @@ if(typeof wpOnload=='function')wpOnload()
|
|
846 |
}
|
847 |
|
848 |
/**
|
849 |
-
*
|
850 |
*
|
851 |
-
* @since 6.
|
852 |
* @access public
|
853 |
* @uses $wpdb WordPress Database object
|
854 |
*
|
855 |
* @param string $key Hash to validate sending user's password
|
856 |
-
* @
|
|
|
|
|
857 |
*/
|
858 |
-
function
|
859 |
global $wpdb;
|
860 |
|
861 |
$key = preg_replace( '/[^a-z0-9]/i', '', $key );
|
@@ -867,39 +938,28 @@ if(typeof wpOnload=='function')wpOnload()
|
|
867 |
return new WP_Error( 'invalid_key', __( 'Invalid key', 'theme-my-login' ) );
|
868 |
|
869 |
$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login ) );
|
|
|
870 |
if ( empty( $user ) )
|
871 |
return new WP_Error( 'invalid_key', __( 'Invalid key', 'theme-my-login' ) );
|
872 |
|
873 |
-
|
874 |
-
|
875 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
876 |
do_action( 'password_reset', $user, $new_pass );
|
877 |
|
878 |
wp_set_password( $new_pass, $user->ID );
|
879 |
-
update_user_option( $user->ID, 'default_password_nag', true, true ); //Set up the Password change nag.
|
880 |
-
$message = sprintf( __( 'Username: %s', 'theme-my-login' ), $user->user_login ) . "\r\n";
|
881 |
-
$message .= sprintf( __( 'Password: %s', 'theme-my-login' ), $new_pass ) . "\r\n";
|
882 |
-
$message .= network_site_url( 'wp-login.php', 'login' ) . "\r\n";
|
883 |
-
|
884 |
-
if ( function_exists( 'is_multisite') && is_multisite() ) {
|
885 |
-
$blogname = $GLOBALS['current_site']->site_name;
|
886 |
-
} else {
|
887 |
-
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
|
888 |
-
// we want to reverse this for the plain text arena of emails.
|
889 |
-
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
890 |
-
}
|
891 |
-
|
892 |
-
$title = sprintf( __( '[%s] Your new password', 'theme-my-login' ), $blogname );
|
893 |
-
|
894 |
-
$title = apply_filters( 'password_reset_title', $title, $user->ID );
|
895 |
-
$message = apply_filters( 'password_reset_message', $message, $new_pass, $user->ID );
|
896 |
-
|
897 |
-
if ( $message && !wp_mail( $user->user_email, $title, $message ) )
|
898 |
-
wp_die( __( 'The e-mail could not be sent.', 'theme-my-login' ) . "<br />\n" . __( 'Possible reason: your host may have disabled the mail() function...', 'theme-my-login' ) );
|
899 |
|
900 |
do_action( 'tml_user_password_changed', $user );
|
901 |
-
|
902 |
-
return true;
|
903 |
}
|
904 |
|
905 |
/**
|
88 |
add_action( 'widgets_init', array( &$this, 'widgets_init' ) );
|
89 |
add_action( 'parse_request', array( &$this, 'parse_request' ) );
|
90 |
|
91 |
+
add_action( 'wp', array( &$this, 'wp' ) );
|
92 |
+
|
93 |
add_action( 'wp_head', array( &$this, 'login_head' ) );
|
94 |
add_action( 'wp_print_footer_scripts', array( &$this, 'print_footer_scripts' ) );
|
95 |
|
213 |
break;
|
214 |
case 'lostpassword' :
|
215 |
case 'retrievepassword' :
|
216 |
+
self::check_ssl();
|
217 |
+
|
218 |
if ( $http_post ) {
|
219 |
$errors = $this->retrieve_password();
|
220 |
if ( !is_wp_error( $errors ) ) {
|
231 |
break;
|
232 |
case 'resetpass' :
|
233 |
case 'rp' :
|
234 |
+
self::check_ssl();
|
235 |
+
|
236 |
+
$user = self::check_password_reset_key( $_REQUEST['key'], $_REQUEST['login'] );
|
237 |
+
|
238 |
+
if ( is_wp_error($user) ) {
|
239 |
+
wp_redirect( Theme_My_Login::get_current_url( 'action=lostpassword&error=invalidkey' ) );
|
240 |
+
exit;
|
241 |
+
}
|
242 |
+
|
243 |
+
$errors = '';
|
244 |
+
|
245 |
+
if ( isset( $_POST['pass1'] ) && $_POST['pass1'] != $_POST['pass2'] ) {
|
246 |
+
$errors = new WP_Error( 'password_reset_mismatch', __( 'Your passwords do not match.', 'theme-my-login' ) );
|
247 |
+
} elseif ( isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) {
|
248 |
+
self::reset_password( $user, $_POST['pass1'] );
|
249 |
|
250 |
+
$redirect_to = Theme_My_Login::get_current_url( 'resetpass=complete' );
|
251 |
+
if ( isset( $_REQUEST['instance'] ) & !empty( $_REQUEST['instance'] ) )
|
252 |
+
$redirect_to = add_query_arg( 'instance', $_REQUEST['instance'], $redirect_to );
|
|
|
253 |
wp_safe_redirect( $redirect_to );
|
254 |
exit();
|
255 |
}
|
256 |
|
257 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
|
258 |
+
|
259 |
+
wp_enqueue_script( 'user-profile', admin_url( "js/user-profile$suffix.js" ), array( 'jquery' ), '', true );
|
260 |
+
wp_enqueue_script( 'password-strength-meter', admin_url( "js/password-strength-meter$suffix.js" ), array( 'jquery' ), '', true );
|
261 |
+
wp_localize_script( 'password-strength-meter', 'pwsL10n', array(
|
262 |
+
'empty' => __( 'Strength indicator', 'theme-my-login' ),
|
263 |
+
'short' => __( 'Very weak', 'theme-my-login' ),
|
264 |
+
'bad' => __( 'Weak', 'theme-my-login' ),
|
265 |
+
/* translators: password strength */
|
266 |
+
'good' => _x( 'Medium', 'password strength', 'theme-my-login' ),
|
267 |
+
'strong' => __( 'Strong', 'theme-my-login' ),
|
268 |
+
'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
|
269 |
+
) );
|
270 |
break;
|
271 |
case 'register' :
|
272 |
if ( !get_option( 'users_can_register' ) ) {
|
274 |
exit();
|
275 |
}
|
276 |
|
277 |
+
self::check_ssl();
|
278 |
+
|
279 |
$user_login = '';
|
280 |
$user_email = '';
|
281 |
if ( $http_post ) {
|
291 |
if ( !empty( $instance ) )
|
292 |
$redirect_to = add_query_arg( 'instance', $instance, $redirect_to );
|
293 |
$redirect_to = apply_filters( 'register_redirect', $redirect_to );
|
294 |
+
wp_safe_redirect( $redirect_to );
|
295 |
exit();
|
296 |
}
|
297 |
}
|
330 |
$secure_cookie = false;
|
331 |
|
332 |
if ( $http_post ) {
|
333 |
+
self::check_ssl();
|
334 |
+
|
335 |
// Set a cookie now to see if they are supported by the browser.
|
336 |
setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN );
|
337 |
if ( SITECOOKIEPATH != COOKIEPATH )
|
369 |
$errors->add( 'registerdisabled', __( 'User registration is currently not allowed.', 'theme-my-login' ) );
|
370 |
elseif ( isset( $_GET['checkemail'] ) && 'confirm' == $_GET['checkemail'] )
|
371 |
$errors->add( 'confirm', __( 'Check your e-mail for the confirmation link.', 'theme-my-login' ), 'message' );
|
372 |
+
elseif ( isset( $_GET['resetpass'] ) && 'complete' == $_GET['resetpass'] )
|
373 |
+
$errors->add( 'password_reset', __( 'Your password has been reset.', 'theme-my-login' ), 'message' );
|
374 |
elseif ( isset( $_GET['checkemail'] ) && 'registered' == $_GET['checkemail'] )
|
375 |
$errors->add( 'registered', __( 'Registration complete. Please check your e-mail.', 'theme-my-login' ), 'message' );
|
376 |
elseif ( $interim_login )
|
386 |
} // endif has_filter()
|
387 |
}
|
388 |
|
389 |
+
/**
|
390 |
+
* Used to add/remove filters from login page
|
391 |
+
*
|
392 |
+
* @since 6.1.1
|
393 |
+
* @access public
|
394 |
+
*/
|
395 |
+
function wp() {
|
396 |
+
if ( $this->is_login_page() ) {
|
397 |
+
remove_action( 'wp_head', 'feed_links', 2 );
|
398 |
+
remove_action( 'wp_head', 'feed_links_extra', 3 );
|
399 |
+
remove_action( 'wp_head', 'rsd_link' );
|
400 |
+
remove_action( 'wp_head', 'wlwmanifest_link' );
|
401 |
+
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
|
402 |
+
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
|
403 |
+
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
|
404 |
+
remove_action( 'wp_head', 'rel_canonical' );
|
405 |
+
|
406 |
+
add_filter( 'pre_option_blog_public', '__return_zero' );
|
407 |
+
add_action( 'login_head', 'noindex' );
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
/*
|
412 |
+
* Redirects to https login if forced to use SSL
|
413 |
+
*
|
414 |
+
* @since 6.1.1
|
415 |
+
* @access public
|
416 |
+
*/
|
417 |
+
function check_ssl() {
|
418 |
+
if ( force_ssl_admin() && !is_ssl() ) {
|
419 |
+
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
|
420 |
+
wp_redirect( preg_replace( '|^http://|', 'https://', $_SERVER['REQUEST_URI'] ) );
|
421 |
+
exit();
|
422 |
+
} else {
|
423 |
+
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
424 |
+
exit();
|
425 |
+
}
|
426 |
+
}
|
427 |
+
}
|
428 |
+
|
429 |
/**
|
430 |
* Returns link for login page
|
431 |
*
|
458 |
* @param int $post_id The current post ID
|
459 |
* @return string The modified post title
|
460 |
*/
|
461 |
+
function the_title( $title, $post_id = 0 ) {
|
462 |
if ( is_admin() )
|
463 |
return $title;
|
464 |
|
915 |
}
|
916 |
|
917 |
/**
|
918 |
+
* Retrieves a user row based on password reset key and login
|
919 |
*
|
920 |
+
* @since 6.1.1
|
921 |
* @access public
|
922 |
* @uses $wpdb WordPress Database object
|
923 |
*
|
924 |
* @param string $key Hash to validate sending user's password
|
925 |
+
* @param string $login The user login
|
926 |
+
*
|
927 |
+
* @return object|WP_Error
|
928 |
*/
|
929 |
+
function check_password_reset_key( $key, $login ) {
|
930 |
global $wpdb;
|
931 |
|
932 |
$key = preg_replace( '/[^a-z0-9]/i', '', $key );
|
938 |
return new WP_Error( 'invalid_key', __( 'Invalid key', 'theme-my-login' ) );
|
939 |
|
940 |
$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login ) );
|
941 |
+
|
942 |
if ( empty( $user ) )
|
943 |
return new WP_Error( 'invalid_key', __( 'Invalid key', 'theme-my-login' ) );
|
944 |
|
945 |
+
return $user;
|
946 |
+
}
|
947 |
|
948 |
+
/**
|
949 |
+
* Handles resetting the user's password.
|
950 |
+
*
|
951 |
+
* @since 6.0
|
952 |
+
* @access public
|
953 |
+
* @uses $wpdb WordPress Database object
|
954 |
+
*
|
955 |
+
* @param string $key Hash to validate sending user's password
|
956 |
+
*/
|
957 |
+
function reset_password( $user, $new_pass ) {
|
958 |
do_action( 'password_reset', $user, $new_pass );
|
959 |
|
960 |
wp_set_password( $new_pass, $user->ID );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
961 |
|
962 |
do_action( 'tml_user_password_changed', $user );
|
|
|
|
|
963 |
}
|
964 |
|
965 |
/**
|
modules/custom-email/admin/custom-email-admin.php
CHANGED
@@ -162,37 +162,6 @@ class Theme_My_Login_Custom_Email_Admin extends Theme_My_Login_Module {
|
|
162 |
*/
|
163 |
function display_reset_pass_settings() {
|
164 |
?><table class="form-table">
|
165 |
-
<tr>
|
166 |
-
<td>
|
167 |
-
<h3><?php _e( 'User Notification', 'theme-my-login' ); ?></h3>
|
168 |
-
|
169 |
-
<p class="description">
|
170 |
-
<?php _e( 'This e-mail will be sent to a user upon successful password recovery.', 'theme-my-login' ); ?>
|
171 |
-
<?php _e( 'Please be sure to include the variable %user_pass% if using default passwords or else the user will not know their password!', 'theme-my-login' ); ?>
|
172 |
-
<?php _e( 'If any field is left empty, the default will be used instead.', 'theme-my-login' ); ?>
|
173 |
-
</p>
|
174 |
-
|
175 |
-
<p><label for="theme_my_login_reset_pass_mail_from_name"><?php _e( 'From Name', 'theme-my-login' ); ?></label><br />
|
176 |
-
<input name="theme_my_login[email][reset_pass][mail_from_name]" type="text" id="theme_my_login_reset_pass_mail_from_name" value="<?php echo $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'mail_from_name' ) ); ?>" class="extended-text" /></p>
|
177 |
-
|
178 |
-
<p><label for="theme_my_login_retrieve_pass_mail_from"><?php _e( 'From E-mail', 'theme-my-login' ); ?></label><br />
|
179 |
-
<input name="theme_my_login[email][reset_pass][mail_from]" type="text" id="theme_my_login_reset_pass_mail_from" value="<?php echo $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'mail_from' ) ); ?>" class="extended-text" /></p>
|
180 |
-
|
181 |
-
<p><label for="theme_my_login_retrieve_pass_mail_content_type"><?php _e( 'E-mail Format', 'theme-my-login' ); ?></label><br />
|
182 |
-
<select name="theme_my_login[email][reset_pass][mail_content_type]" id="theme_my_login_reset_pass_mail_content_type">
|
183 |
-
<option value="plain"<?php if ( 'plain' == $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'mail_content_type' ) ) ) echo ' selected="selected"'; ?>><?php _e( 'Plain Text', 'theme-my-login' ); ?></option>
|
184 |
-
<option value="html"<?php if ( 'html' == $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'mail_content_type' ) ) ) echo ' selected="selected"'; ?>><?php _e( 'HTML', 'theme-my-login' ); ?></option>
|
185 |
-
</select></p>
|
186 |
-
|
187 |
-
<p><label for="theme_my_login_reset_pass_title"><?php _e( 'Subject', 'theme-my-login' ); ?></label><br />
|
188 |
-
<input name="theme_my_login[email][reset_pass][title]" type="text" id="theme_my_login_reset_pass_title" value="<?php echo $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'title' ) ); ?>" class="full-text" /></p>
|
189 |
-
|
190 |
-
<p><label for="theme_my_login_reset_pass_message"><?php _e( 'Message', 'theme-my-login' ); ?></label><br />
|
191 |
-
<textarea name="theme_my_login[email][reset_pass][message]" id="theme_my_login_reset_pass_message" class="large-text" rows="10"><?php echo $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'message' ) ); ?></textarea></p>
|
192 |
-
|
193 |
-
<p class="description"><?php _e( 'Available Variables', 'theme-my-login' ); ?>: %blogname%, %siteurl%, %user_login%, %user_email%, %user_pass%, %user_ip%</p>
|
194 |
-
</td>
|
195 |
-
</tr>
|
196 |
<tr>
|
197 |
<td>
|
198 |
<h3><?php _e( 'Admin Notification', 'theme-my-login' ); ?></h3>
|
@@ -420,6 +389,22 @@ class Theme_My_Login_Custom_Email_Admin extends Theme_My_Login_Module {
|
|
420 |
}
|
421 |
}
|
422 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
/**
|
424 |
* Loads the module
|
425 |
*
|
@@ -427,6 +412,7 @@ class Theme_My_Login_Custom_Email_Admin extends Theme_My_Login_Module {
|
|
427 |
* @access public
|
428 |
*/
|
429 |
function load() {
|
|
|
430 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
431 |
add_filter( 'tml_save_settings', array( &$this, 'save_settings' ) );
|
432 |
}
|
162 |
*/
|
163 |
function display_reset_pass_settings() {
|
164 |
?><table class="form-table">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
<tr>
|
166 |
<td>
|
167 |
<h3><?php _e( 'Admin Notification', 'theme-my-login' ); ?></h3>
|
389 |
}
|
390 |
}
|
391 |
|
392 |
+
/**
|
393 |
+
* Activates this module
|
394 |
+
*
|
395 |
+
* Callback for "tml_activate_custom-email/custom-email.php" hook in method Theme_My_Login_Admin::activate_module()
|
396 |
+
*
|
397 |
+
* @see Theme_My_Login_Admin::activate_module()
|
398 |
+
* @since 6.0
|
399 |
+
* @access public
|
400 |
+
*
|
401 |
+
* @param object $theme_my_login Reference to global $theme_my_login object
|
402 |
+
*/
|
403 |
+
function activate( &$theme_my_login ) {
|
404 |
+
$options = Theme_My_Login_Custom_Email::init_options();
|
405 |
+
$theme_my_login->options->set_option( 'email', $options['email'] );
|
406 |
+
}
|
407 |
+
|
408 |
/**
|
409 |
* Loads the module
|
410 |
*
|
412 |
* @access public
|
413 |
*/
|
414 |
function load() {
|
415 |
+
add_action( 'tml_activate_custom-email/custom-email.php', array( &$this, 'activate' ) );
|
416 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
417 |
add_filter( 'tml_save_settings', array( &$this, 'save_settings' ) );
|
418 |
}
|
modules/custom-email/custom-email.php
CHANGED
@@ -75,32 +75,12 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
75 |
* @access public
|
76 |
*/
|
77 |
function apply_retrieve_pass_filters() {
|
78 |
-
$options =& $GLOBALS['theme_my_login']->options->get_option( 'retrieve_pass' );
|
79 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
80 |
add_filter( 'retrieve_password_title', array( &$this, 'retrieve_pass_title_filter' ), 10, 2 );
|
81 |
add_filter( 'retrieve_password_message', array( &$this, 'retrieve_pass_message_filter' ), 10, 3 );
|
82 |
}
|
83 |
|
84 |
-
/**
|
85 |
-
* Applies all password reset mail filters
|
86 |
-
*
|
87 |
-
* Callback for "password_reset" hook in method Theme_My_Login::reset_password()
|
88 |
-
*
|
89 |
-
* @see Theme_My_Login::reset_password()
|
90 |
-
* @since 6.0
|
91 |
-
* @access public
|
92 |
-
*/
|
93 |
-
function apply_reset_pass_filters() {
|
94 |
-
$options =& $GLOBALS['theme_my_login']->options->get_option( 'reset_pass' );
|
95 |
-
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
96 |
-
add_filter( 'password_reset_title', array( &$this, 'reset_pass_title_filter' ), 10, 2 );
|
97 |
-
add_filter( 'password_reset_message', array( &$this, 'reset_pass_message_filter' ), 10, 3 );
|
98 |
-
add_filter( 'password_change_notification_mail_to', array( &$this, 'password_change_notification_mail_to_filter' ) );
|
99 |
-
add_filter( 'password_change_notification_title', array( &$this, 'password_change_notification_title_filter' ), 10, 2 );
|
100 |
-
add_filter( 'password_change_notification_message', array( &$this, 'password_change_notification_message_filter' ), 10, 2 );
|
101 |
-
add_filter( 'send_password_change_notification', array( &$this, 'send_password_change_notification_filter' ) );
|
102 |
-
}
|
103 |
-
|
104 |
/**
|
105 |
* Applies all new user mail filters
|
106 |
*
|
@@ -210,47 +190,6 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
210 |
return empty( $_message ) ? $message : Theme_My_Login_Custom_Email::replace_vars( $_message, $user_id, $replacements );
|
211 |
}
|
212 |
|
213 |
-
/**
|
214 |
-
* Changes the password reset e-mail subject
|
215 |
-
*
|
216 |
-
* Callback for "password_reset_title" hook in Theme_My_Login::reset_password()
|
217 |
-
*
|
218 |
-
* @see Theme_My_Login::reset_password()
|
219 |
-
* @since 6.0
|
220 |
-
* @access public
|
221 |
-
*
|
222 |
-
* @param string $title Default title
|
223 |
-
* @param int $user_id User ID
|
224 |
-
* @return string New title
|
225 |
-
*/
|
226 |
-
function reset_pass_title_filter( $title, $user_id ) {
|
227 |
-
$_title = $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'title' ) );
|
228 |
-
return empty( $_title ) ? $title : Theme_My_Login_Custom_Email::replace_vars( $_title, $user_id );
|
229 |
-
}
|
230 |
-
|
231 |
-
/**
|
232 |
-
* Changes the password reset e-mail message
|
233 |
-
*
|
234 |
-
* Callback for "password_reset_message" hook in Theme_My_Login::reset_password()
|
235 |
-
*
|
236 |
-
* @see Theme_My_Login::reset_password()
|
237 |
-
* @since 6.0
|
238 |
-
* @access public
|
239 |
-
*
|
240 |
-
* @param string $message Default message
|
241 |
-
* @param string $new_pass The user's new password
|
242 |
-
* @param int $user_id User ID
|
243 |
-
* @return string New message
|
244 |
-
*/
|
245 |
-
function reset_pass_message_filter( $message, $new_pass, $user_id ) {
|
246 |
-
$replacements = array(
|
247 |
-
'%loginurl%' => site_url( 'wp-login.php', 'login' ),
|
248 |
-
'%user_pass%' => $new_pass
|
249 |
-
);
|
250 |
-
$_message = $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass', 'message' ) );
|
251 |
-
return empty( $_message ) ? $message : Theme_My_Login_Custom_Email::replace_vars( $_message, $user_id, $replacements );
|
252 |
-
}
|
253 |
-
|
254 |
/**
|
255 |
* Changes who the password change notification e-mail is sent to
|
256 |
*
|
@@ -317,9 +256,9 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
317 |
* @return bool New setting
|
318 |
*/
|
319 |
function send_password_change_notification_filter( $enable ) {
|
320 |
-
$options
|
321 |
$this->set_mail_headers( $options['admin_mail_from'], $options['admin_mail_from_name'], $options['admin_mail_content_type'] );
|
322 |
-
if ( $
|
323 |
return false;
|
324 |
return $enable;
|
325 |
}
|
@@ -378,7 +317,7 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
378 |
* @return bool New setting
|
379 |
*/
|
380 |
function send_new_user_notification_filter( $enable ) {
|
381 |
-
$options
|
382 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
383 |
return $enable;
|
384 |
}
|
@@ -449,7 +388,7 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
449 |
* @return bool New setting
|
450 |
*/
|
451 |
function send_new_user_admin_notification_filter( $enable ) {
|
452 |
-
$options
|
453 |
$this->set_mail_headers( $options['admin_mail_from'], $options['admin_mail_from_name'], $options['admin_mail_content_type'] );
|
454 |
if ( $options['admin_disable'] )
|
455 |
return false;
|
@@ -467,12 +406,12 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
467 |
return;
|
468 |
|
469 |
if ( 'email' == $GLOBALS['theme_my_login']->options->get_option( array( 'moderation', 'type' ) ) ) {
|
470 |
-
$options
|
471 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
472 |
add_filter( 'user_activation_notification_title', array( &$this, 'user_activation_notification_title_filter' ), 10, 2 );
|
473 |
add_filter( 'user_activation_notification_message', array( &$this, 'user_activation_notification_message_filter' ), 10, 3 );
|
474 |
} elseif ( 'admin' == $GLOBALS['theme_my_login']->options->get_option( array( 'moderation', 'type' ) ) ) {
|
475 |
-
$options
|
476 |
$this->set_mail_headers( $options['admin_mail_from'], $options['admin_mail_from_name'], $options['admin_mail_content_type'] );
|
477 |
add_filter( 'user_approval_admin_notifcation_mail_to', array( &$this, 'user_approval_admin_notifcation_mail_to_filter' ) );
|
478 |
add_filter( 'user_approval_admin_notification_title', array( &$this, 'user_approval_admin_notification_title_filter' ), 10, 2 );
|
@@ -490,7 +429,7 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
490 |
* @access public
|
491 |
*/
|
492 |
function apply_user_approval_notification_filters() {
|
493 |
-
$options
|
494 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
495 |
add_filter( 'user_approval_notification_title', array( &$this, 'user_approval_notification_title_filter' ), 10, 2 );
|
496 |
add_filter( 'user_approval_notification_message', array( &$this, 'user_approval_notification_message_filter' ), 10, 3 );
|
@@ -506,7 +445,7 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
506 |
* @access public
|
507 |
*/
|
508 |
function apply_user_denial_notification_filters() {
|
509 |
-
$options
|
510 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
511 |
add_filter( 'user_denial_notification_title', array( &$this, 'user_denial_notification_title_filter' ), 10, 2 );
|
512 |
add_filter( 'user_denial_notification_message', array( &$this, 'user_denial_notification_message_filter' ), 10, 2 );
|
@@ -782,6 +721,8 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
782 |
// Get all matches ($matches[0] will be '%value%'; $matches[1] will be 'value')
|
783 |
preg_match_all( '/%([^%]*)%/', $input, $matches );
|
784 |
|
|
|
|
|
785 |
// Allow %user_ip% variable
|
786 |
$replacements['%user_ip%'] = $_SERVER['REMOTE_ADDR'];
|
787 |
|
@@ -840,11 +781,6 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
840 |
'message' => ''
|
841 |
),
|
842 |
'reset_pass' => array(
|
843 |
-
'mail_from' => '',
|
844 |
-
'mail_from_name' => '',
|
845 |
-
'mail_content_type' => '',
|
846 |
-
'title' => '',
|
847 |
-
'message' => '',
|
848 |
'admin_mail_to' => '',
|
849 |
'admin_mail_from' => '',
|
850 |
'admin_mail_from_name' => '',
|
@@ -871,16 +807,16 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Module {
|
|
871 |
add_filter( 'wp_mail_content_type', array( &$this, 'mail_content_type_filter') );
|
872 |
|
873 |
add_action( 'retrieve_password', array( &$this, 'apply_retrieve_pass_filters' ) );
|
874 |
-
add_action( 'password_reset', array( &$this, 'apply_reset_pass_filters' ) );
|
875 |
add_action( 'tml_new_user_notification', array( &$this, 'apply_new_user_filters' ) );
|
876 |
|
877 |
remove_action( 'tml_new_user_registered', 'wp_new_user_notification', 10, 2 );
|
878 |
-
add_action( 'tml_new_user_registered', '
|
879 |
|
880 |
remove_action( 'tml_user_password_changed', 'wp_password_change_notification' );
|
881 |
-
add_action( 'tml_user_password_changed', '
|
882 |
|
883 |
add_action( 'register_post', array( &$this, 'apply_user_moderation_notification_filters' ) );
|
|
|
884 |
add_action( 'approve_user', array( &$this, 'apply_user_approval_notification_filters' ) );
|
885 |
add_action( 'deny_user', array( &$this, 'apply_user_denial_notification_filters' ) );
|
886 |
}
|
75 |
* @access public
|
76 |
*/
|
77 |
function apply_retrieve_pass_filters() {
|
78 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'retrieve_pass' ) );
|
79 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
80 |
add_filter( 'retrieve_password_title', array( &$this, 'retrieve_pass_title_filter' ), 10, 2 );
|
81 |
add_filter( 'retrieve_password_message', array( &$this, 'retrieve_pass_message_filter' ), 10, 3 );
|
82 |
}
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
/**
|
85 |
* Applies all new user mail filters
|
86 |
*
|
190 |
return empty( $_message ) ? $message : Theme_My_Login_Custom_Email::replace_vars( $_message, $user_id, $replacements );
|
191 |
}
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
/**
|
194 |
* Changes who the password change notification e-mail is sent to
|
195 |
*
|
256 |
* @return bool New setting
|
257 |
*/
|
258 |
function send_password_change_notification_filter( $enable ) {
|
259 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'reset_pass' ) );
|
260 |
$this->set_mail_headers( $options['admin_mail_from'], $options['admin_mail_from_name'], $options['admin_mail_content_type'] );
|
261 |
+
if ( $options['admin_disable'] )
|
262 |
return false;
|
263 |
return $enable;
|
264 |
}
|
317 |
* @return bool New setting
|
318 |
*/
|
319 |
function send_new_user_notification_filter( $enable ) {
|
320 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'new_user' ) );
|
321 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
322 |
return $enable;
|
323 |
}
|
388 |
* @return bool New setting
|
389 |
*/
|
390 |
function send_new_user_admin_notification_filter( $enable ) {
|
391 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'new_user' ) );
|
392 |
$this->set_mail_headers( $options['admin_mail_from'], $options['admin_mail_from_name'], $options['admin_mail_content_type'] );
|
393 |
if ( $options['admin_disable'] )
|
394 |
return false;
|
406 |
return;
|
407 |
|
408 |
if ( 'email' == $GLOBALS['theme_my_login']->options->get_option( array( 'moderation', 'type' ) ) ) {
|
409 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'user_activation' ) );
|
410 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
411 |
add_filter( 'user_activation_notification_title', array( &$this, 'user_activation_notification_title_filter' ), 10, 2 );
|
412 |
add_filter( 'user_activation_notification_message', array( &$this, 'user_activation_notification_message_filter' ), 10, 3 );
|
413 |
} elseif ( 'admin' == $GLOBALS['theme_my_login']->options->get_option( array( 'moderation', 'type' ) ) ) {
|
414 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'user_approval' ) );
|
415 |
$this->set_mail_headers( $options['admin_mail_from'], $options['admin_mail_from_name'], $options['admin_mail_content_type'] );
|
416 |
add_filter( 'user_approval_admin_notifcation_mail_to', array( &$this, 'user_approval_admin_notifcation_mail_to_filter' ) );
|
417 |
add_filter( 'user_approval_admin_notification_title', array( &$this, 'user_approval_admin_notification_title_filter' ), 10, 2 );
|
429 |
* @access public
|
430 |
*/
|
431 |
function apply_user_approval_notification_filters() {
|
432 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'user_approval' ) );
|
433 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
434 |
add_filter( 'user_approval_notification_title', array( &$this, 'user_approval_notification_title_filter' ), 10, 2 );
|
435 |
add_filter( 'user_approval_notification_message', array( &$this, 'user_approval_notification_message_filter' ), 10, 3 );
|
445 |
* @access public
|
446 |
*/
|
447 |
function apply_user_denial_notification_filters() {
|
448 |
+
$options =& $GLOBALS['theme_my_login']->options->get_option( array( 'email', 'user_denial' ) );
|
449 |
$this->set_mail_headers( $options['mail_from'], $options['mail_from_name'], $options['mail_content_type'] );
|
450 |
add_filter( 'user_denial_notification_title', array( &$this, 'user_denial_notification_title_filter' ), 10, 2 );
|
451 |
add_filter( 'user_denial_notification_message', array( &$this, 'user_denial_notification_message_filter' ), 10, 2 );
|
721 |
// Get all matches ($matches[0] will be '%value%'; $matches[1] will be 'value')
|
722 |
preg_match_all( '/%([^%]*)%/', $input, $matches );
|
723 |
|
724 |
+
//Avoid deprecated 'siteurl' notice
|
725 |
+
$replacements['%siteurl%'] = get_bloginfo( 'url' );
|
726 |
// Allow %user_ip% variable
|
727 |
$replacements['%user_ip%'] = $_SERVER['REMOTE_ADDR'];
|
728 |
|
781 |
'message' => ''
|
782 |
),
|
783 |
'reset_pass' => array(
|
|
|
|
|
|
|
|
|
|
|
784 |
'admin_mail_to' => '',
|
785 |
'admin_mail_from' => '',
|
786 |
'admin_mail_from_name' => '',
|
807 |
add_filter( 'wp_mail_content_type', array( &$this, 'mail_content_type_filter') );
|
808 |
|
809 |
add_action( 'retrieve_password', array( &$this, 'apply_retrieve_pass_filters' ) );
|
|
|
810 |
add_action( 'tml_new_user_notification', array( &$this, 'apply_new_user_filters' ) );
|
811 |
|
812 |
remove_action( 'tml_new_user_registered', 'wp_new_user_notification', 10, 2 );
|
813 |
+
add_action( 'tml_new_user_registered', array( &$this, 'new_user_notification' ), 10, 2 );
|
814 |
|
815 |
remove_action( 'tml_user_password_changed', 'wp_password_change_notification' );
|
816 |
+
add_action( 'tml_user_password_changed', array( &$this, 'password_change_notification' ) );
|
817 |
|
818 |
add_action( 'register_post', array( &$this, 'apply_user_moderation_notification_filters' ) );
|
819 |
+
add_action( 'tml_request_sendactivation', array( &$this, 'apply_user_moderation_notification_filters' ) );
|
820 |
add_action( 'approve_user', array( &$this, 'apply_user_approval_notification_filters' ) );
|
821 |
add_action( 'deny_user', array( &$this, 'apply_user_denial_notification_filters' ) );
|
822 |
}
|
modules/custom-passwords/custom-passwords.php
CHANGED
@@ -176,8 +176,12 @@ class Theme_My_Login_Custom_Passwords extends Theme_My_Login_Module {
|
|
176 |
}
|
177 |
} else {
|
178 |
// Make sure password isn't empty
|
179 |
-
if ( isset( $_POST['user_pass'] ) && !empty( $_POST['user_pass'] ) )
|
180 |
$password = $_POST['user_pass'];
|
|
|
|
|
|
|
|
|
181 |
}
|
182 |
return $password;
|
183 |
}
|
@@ -197,101 +201,6 @@ class Theme_My_Login_Custom_Passwords extends Theme_My_Login_Module {
|
|
197 |
update_user_meta( $user_id, 'default_password_nag', false );
|
198 |
}
|
199 |
|
200 |
-
/**
|
201 |
-
* Resets the user's password
|
202 |
-
*
|
203 |
-
* Callback for "tml_request_resetpass" and "tml_request_rp" hooks in Theme_My_Login::the_request()
|
204 |
-
*
|
205 |
-
* @see Theme_My_Login::the_request()
|
206 |
-
* @since 6.0
|
207 |
-
* @access public
|
208 |
-
*
|
209 |
-
* @param object $theme_my_login
|
210 |
-
*/
|
211 |
-
function resetpass_action( &$theme_my_login ) {
|
212 |
-
// Validate the reset key
|
213 |
-
$user = Theme_My_Login_Custom_Passwords::validate_reset_key( $_REQUEST['key'], $_REQUEST['login'] );
|
214 |
-
// Handle errors
|
215 |
-
if ( is_wp_error( $user ) ) {
|
216 |
-
// Redirect to current page with "action=lostpassword&error=invalidkey" added to the query
|
217 |
-
$redirect_to = Theme_My_Login::get_current_url( 'action=lostpassword&error=invalidkey' );
|
218 |
-
// Add instance to query if specified
|
219 |
-
if ( !empty( $theme_my_login->request_instance ) )
|
220 |
-
$redirect_to = add_query_arg( 'instance', $theme_my_login->request_instance, $redirect_to );
|
221 |
-
// Redirect
|
222 |
-
wp_redirect( $redirect_to );
|
223 |
-
exit();
|
224 |
-
}
|
225 |
-
|
226 |
-
// Check if form has been posted
|
227 |
-
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
|
228 |
-
// Reset the password
|
229 |
-
$theme_my_login->errors = Theme_My_Login_Custom_Passwords::reset_password();
|
230 |
-
// Make sure there aren't any errors
|
231 |
-
if ( !is_wp_error( $theme_my_login->errors ) ) {
|
232 |
-
// Redirect to current page with "resetpass=complete" added to the query
|
233 |
-
$redirect_to = Theme_My_Login::get_current_url( 'resetpass=complete' );
|
234 |
-
// Add instance to query if specified
|
235 |
-
if ( !empty( $theme_my_login->request_instance ) )
|
236 |
-
$redirect_to = add_query_arg( 'instance', $theme_my_login->request_instance, $redirect_to );
|
237 |
-
// Redirect
|
238 |
-
wp_redirect( $redirect_to );
|
239 |
-
exit();
|
240 |
-
}
|
241 |
-
}
|
242 |
-
}
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Outputs reset password form HTML
|
246 |
-
*
|
247 |
-
* This function will first look in the current theme's directory for "resetpass-form.php" and include it if found.
|
248 |
-
* Otherwise, the HTML below will be included instead.
|
249 |
-
*
|
250 |
-
* @see Theme_My_Login_Template::display()
|
251 |
-
* @since 6.0
|
252 |
-
* @access public
|
253 |
-
*
|
254 |
-
* @param object $template Reference to $theme_my_login_template object
|
255 |
-
*/
|
256 |
-
function get_resetpass_form( &$template ) {
|
257 |
-
$templates = array();
|
258 |
-
// Allow template override via shortcode or template tag args
|
259 |
-
if ( !empty( $template->options['resetpass_template'] ) )
|
260 |
-
$templates[] = $template->options['resetpass_template'];
|
261 |
-
// Default template
|
262 |
-
$templates[] = 'resetpass-form.php';
|
263 |
-
// Load the template
|
264 |
-
$template->get_template( $templates );
|
265 |
-
}
|
266 |
-
|
267 |
-
/**
|
268 |
-
* Changes template message according to a specific action
|
269 |
-
*
|
270 |
-
* Callback for "tml_action_template_message" hook in Theme_My_Login_Template::get_action_template_message()
|
271 |
-
*
|
272 |
-
* @see Theme_My_Login_Template::get_action_template_message()
|
273 |
-
* @since 6.0
|
274 |
-
* @access public
|
275 |
-
*
|
276 |
-
* @param string $message The original message
|
277 |
-
* @param string $action The requested action
|
278 |
-
* @return string The new messgage
|
279 |
-
*/
|
280 |
-
function action_template_message( $message, $action ) {
|
281 |
-
switch ( $action ) {
|
282 |
-
case 'lostpassword' :
|
283 |
-
$message = __( 'Please enter your username or e-mail address. You will receive an e-mail with a link to reset your password.', 'theme-my-login' );
|
284 |
-
break;
|
285 |
-
case 'resetpass' :
|
286 |
-
$message = __( 'Please enter a new password.', 'theme-my-login' );
|
287 |
-
break;
|
288 |
-
case 'register' :
|
289 |
-
$message = '';
|
290 |
-
break;
|
291 |
-
}
|
292 |
-
return $message;
|
293 |
-
}
|
294 |
-
|
295 |
/**
|
296 |
* Changes the register template message
|
297 |
*
|
@@ -317,9 +226,6 @@ class Theme_My_Login_Custom_Passwords extends Theme_My_Login_Module {
|
|
317 |
// Change "Registration complete. Please check your e-mail." to reflect the fact that they already set a password
|
318 |
if ( isset( $_GET['registration'] ) && 'complete' == $_GET['registration'] )
|
319 |
$theme_my_login->errors->add( 'registration_complete', __( 'Registration complete. You may now log in.', 'theme-my-login' ), 'message' );
|
320 |
-
// Display the following message instead of "Check your e-mail for your new password."
|
321 |
-
elseif ( isset( $_GET['resetpass'] ) && 'complete' == $_GET['resetpass'] )
|
322 |
-
$theme_my_login->errors->add( 'password_saved', __( 'Your password has been saved. You may now log in.', 'theme-my-login' ), 'message' );
|
323 |
}
|
324 |
|
325 |
/**
|
@@ -343,117 +249,6 @@ class Theme_My_Login_Custom_Passwords extends Theme_My_Login_Module {
|
|
343 |
return $redirect_to;
|
344 |
}
|
345 |
|
346 |
-
/**
|
347 |
-
* Changes where the user is redirected upon successful password reset
|
348 |
-
*
|
349 |
-
* Callback for "resetpass_redirect" hook in Theme_My_Login::the_request()
|
350 |
-
*
|
351 |
-
* @see Theme_My_Login::the_request()
|
352 |
-
* @since 6.0
|
353 |
-
* @access public
|
354 |
-
*
|
355 |
-
* @param string $redirect_to Default redirect
|
356 |
-
* @return string URL to redirect to
|
357 |
-
*/
|
358 |
-
function resetpass_redirect( $redirect_to ) {
|
359 |
-
// Redirect to the login page with "resetpass=complete" added to the query
|
360 |
-
$redirect_to = site_url( 'wp-login.php?resetpass=complete' );
|
361 |
-
// Add instance to the query if specified
|
362 |
-
if ( isset( $_REQUEST['instance'] ) & !empty( $_REQUEST['instance'] ) )
|
363 |
-
$redirect_to = add_query_arg( 'instance', $_REQUEST['instance'], $redirect_to );
|
364 |
-
return $redirect_to;
|
365 |
-
}
|
366 |
-
|
367 |
-
/**
|
368 |
-
* Validates the reset key
|
369 |
-
*
|
370 |
-
* @since 6.0
|
371 |
-
* @access public
|
372 |
-
*
|
373 |
-
* @param string $key The validation key
|
374 |
-
* @param string $login The user login
|
375 |
-
* @return object|WP_Error Row from $wpdb->users table on success, WP_Error on failure
|
376 |
-
*/
|
377 |
-
function validate_reset_key( $key, $login ) {
|
378 |
-
global $wpdb;
|
379 |
-
|
380 |
-
// Strip non-alphanumeric characters
|
381 |
-
$key = preg_replace( '/[^a-z0-9]/i', '', $key );
|
382 |
-
|
383 |
-
// Make sure $key isn't empty
|
384 |
-
if ( empty( $key ) || !is_string( $key ) )
|
385 |
-
return new WP_Error( 'invalid_key', __( 'Invalid key', 'theme-my-login' ) );
|
386 |
-
|
387 |
-
// Make sure $login isn't empty
|
388 |
-
if ( empty( $login ) || !is_string( $login ) )
|
389 |
-
return new WP_Error( 'invalid_key', __( 'Invalid key', 'theme-my-login' ) );
|
390 |
-
|
391 |
-
// Make sure the $key and $login pair match
|
392 |
-
$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login ) );
|
393 |
-
if ( empty( $user ) )
|
394 |
-
return new WP_Error( 'invalid_key', __( 'Invalid key', 'theme-my-login' ) );
|
395 |
-
|
396 |
-
return $user;
|
397 |
-
}
|
398 |
-
|
399 |
-
/**
|
400 |
-
* Resets the user password
|
401 |
-
*
|
402 |
-
* @since 6.0
|
403 |
-
* @access public
|
404 |
-
*
|
405 |
-
* return bool|WP_Error True on success, WP_Error on failure
|
406 |
-
*/
|
407 |
-
function reset_password() {
|
408 |
-
// Validate the reset key
|
409 |
-
$user = Theme_My_Login_Custom_Passwords::validate_reset_key( $_REQUEST['key'], $_REQUEST['login'] );
|
410 |
-
if ( is_wp_error( $user ) )
|
411 |
-
return $user;
|
412 |
-
|
413 |
-
// Validate the password
|
414 |
-
$errors = Theme_My_Login_Custom_Passwords::password_errors();
|
415 |
-
if ( $errors->get_error_code() )
|
416 |
-
return $errors;
|
417 |
-
|
418 |
-
// Assign the password to a local variable
|
419 |
-
$new_pass = $_POST['user_pass'];
|
420 |
-
|
421 |
-
// Call "password_reset" hook
|
422 |
-
do_action( 'password_reset', $user->user_login, $new_pass );
|
423 |
-
|
424 |
-
// Set the password
|
425 |
-
wp_set_password( $new_pass, $user->ID );
|
426 |
-
|
427 |
-
// Remove the password nag
|
428 |
-
update_user_meta( $user->ID, 'default_password_nag', false );
|
429 |
-
|
430 |
-
// Notification e-mail message
|
431 |
-
$message = sprintf( __( 'Username: %s', 'theme-my-login' ), $user->user_login ) . "\r\n";
|
432 |
-
$message .= sprintf( __( 'Password: %s', 'theme-my-login' ), $new_pass ) . "\r\n";
|
433 |
-
$message .= site_url( 'wp-login.php', 'login' ) . "\r\n";
|
434 |
-
|
435 |
-
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
|
436 |
-
// we want to reverse this for the plain text arena of emails.
|
437 |
-
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
438 |
-
|
439 |
-
// Notification e-mail subject
|
440 |
-
$title = sprintf( __( '[%s] Your new password', 'theme-my-login' ), $blogname );
|
441 |
-
|
442 |
-
// Apply filters to notification e-mail subject
|
443 |
-
$title = apply_filters( 'password_reset_title', $title, $user->ID );
|
444 |
-
// Apply filters to notification e-mail message
|
445 |
-
$message = apply_filters( 'password_reset_message', $message, $new_pass, $user->ID );
|
446 |
-
|
447 |
-
// Make sure the message sends
|
448 |
-
if ( $message && !wp_mail( $user->user_email, $title, $message ) )
|
449 |
-
die( '<p>' . __( 'The e-mail could not be sent.', 'theme-my-login' ) . "<br />\n" . __( 'Possible reason: your host may have disabled the mail() function...', 'theme-my-login' ) . '</p>' );
|
450 |
-
|
451 |
-
// Notify the admin of the change
|
452 |
-
wp_password_change_notification( $user );
|
453 |
-
|
454 |
-
return true;
|
455 |
-
}
|
456 |
-
|
457 |
/**
|
458 |
* Loads the module
|
459 |
*
|
@@ -470,18 +265,12 @@ class Theme_My_Login_Custom_Passwords extends Theme_My_Login_Module {
|
|
470 |
add_filter( 'add_signup_meta', array( &$this, 'ms_save_password' ) );
|
471 |
add_filter( 'random_password', array( &$this, 'set_password' ) );
|
472 |
add_action( 'tml_new_user_registered', array( &$this, 'remove_default_password_nag' ) );
|
473 |
-
|
474 |
-
add_action( 'tml_display_resetpass', array( &$this, 'get_resetpass_form' ) );
|
475 |
-
add_action( 'tml_display_rp', array( &$this, 'get_resetpass_form' ) );
|
476 |
-
add_action( 'tml_request_resetpass', array( &$this, 'resetpass_action' ) );
|
477 |
-
add_action( 'tml_request_rp', array( &$this, 'resetpass_action' ) );
|
478 |
// Template messages
|
479 |
add_filter( 'tml_register_passmail_template_message', array( &$this, 'register_passmail_template_message' ) );
|
480 |
-
add_filter( 'tml_action_template_message', array( &$this, 'action_template_message' ), 10, 2 );
|
481 |
add_action( 'tml_request', array( &$this, 'action_messages' ) );
|
482 |
// Redirection
|
483 |
add_filter( 'register_redirect', array( &$this, 'register_redirect' ) );
|
484 |
-
add_filter( 'resetpass_redirect', array( &$this, 'resetpass_redirect' ) );
|
485 |
}
|
486 |
}
|
487 |
|
176 |
}
|
177 |
} else {
|
178 |
// Make sure password isn't empty
|
179 |
+
if ( isset( $_POST['user_pass'] ) && !empty( $_POST['user_pass'] ) ) {
|
180 |
$password = $_POST['user_pass'];
|
181 |
+
|
182 |
+
// Remove filter as not to filter User Moderation activation key
|
183 |
+
remove_filter( 'random_password', array( &$this, 'set_password' ) );
|
184 |
+
}
|
185 |
}
|
186 |
return $password;
|
187 |
}
|
201 |
update_user_meta( $user_id, 'default_password_nag', false );
|
202 |
}
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
/**
|
205 |
* Changes the register template message
|
206 |
*
|
226 |
// Change "Registration complete. Please check your e-mail." to reflect the fact that they already set a password
|
227 |
if ( isset( $_GET['registration'] ) && 'complete' == $_GET['registration'] )
|
228 |
$theme_my_login->errors->add( 'registration_complete', __( 'Registration complete. You may now log in.', 'theme-my-login' ), 'message' );
|
|
|
|
|
|
|
229 |
}
|
230 |
|
231 |
/**
|
249 |
return $redirect_to;
|
250 |
}
|
251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
/**
|
253 |
* Loads the module
|
254 |
*
|
265 |
add_filter( 'add_signup_meta', array( &$this, 'ms_save_password' ) );
|
266 |
add_filter( 'random_password', array( &$this, 'set_password' ) );
|
267 |
add_action( 'tml_new_user_registered', array( &$this, 'remove_default_password_nag' ) );
|
268 |
+
add_action( 'approve_user', array( &$this, 'remove_default_password_nag' ) );
|
|
|
|
|
|
|
|
|
269 |
// Template messages
|
270 |
add_filter( 'tml_register_passmail_template_message', array( &$this, 'register_passmail_template_message' ) );
|
|
|
271 |
add_action( 'tml_request', array( &$this, 'action_messages' ) );
|
272 |
// Redirection
|
273 |
add_filter( 'register_redirect', array( &$this, 'register_redirect' ) );
|
|
|
274 |
}
|
275 |
}
|
276 |
|
modules/custom-redirection/custom-redirection.php
CHANGED
@@ -232,6 +232,22 @@ class Theme_My_Login_Custom_Redirection extends Theme_My_Login_Module {
|
|
232 |
return $options;
|
233 |
}
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
/**
|
236 |
* Loads the module
|
237 |
*
|
@@ -239,6 +255,7 @@ class Theme_My_Login_Custom_Redirection extends Theme_My_Login_Module {
|
|
239 |
* @access public
|
240 |
*/
|
241 |
function load() {
|
|
|
242 |
add_filter( 'tml_init_options', array( &$this, 'init_options' ) );
|
243 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
244 |
add_action( 'tml_login_form', array( &$this, 'login_form' ) );
|
232 |
return $options;
|
233 |
}
|
234 |
|
235 |
+
/**
|
236 |
+
* Activates this module
|
237 |
+
*
|
238 |
+
* Callback for "tml_activate_custom-redirection/custom-redirection.php" hook in method Theme_My_Login_Admin::activate_module()
|
239 |
+
*
|
240 |
+
* @see Theme_My_Login_Admin::activate_module()
|
241 |
+
* @since 6.0
|
242 |
+
* @access public
|
243 |
+
*
|
244 |
+
* @param object $theme_my_login Reference to global $theme_my_login object
|
245 |
+
*/
|
246 |
+
function activate( &$theme_my_login ) {
|
247 |
+
$options = self::init_options();
|
248 |
+
$theme_my_login->options->set_option( 'redirection', $options['redirection'] );
|
249 |
+
}
|
250 |
+
|
251 |
/**
|
252 |
* Loads the module
|
253 |
*
|
255 |
* @access public
|
256 |
*/
|
257 |
function load() {
|
258 |
+
add_action( 'tml_activate_custom-redirection/custom-redirection.php', array( &$this, 'activate' ) );
|
259 |
add_filter( 'tml_init_options', array( &$this, 'init_options' ) );
|
260 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
261 |
add_action( 'tml_login_form', array( &$this, 'login_form' ) );
|
modules/custom-user-links/admin/custom-user-links-admin.php
CHANGED
@@ -42,6 +42,7 @@ class Theme_My_Login_Custom_User_Links_Admin extends Theme_My_Login_Module {
|
|
42 |
// Add new link
|
43 |
$links[$role][] = array( 'title' => $clean_title, 'url' => $clean_url );
|
44 |
// Save links
|
|
|
45 |
$GLOBALS['theme_my_login']->options->save();
|
46 |
|
47 |
$link_row = array_merge( array( 'id' => max( array_keys( $links[$role] ) ) ), end( $links[$role] ) );
|
@@ -69,16 +70,14 @@ class Theme_My_Login_Custom_User_Links_Admin extends Theme_My_Login_Module {
|
|
69 |
if ( !isset( $links[$role][$id] ) )
|
70 |
die( '0' );
|
71 |
|
72 |
-
// Create a reference to the link being edited
|
73 |
-
$current_link =& $links[$role][$id];
|
74 |
-
|
75 |
// Update the link if it has changed
|
76 |
-
if ( $
|
77 |
-
$
|
|
|
78 |
$GLOBALS['theme_my_login']->options->save();
|
79 |
}
|
80 |
|
81 |
-
$link_row = array_merge( array( 'id' => $id ), $
|
82 |
|
83 |
$x = new WP_Ajax_Response( array(
|
84 |
'what' => $role . '-link',
|
@@ -110,11 +109,12 @@ class Theme_My_Login_Custom_User_Links_Admin extends Theme_My_Login_Module {
|
|
110 |
|
111 |
check_ajax_referer( "delete-user-link_$id" );
|
112 |
|
113 |
-
$links =& $GLOBALS['theme_my_login']->options->get_option(
|
114 |
-
if ( isset( $links[$id] ) ) {
|
115 |
// Delete link
|
116 |
-
unset( $links[$id] );
|
117 |
// Save links
|
|
|
118 |
$GLOBALS['theme_my_login']->options->save();
|
119 |
die( '1' );
|
120 |
}
|
@@ -305,6 +305,22 @@ class Theme_My_Login_Custom_User_Links_Admin extends Theme_My_Login_Module {
|
|
305 |
return $r;
|
306 |
}
|
307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
/**
|
309 |
* Loads the module
|
310 |
*
|
@@ -312,6 +328,7 @@ class Theme_My_Login_Custom_User_Links_Admin extends Theme_My_Login_Module {
|
|
312 |
* @access public
|
313 |
*/
|
314 |
function load() {
|
|
|
315 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
316 |
add_filter( 'tml_save_settings', array( &$this, 'save_settings' ) );
|
317 |
|
42 |
// Add new link
|
43 |
$links[$role][] = array( 'title' => $clean_title, 'url' => $clean_url );
|
44 |
// Save links
|
45 |
+
$GLOBALS['theme_my_login']->options->set_option( 'user_links', $links );
|
46 |
$GLOBALS['theme_my_login']->options->save();
|
47 |
|
48 |
$link_row = array_merge( array( 'id' => max( array_keys( $links[$role] ) ) ), end( $links[$role] ) );
|
70 |
if ( !isset( $links[$role][$id] ) )
|
71 |
die( '0' );
|
72 |
|
|
|
|
|
|
|
73 |
// Update the link if it has changed
|
74 |
+
if ( $links[$role][$id]['title'] != $clean_title || $links[$role][$id]['url'] != $clean_url ) {
|
75 |
+
$links[$role][$id] = array( 'title' => $clean_title, 'url' => $clean_url );
|
76 |
+
$GLOBALS['theme_my_login']->options->set_option( 'user_links', $links );
|
77 |
$GLOBALS['theme_my_login']->options->save();
|
78 |
}
|
79 |
|
80 |
+
$link_row = array_merge( array( 'id' => $id ), $links[$role][$id] );
|
81 |
|
82 |
$x = new WP_Ajax_Response( array(
|
83 |
'what' => $role . '-link',
|
109 |
|
110 |
check_ajax_referer( "delete-user-link_$id" );
|
111 |
|
112 |
+
$links =& $GLOBALS['theme_my_login']->options->get_option( 'user_links' );
|
113 |
+
if ( isset( $links[$user_role][$id] ) ) {
|
114 |
// Delete link
|
115 |
+
unset( $links[$user_role][$id] );
|
116 |
// Save links
|
117 |
+
$GLOBALS['theme_my_login']->options->set_option( 'user_links', $links );
|
118 |
$GLOBALS['theme_my_login']->options->save();
|
119 |
die( '1' );
|
120 |
}
|
305 |
return $r;
|
306 |
}
|
307 |
|
308 |
+
/**
|
309 |
+
* Activates this module
|
310 |
+
*
|
311 |
+
* Callback for "tml_activate_custom-user-links/custom-user-links.php" hook in method Theme_My_Login_Admin::activate_module()
|
312 |
+
*
|
313 |
+
* @see Theme_My_Login_Admin::activate_module()
|
314 |
+
* @since 6.0
|
315 |
+
* @access public
|
316 |
+
*
|
317 |
+
* @param object $theme_my_login Reference to global $theme_my_login object
|
318 |
+
*/
|
319 |
+
function activate( &$theme_my_login ) {
|
320 |
+
$options = Theme_My_Login_Custom_User_Links::init_options();
|
321 |
+
$theme_my_login->options->set_option( 'user_links', $options['user_links'] );
|
322 |
+
}
|
323 |
+
|
324 |
/**
|
325 |
* Loads the module
|
326 |
*
|
328 |
* @access public
|
329 |
*/
|
330 |
function load() {
|
331 |
+
add_action( 'tml_activate_custom-user-links/custom-user-links.php', array( &$this, 'activate' ) );
|
332 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
333 |
add_filter( 'tml_save_settings', array( &$this, 'save_settings' ) );
|
334 |
|
modules/security/admin/js/security-admin.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
jQuery(document).ready( function($) {
|
2 |
-
$('
|
3 |
} );
|
1 |
jQuery(document).ready( function($) {
|
2 |
+
$('table .row-actions .unlock-user').parents('tr').children().css('background-color', '#ffebe8');
|
3 |
} );
|
modules/security/admin/security-admin.php
CHANGED
@@ -182,6 +182,22 @@ class Theme_My_Login_Security_Admin extends Theme_My_Login_Module {
|
|
182 |
return $settings;
|
183 |
}
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
/**
|
186 |
* Loads the module
|
187 |
*
|
@@ -189,6 +205,7 @@ class Theme_My_Login_Security_Admin extends Theme_My_Login_Module {
|
|
189 |
* @access public
|
190 |
*/
|
191 |
function load() {
|
|
|
192 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
193 |
add_filter( 'tml_save_settings', array( &$this, 'save_settings' ) );
|
194 |
add_action( 'load-users.php', array( &$this, 'load_users_page' ) );
|
182 |
return $settings;
|
183 |
}
|
184 |
|
185 |
+
/**
|
186 |
+
* Activates this module
|
187 |
+
*
|
188 |
+
* Callback for "tml_activate_security/security.php" hook in method Theme_My_Login_Admin::activate_module()
|
189 |
+
*
|
190 |
+
* @see Theme_My_Login_Admin::activate_module()
|
191 |
+
* @since 6.0
|
192 |
+
* @access public
|
193 |
+
*
|
194 |
+
* @param object $theme_my_login Reference to global $theme_my_login object
|
195 |
+
*/
|
196 |
+
function activate( &$theme_my_login ) {
|
197 |
+
$options = Theme_My_Login_Security::init_options();
|
198 |
+
$theme_my_login->options->set_option( 'security', $options['security'] );
|
199 |
+
}
|
200 |
+
|
201 |
/**
|
202 |
* Loads the module
|
203 |
*
|
205 |
* @access public
|
206 |
*/
|
207 |
function load() {
|
208 |
+
add_action( 'tml_activate_security/security.php', array( &$this, 'activate' ) );
|
209 |
add_action( 'tml_admin_menu', array( &$this, 'admin_menu' ) );
|
210 |
add_filter( 'tml_save_settings', array( &$this, 'save_settings' ) );
|
211 |
add_action( 'load-users.php', array( &$this, 'load_users_page' ) );
|
modules/themed-profiles/password-strength.css
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
#pass-strength-result {
|
2 |
-
border-style: solid;
|
3 |
-
border-width: 1px;
|
4 |
-
float: left;
|
5 |
-
margin: 12px 5px 5px 1px;
|
6 |
-
padding: 3px 5px;
|
7 |
-
text-align: center;
|
8 |
-
width: 200px;
|
9 |
-
}
|
10 |
-
|
11 |
-
#pass-strength-result.strong,
|
12 |
-
#pass-strength-result.short {
|
13 |
-
font-weight: bold;
|
14 |
-
}
|
15 |
-
|
16 |
-
#pass-strength-result {
|
17 |
-
background-color: #eee;
|
18 |
-
border-color: #ddd !important;
|
19 |
-
}
|
20 |
-
|
21 |
-
#pass-strength-result.bad {
|
22 |
-
background-color: #ffb78c;
|
23 |
-
border-color: #ff853c !important;
|
24 |
-
}
|
25 |
-
|
26 |
-
#pass-strength-result.good {
|
27 |
-
background-color: #ffec8b;
|
28 |
-
border-color: #fc0 !important;
|
29 |
-
}
|
30 |
-
|
31 |
-
#pass-strength-result.short {
|
32 |
-
background-color: #ffa0a0;
|
33 |
-
border-color: #f04040 !important;
|
34 |
-
}
|
35 |
-
|
36 |
-
#pass-strength-result.strong {
|
37 |
-
background-color: #c3ff88;
|
38 |
-
border-color: #8dff1c !important;
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modules/themed-profiles/themed-profiles.css
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#your-profile label,
|
2 |
+
#your-profile label + a {
|
3 |
+
vertical-align: middle;
|
4 |
+
}
|
5 |
+
|
6 |
+
#your-profile fieldset {
|
7 |
+
border: 0 none;
|
8 |
+
margin: 0;
|
9 |
+
padding: 0;
|
10 |
+
}
|
11 |
+
|
12 |
+
#your-profile label {
|
13 |
+
cursor: pointer;
|
14 |
+
margin: 0;
|
15 |
+
padding: 0;
|
16 |
+
}
|
17 |
+
|
18 |
+
#your-profile .form-table {
|
19 |
+
border-collapse: collapse;
|
20 |
+
}
|
21 |
+
|
22 |
+
#your-profile .form-table th {
|
23 |
+
padding: 10px;
|
24 |
+
text-align: left;
|
25 |
+
vertical-align: top;
|
26 |
+
width: 150px;
|
27 |
+
}
|
28 |
+
|
29 |
+
#your-profile .form-table td {
|
30 |
+
font-size: 11px;
|
31 |
+
line-height: 20px;
|
32 |
+
margin-bottom: 9px;
|
33 |
+
padding: 8px 10px;
|
34 |
+
}
|
35 |
+
|
36 |
+
#your-profile .form-table div.color-option {
|
37 |
+
display: block;
|
38 |
+
clear: both;
|
39 |
+
margin-top: 12px;
|
40 |
+
}
|
41 |
+
|
42 |
+
#your-profile .form-table input {
|
43 |
+
margin: 1px;
|
44 |
+
padding: 3px;
|
45 |
+
line-height: 15px;
|
46 |
+
}
|
47 |
+
|
48 |
+
#your-profile .form-table input.tog {
|
49 |
+
margin-top: 2px;
|
50 |
+
margin-right: 2px;
|
51 |
+
float: left;
|
52 |
+
}
|
53 |
+
|
54 |
+
#your-profile .form-table .color-palette {
|
55 |
+
vertical-align: bottom;
|
56 |
+
float: left;
|
57 |
+
margin: -12px 3px 11px;
|
58 |
+
width: auto;
|
59 |
+
border: none;
|
60 |
+
}
|
61 |
+
|
62 |
+
#your-profile .form-table .color-palette td {
|
63 |
+
border-width: 1px 1px 0;
|
64 |
+
border-style: solid solid none;
|
65 |
+
border-color: #fff;
|
66 |
+
height: 10px;
|
67 |
+
line-height: 20px;
|
68 |
+
width: 10px;
|
69 |
+
}
|
70 |
+
|
71 |
+
#your-profile .form-table input[type="checkbox"],
|
72 |
+
#your-profile .form-table input[type="radio"] {
|
73 |
+
vertical-align: middle;
|
74 |
+
}
|
75 |
+
|
76 |
+
#pass-strength-result {
|
77 |
+
float: left;
|
78 |
+
}
|
modules/themed-profiles/themed-profiles.php
CHANGED
@@ -74,12 +74,15 @@ class Theme_My_Login_Themed_Profiles extends Theme_My_Login_Module {
|
|
74 |
function profile_action() {
|
75 |
|
76 |
require_once( ABSPATH . 'wp-admin/includes/user.php' );
|
|
|
77 |
if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
|
78 |
require_once( ABSPATH . WPINC . '/registration.php' );
|
79 |
|
80 |
define( 'IS_PROFILE_PAGE', true );
|
81 |
|
82 |
-
|
|
|
|
|
83 |
|
84 |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
|
85 |
|
74 |
function profile_action() {
|
75 |
|
76 |
require_once( ABSPATH . 'wp-admin/includes/user.php' );
|
77 |
+
require_once( ABSPATH . 'wp-admin/includes/misc.php' );
|
78 |
if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
|
79 |
require_once( ABSPATH . WPINC . '/registration.php' );
|
80 |
|
81 |
define( 'IS_PROFILE_PAGE', true );
|
82 |
|
83 |
+
register_admin_color_schemes();
|
84 |
+
|
85 |
+
wp_enqueue_style( 'password-strength', plugins_url( 'theme-my-login/modules/themed-profiles/themed-profiles.css' ) );
|
86 |
|
87 |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
|
88 |
|
modules/user-moderation/admin/user-moderation-admin.php
CHANGED
@@ -49,8 +49,6 @@ class Theme_My_Login_User_Moderation_Admin extends Theme_My_Login_Module {
|
|
49 |
elseif ( 'resendactivation' == $_GET['action'] ) {
|
50 |
check_admin_referer( 'resend-activation' );
|
51 |
|
52 |
-
// Apply activation e-mail filters
|
53 |
-
$GLOBALS['theme_my_login_user_moderation']->apply_user_activation_notification_filters();
|
54 |
if ( !Theme_My_Login_User_Moderation::new_user_activation_notification( $user ) )
|
55 |
wp_die( __( 'The e-mail could not be sent.', 'theme-my-login' ) . "<br />\n" . __( 'Possible reason: your host may have disabled the mail() function...', 'theme-my-login' ) );
|
56 |
|
@@ -268,6 +266,25 @@ class Theme_My_Login_User_Moderation_Admin extends Theme_My_Login_Module {
|
|
268 |
}
|
269 |
}
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
/**
|
272 |
* Loads the module
|
273 |
*
|
@@ -275,6 +292,7 @@ class Theme_My_Login_User_Moderation_Admin extends Theme_My_Login_Module {
|
|
275 |
* @access public
|
276 |
*/
|
277 |
function load() {
|
|
|
278 |
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
279 |
if ( function_exists( 'is_multisite' ) && is_multisite() )
|
280 |
return;
|
49 |
elseif ( 'resendactivation' == $_GET['action'] ) {
|
50 |
check_admin_referer( 'resend-activation' );
|
51 |
|
|
|
|
|
52 |
if ( !Theme_My_Login_User_Moderation::new_user_activation_notification( $user ) )
|
53 |
wp_die( __( 'The e-mail could not be sent.', 'theme-my-login' ) . "<br />\n" . __( 'Possible reason: your host may have disabled the mail() function...', 'theme-my-login' ) );
|
54 |
|
266 |
}
|
267 |
}
|
268 |
|
269 |
+
/**
|
270 |
+
* Activates this module
|
271 |
+
*
|
272 |
+
* Callback for "tml_activate_user-moderation/user-moderation.php" hook in method Theme_My_Login_Admin::activate_module()
|
273 |
+
*
|
274 |
+
* @see Theme_My_Login_Admin::activate_module()
|
275 |
+
* @since 6.0
|
276 |
+
* @access public
|
277 |
+
*
|
278 |
+
* @param object $theme_my_login Reference to global $theme_my_login object
|
279 |
+
*/
|
280 |
+
function activate( &$theme_my_login ) {
|
281 |
+
$options = Theme_My_Login_User_Moderation::init_options();
|
282 |
+
$theme_my_login->options->set_option( 'moderation', $options['moderation'] );
|
283 |
+
|
284 |
+
$email = array_merge( (array) $theme_my_login->get_option( 'email' ), $options['email'] );
|
285 |
+
$theme_my_login->options->set_option( 'email', $email );
|
286 |
+
}
|
287 |
+
|
288 |
/**
|
289 |
* Loads the module
|
290 |
*
|
292 |
* @access public
|
293 |
*/
|
294 |
function load() {
|
295 |
+
add_action( 'tml_activate_user-moderaiton/user-moderation.php', array( &$this, 'activate' ) );
|
296 |
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
297 |
if ( function_exists( 'is_multisite' ) && is_multisite() )
|
298 |
return;
|
modules/user-moderation/user-moderation.php
CHANGED
@@ -117,8 +117,6 @@ class Theme_My_Login_User_Moderation extends Theme_My_Login_Module {
|
|
117 |
$user = new WP_User( $user_id );
|
118 |
|
119 |
if ( in_array( 'pending', (array) $user->roles ) ) {
|
120 |
-
// Apply activation e-mail filters
|
121 |
-
$this->apply_user_activation_notification_filters();
|
122 |
// Send activation e-mail
|
123 |
$this->new_user_activation_notification( $user->ID );
|
124 |
// Now redirect them
|
@@ -143,10 +141,8 @@ class Theme_My_Login_User_Moderation extends Theme_My_Login_Module {
|
|
143 |
* @return WP_User|WP_Error WP_User if the user can login, WP_Error otherwise
|
144 |
*/
|
145 |
function authenticate( $user, $username, $password ) {
|
146 |
-
|
147 |
-
|
148 |
-
if ( is_a( $user, 'WP_User' ) ) {
|
149 |
-
if ( in_array( 'pending', (array) $user->roles ) ) {
|
150 |
if ( 'email' == $GLOBALS['theme_my_login']->options->get_option( array( 'moderation', 'type' ) ) ) {
|
151 |
return new WP_Error( 'pending', sprintf(
|
152 |
__( '<strong>ERROR</strong>: You have not yet confirmed your e-mail address. <a href="%s">Resend activation</a>?', 'theme-my-login' ),
|
@@ -422,7 +418,8 @@ class Theme_My_Login_User_Moderation extends Theme_My_Login_Module {
|
|
422 |
$options['moderation'] = array(
|
423 |
'type' => 'none'
|
424 |
);
|
425 |
-
|
|
|
426 |
'user_activation' => array(
|
427 |
'mail_from' => '',
|
428 |
'mail_from_name' => '',
|
@@ -452,6 +449,11 @@ class Theme_My_Login_User_Moderation extends Theme_My_Login_Module {
|
|
452 |
'message' => ''
|
453 |
)
|
454 |
);
|
|
|
|
|
|
|
|
|
|
|
455 |
return $options;
|
456 |
}
|
457 |
|
117 |
$user = new WP_User( $user_id );
|
118 |
|
119 |
if ( in_array( 'pending', (array) $user->roles ) ) {
|
|
|
|
|
120 |
// Send activation e-mail
|
121 |
$this->new_user_activation_notification( $user->ID );
|
122 |
// Now redirect them
|
141 |
* @return WP_User|WP_Error WP_User if the user can login, WP_Error otherwise
|
142 |
*/
|
143 |
function authenticate( $user, $username, $password ) {
|
144 |
+
if ( $userdata = get_user_by( 'login', $username ) ) {
|
145 |
+
if ( array_key_exists( 'pending', (array) $userdata->wp_capabilities ) ) {
|
|
|
|
|
146 |
if ( 'email' == $GLOBALS['theme_my_login']->options->get_option( array( 'moderation', 'type' ) ) ) {
|
147 |
return new WP_Error( 'pending', sprintf(
|
148 |
__( '<strong>ERROR</strong>: You have not yet confirmed your e-mail address. <a href="%s">Resend activation</a>?', 'theme-my-login' ),
|
418 |
$options['moderation'] = array(
|
419 |
'type' => 'none'
|
420 |
);
|
421 |
+
|
422 |
+
$email = array(
|
423 |
'user_activation' => array(
|
424 |
'mail_from' => '',
|
425 |
'mail_from_name' => '',
|
449 |
'message' => ''
|
450 |
)
|
451 |
);
|
452 |
+
if ( isset( $options['email'] ) )
|
453 |
+
$options['email'] = array_merge( $options['email'], $email );
|
454 |
+
else
|
455 |
+
$options['email'] = $email;
|
456 |
+
|
457 |
return $options;
|
458 |
}
|
459 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.jfarthing.com/donate
|
|
4 |
Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.1
|
7 |
-
Stable tag: 6.1
|
8 |
|
9 |
Themes the WordPress login pages according to your theme.
|
10 |
|
@@ -40,6 +40,22 @@ Please visit http://www.jfarthing.com/docs/Theme_My_Login first and then visit h
|
|
40 |
|
41 |
== Changelog ==
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
= 6.1 =
|
44 |
* Fully support multisite
|
45 |
* Require WordPress 3.0+
|
4 |
Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.1
|
7 |
+
Stable tag: 6.1.1
|
8 |
|
9 |
Themes the WordPress login pages according to your theme.
|
10 |
|
40 |
|
41 |
== Changelog ==
|
42 |
|
43 |
+
= 6.1.1 =
|
44 |
+
* Implement 3.1 password reset routine
|
45 |
+
* Add 3.1 fields to Themed Profiles
|
46 |
+
* Better default stylesheet for Themed Profiles
|
47 |
+
* Add 'nofollow' attribute to action links
|
48 |
+
* Check for SSL
|
49 |
+
* Add nofollow and noindex to login page
|
50 |
+
* Fix missing argument notices
|
51 |
+
* Fix deprecated argument notices
|
52 |
+
* Fix undefined method notices
|
53 |
+
* Fix install/uninstall routines
|
54 |
+
* Fix Custom user Links AJAX
|
55 |
+
* Fix Custom E-mail "From" filters
|
56 |
+
* Fix disabling of admin password change notification
|
57 |
+
* Fix "resent" custom activation e-mail
|
58 |
+
|
59 |
= 6.1 =
|
60 |
* Fully support multisite
|
61 |
* Require WordPress 3.0+
|
templates/profile-form.php
CHANGED
@@ -6,6 +6,10 @@ Theme My Login will always look in your theme's directory first, before using th
|
|
6 |
|
7 |
$GLOBALS['current_user'] = $current_user = wp_get_current_user();
|
8 |
$GLOBALS['profileuser'] = $profileuser = get_user_to_edit( $current_user->ID );
|
|
|
|
|
|
|
|
|
9 |
?>
|
10 |
|
11 |
<div class="login profile" id="theme-my-login<?php $template->the_instance(); ?>">
|
@@ -18,14 +22,44 @@ $GLOBALS['profileuser'] = $profileuser = get_user_to_edit( $current_user->ID );
|
|
18 |
<input type="hidden" name="checkuser_id" value="<?php echo $current_user->ID; ?>" />
|
19 |
</p>
|
20 |
|
21 |
-
<?php if ( has_filter( 'personal_options' ) || has_filter( 'profile_personal_options' ) ) : ?>
|
22 |
<h3><?php _e( 'Personal Options', 'theme-my-login' ); ?></h3>
|
23 |
|
24 |
<table class="form-table">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
<?php do_action( 'personal_options', $profileuser ); ?>
|
26 |
</table>
|
27 |
<?php do_action( 'profile_personal_options', $profileuser ); ?>
|
28 |
-
<?php endif; ?>
|
29 |
|
30 |
<h3><?php _e( 'Name', 'theme-my-login' ) ?></h3>
|
31 |
|
6 |
|
7 |
$GLOBALS['current_user'] = $current_user = wp_get_current_user();
|
8 |
$GLOBALS['profileuser'] = $profileuser = get_user_to_edit( $current_user->ID );
|
9 |
+
|
10 |
+
$user_can_edit = false;
|
11 |
+
foreach ( array( 'posts', 'pages' ) as $post_cap )
|
12 |
+
$user_can_edit |= current_user_can( "edit_$post_cap" );
|
13 |
?>
|
14 |
|
15 |
<div class="login profile" id="theme-my-login<?php $template->the_instance(); ?>">
|
22 |
<input type="hidden" name="checkuser_id" value="<?php echo $current_user->ID; ?>" />
|
23 |
</p>
|
24 |
|
|
|
25 |
<h3><?php _e( 'Personal Options', 'theme-my-login' ); ?></h3>
|
26 |
|
27 |
<table class="form-table">
|
28 |
+
<?php if ( rich_edit_exists() && $user_can_edit ) : // don't bother showing the option if the editor has been removed ?>
|
29 |
+
<tr>
|
30 |
+
<th scope="row"><?php _e( 'Visual Editor', 'theme-my-login' )?></th>
|
31 |
+
<td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing', 'theme-my-login' ); ?></label></td>
|
32 |
+
</tr>
|
33 |
+
<?php endif; ?>
|
34 |
+
<?php if ( count( $GLOBALS['_wp_admin_css_colors'] ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
|
35 |
+
<tr>
|
36 |
+
<th scope="row"><?php _e( 'Admin Color Scheme', 'theme-my-login' )?></th>
|
37 |
+
<td><?php do_action( 'admin_color_scheme_picker' ); ?></td>
|
38 |
+
</tr>
|
39 |
+
<?php
|
40 |
+
endif; // $_wp_admin_css_colors
|
41 |
+
if ( $user_can_edit ) : ?>
|
42 |
+
<tr>
|
43 |
+
<th scope="row"><?php _e( 'Keyboard Shortcuts', 'theme-my-login' ); ?></th>
|
44 |
+
<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty( $profileuser->comment_shortcuts ) ) checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e( 'Enable keyboard shortcuts for comment moderation.', 'theme-my-login' ); ?></label> <?php _e( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>', 'theme-my-login' ); ?></td>
|
45 |
+
</tr>
|
46 |
+
<?php endif; ?>
|
47 |
+
<?php if ( function_exists( '_get_admin_bar_pref' ) ) : ?>
|
48 |
+
<tr class="show-admin-bar">
|
49 |
+
<th scope="row"><?php _e( 'Show Admin Bar', 'theme-my-login' )?></th>
|
50 |
+
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Show Admin Bar', 'theme-my-login' ); ?></span></legend>
|
51 |
+
<label for="admin_bar_front">
|
52 |
+
<input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1" <?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
|
53 |
+
<?php /* translators: Show admin bar when viewing site */ _e( 'when viewing site', 'theme-my-login' ); ?></label><br />
|
54 |
+
<label for="admin_bar_admin">
|
55 |
+
<input name="admin_bar_admin" type="checkbox" id="admin_bar_admin" value="1" <?php checked( _get_admin_bar_pref( 'admin', $profileuser->ID ) ); ?> />
|
56 |
+
<?php /* translators: Show admin bar in dashboard */ _e( 'in dashboard', 'theme-my-login' ); ?></label>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
<?php endif; // function exists ?>
|
60 |
<?php do_action( 'personal_options', $profileuser ); ?>
|
61 |
</table>
|
62 |
<?php do_action( 'profile_personal_options', $profileuser ); ?>
|
|
|
63 |
|
64 |
<h3><?php _e( 'Name', 'theme-my-login' ) ?></h3>
|
65 |
|
templates/resetpass-form.php
CHANGED
@@ -9,23 +9,25 @@ Theme My Login will always look in your theme's directory first, before using th
|
|
9 |
<?php $template->the_errors(); ?>
|
10 |
<form name="resetpasswordform" id="resetpasswordform<?php $template->the_instance(); ?>" action="<?php $template->the_action_url( 'resetpass' ); ?>" method="post">
|
11 |
<p>
|
12 |
-
<label for="pass1<?php $template->the_instance(); ?>"><?php _e( 'New
|
13 |
-
<input autocomplete="off" name="pass1" id="pass1<?php $template->the_instance(); ?>" class="input" size="20" value="" type="password" />
|
14 |
</p>
|
15 |
<p>
|
16 |
-
<label for="pass2<?php $template->the_instance(); ?>"><?php _e( 'Confirm
|
17 |
-
<input autocomplete="off" name="pass2" id="pass2<?php $template->the_instance(); ?>" class="input" size="20" value="" type="password" />
|
18 |
</p>
|
|
|
|
|
19 |
<?php
|
20 |
do_action( 'resetpassword_form' ); // Wordpress hook
|
21 |
do_action_ref_array( 'tml_resetpassword_form', array( $template ) ); // TML hook
|
22 |
?>
|
23 |
<p class="submit">
|
24 |
-
<input type="submit" name="wp-submit" id="wp-submit<?php $template->the_instance(); ?>" value="<?php
|
25 |
<input type="hidden" name="key" value="<?php $template->the_posted_value( 'key' ); ?>" />
|
26 |
-
<input type="hidden" name="login" value="<?php $template->the_posted_value( 'login' ); ?>" />
|
27 |
<input type="hidden" name="instance" value="<?php $template->the_instance(); ?>" />
|
28 |
</p>
|
29 |
</form>
|
30 |
-
<?php $template->the_action_links( array( '
|
31 |
</div>
|
9 |
<?php $template->the_errors(); ?>
|
10 |
<form name="resetpasswordform" id="resetpasswordform<?php $template->the_instance(); ?>" action="<?php $template->the_action_url( 'resetpass' ); ?>" method="post">
|
11 |
<p>
|
12 |
+
<label for="pass1<?php $template->the_instance(); ?>"><?php _e( 'New password', 'theme-my-login' );?></label>
|
13 |
+
<input autocomplete="off" name="pass1" id="pass1<?php $template->the_instance(); ?>" class="input" size="20" value="" type="password" autocomplete="off" />
|
14 |
</p>
|
15 |
<p>
|
16 |
+
<label for="pass2<?php $template->the_instance(); ?>"><?php _e( 'Confirm new password', 'theme-my-login' );?></label>
|
17 |
+
<input autocomplete="off" name="pass2" id="pass2<?php $template->the_instance(); ?>" class="input" size="20" value="" type="password" autocomplete="off" />
|
18 |
</p>
|
19 |
+
<div id="pass-strength-result" class="hide-if-no-js"><?php _e( 'Strength indicator', 'theme-my-login' ); ?></div>
|
20 |
+
<p class="description indicator-hint"><?php _e( 'Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).' ); ?></p>
|
21 |
<?php
|
22 |
do_action( 'resetpassword_form' ); // Wordpress hook
|
23 |
do_action_ref_array( 'tml_resetpassword_form', array( $template ) ); // TML hook
|
24 |
?>
|
25 |
<p class="submit">
|
26 |
+
<input type="submit" name="wp-submit" id="wp-submit<?php $template->the_instance(); ?>" value="<?php esc_attr_e( 'Reset Password', 'theme-my-login' ); ?>" />
|
27 |
<input type="hidden" name="key" value="<?php $template->the_posted_value( 'key' ); ?>" />
|
28 |
+
<input type="hidden" name="login" id="user_login" value="<?php $template->the_posted_value( 'login' ); ?>" />
|
29 |
<input type="hidden" name="instance" value="<?php $template->the_instance(); ?>" />
|
30 |
</p>
|
31 |
</form>
|
32 |
+
<?php $template->the_action_links( array( 'lostpassword' => false ) ); ?>
|
33 |
</div>
|
theme-my-login.css
CHANGED
@@ -36,4 +36,43 @@
|
|
36 |
|
37 |
.mu_register label.checkbox {
|
38 |
display: inline;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
36 |
|
37 |
.mu_register label.checkbox {
|
38 |
display: inline;
|
39 |
+
}
|
40 |
+
|
41 |
+
#pass-strength-result {
|
42 |
+
border-style: solid;
|
43 |
+
border-width: 1px;
|
44 |
+
margin: 12px 5px 5px 1px;
|
45 |
+
padding: 3px 5px;
|
46 |
+
text-align: center;
|
47 |
+
width: 200px;
|
48 |
+
}
|
49 |
+
|
50 |
+
#pass-strength-result.strong,
|
51 |
+
#pass-strength-result.short {
|
52 |
+
font-weight: bold;
|
53 |
+
}
|
54 |
+
|
55 |
+
#pass-strength-result {
|
56 |
+
background-color: #eee;
|
57 |
+
border-color: #ddd !important;
|
58 |
+
}
|
59 |
+
|
60 |
+
#pass-strength-result.bad {
|
61 |
+
background-color: #ffb78c;
|
62 |
+
border-color: #ff853c !important;
|
63 |
+
}
|
64 |
+
|
65 |
+
#pass-strength-result.good {
|
66 |
+
background-color: #ffec8b;
|
67 |
+
border-color: #fc0 !important;
|
68 |
+
}
|
69 |
+
|
70 |
+
#pass-strength-result.short {
|
71 |
+
background-color: #ffa0a0;
|
72 |
+
border-color: #f04040 !important;
|
73 |
+
}
|
74 |
+
|
75 |
+
#pass-strength-result.strong {
|
76 |
+
background-color: #c3ff88;
|
77 |
+
border-color: #8dff1c !important;
|
78 |
}
|
theme-my-login.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Theme My Login
|
4 |
Plugin URI: http://www.jfarthing.com/wordpress-plugins/theme-my-login/
|
5 |
Description: Themes the WordPress login, registration and forgot password pages according to your theme.
|
6 |
-
Version: 6.1
|
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/wordpress-plugins/theme-my-login/
|
5 |
Description: Themes the WordPress login, registration and forgot password pages according to your theme.
|
6 |
+
Version: 6.1.1
|
7 |
Author: Jeff Farthing
|
8 |
Author URI: http://www.jfarthing.com
|
9 |
Text Domain: theme-my-login
|