Theme My Login - Version 2.1

Version Description

Download this release

Release Info

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

Code changes from version 2.0.8 to 2.1

includes/admin-page.php CHANGED
@@ -8,7 +8,11 @@ if ( $_POST ) {
8
  $chk_uninstall = isset($_POST['chk_uninstall']) ? true : false;
9
  $theme_profile = isset($_POST['theme_profile']) ? true : false;
10
  $this->SetOption('chk_uninstall', $chk_uninstall);
11
- $this->SetOption('login_redirect', stripslashes($_POST['login_redirect']));
 
 
 
 
12
  $this->SetOption('logout_redirect', stripslashes($_POST['logout_redirect']));
13
  $this->SetOption('theme_profile', $theme_profile);
14
  $this->SetOption('login_title', stripslashes($_POST['login_title']));
@@ -22,18 +26,21 @@ if ( $_POST ) {
22
  $this->SetOption('profile_text', stripslashes($_POST['profile_text']));
23
  $this->SaveOptions();
24
 
25
- $success = "<li>Settings updated successfully!</li>";
 
 
 
26
  }
27
  ?>
28
 
29
- <div class="updated">
30
  <p><?php _e('If you like this plugin, please help keep it up to date by <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3836253">donating through PayPal</a>!'); ?></p>
31
  </div>
32
 
33
  <div class="wrap">
34
  <?php if ( isset($success) && strlen($success) > 0 ) { ?>
35
  <div id="message" class="updated fade">
36
- <p><strong><?php _e("<ul>{$success}</ul>"); ?></strong></p>
37
  </div>
38
  <?php } ?>
39
  <div id="icon-options-general" class="icon32"><br /></div>
@@ -53,16 +60,44 @@ if ( $_POST ) {
53
  <h3><?php _e('Redirection Settings'); ?></h3>
54
  <table class="form-table">
55
  <tr valign="top">
56
- <th scope="row"><label for="login_redirect"><?php _e('Redirect on Login'); ?></label></th>
57
  <td>
58
- <input name="login_redirect" type="text" id="login_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('login_redirect') ) ); ?>" class="regular-text" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
60
  </td>
61
  </tr>
62
  <tr valign="top">
63
  <th scope="row"><label for="logout_redirect"><?php _e('Redirect on Logout'); ?></label></th>
64
  <td>
65
- <input name="logout_redirect" type="text" id="logout_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('logout_redirect') ) ); ?>" class="regular-text" />
66
  <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
67
  </td>
68
  </tr>
@@ -71,7 +106,7 @@ if ( $_POST ) {
71
  <h3><?php _e('Template Settings'); ?></h3>
72
  <table class="form-table">
73
  <tr valign="top">
74
- <th scope="row"><label for="theme_profile"><?php _e('Theme Profile?'); ?></label></th>
75
  <td>
76
  <input name="theme_profile" type="checkbox" id="theme_profile" value="1" <?php if ($this->GetOption('theme_profile')) { echo 'checked="checked"'; } ?> />
77
  <span class="setting-description"><?php _e('Check here to theme subscriber\'s profile. This is known to cause issues with plugins that have a user administration menu.'); ?></span>
8
  $chk_uninstall = isset($_POST['chk_uninstall']) ? true : false;
9
  $theme_profile = isset($_POST['theme_profile']) ? true : false;
10
  $this->SetOption('chk_uninstall', $chk_uninstall);
11
+ $this->SetOption('subscr_login_redirect', stripslashes($_POST['subscr_login_redirect']));
12
+ $this->SetOption('contrb_login_redirect', stripslashes($_POST['contrb_login_redirect']));
13
+ $this->SetOption('author_login_redirect', stripslashes($_POST['author_login_redirect']));
14
+ $this->SetOption('editor_login_redirect', stripslashes($_POST['editor_login_redirect']));
15
+ $this->SetOption('admin_login_redirect', stripslashes($_POST['admin_login_redirect']));
16
  $this->SetOption('logout_redirect', stripslashes($_POST['logout_redirect']));
17
  $this->SetOption('theme_profile', $theme_profile);
18
  $this->SetOption('login_title', stripslashes($_POST['login_title']));
26
  $this->SetOption('profile_text', stripslashes($_POST['profile_text']));
27
  $this->SaveOptions();
28
 
29
+ if ($chk_uninstall)
30
+ $success = "To complete uninstall, deactivate this plugin. If you do not wish to uninstall, please uncheck the 'Complete Uninstall' checkbox.";
31
+ else
32
+ $success = "Settings saved.";
33
  }
34
  ?>
35
 
36
+ <div class="updated" style="background:aliceblue; border:1px solid lightblue">
37
  <p><?php _e('If you like this plugin, please help keep it up to date by <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3836253">donating through PayPal</a>!'); ?></p>
38
  </div>
39
 
40
  <div class="wrap">
41
  <?php if ( isset($success) && strlen($success) > 0 ) { ?>
42
  <div id="message" class="updated fade">
43
+ <p><strong><?php _e($success); ?></strong></p>
44
  </div>
45
  <?php } ?>
46
  <div id="icon-options-general" class="icon32"><br /></div>
60
  <h3><?php _e('Redirection Settings'); ?></h3>
61
  <table class="form-table">
62
  <tr valign="top">
63
+ <th scope="row"><label for="subscr_login_redirect"><?php _e('Subscriber Login Redirect'); ?></label></th>
64
  <td>
65
+ <input name="subscr_login_redirect" type="text" id="subscr_login_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('subscr_login_redirect') ) ); ?>" class="regular-text" size="100" />
66
+ <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
67
+ </td>
68
+ </tr>
69
+ <tr valign="top">
70
+ <th scope="row"><label for="contrb_login_redirect"><?php _e('Contributor Login Redirect'); ?></label></th>
71
+ <td>
72
+ <input name="contrb_login_redirect" type="text" id="contrb_login_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('contrb_login_redirect') ) ); ?>" class="regular-text" size="75" />
73
+ <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
74
+ </td>
75
+ </tr>
76
+ <tr valign="top">
77
+ <th scope="row"><label for="login_redirect"><?php _e('Author Login Redirect'); ?></label></th>
78
+ <td>
79
+ <input name="author_login_redirect" type="text" id="author_login_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('author_login_redirect') ) ); ?>" class="regular-text" size="75" />
80
+ <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
81
+ </td>
82
+ </tr>
83
+ <tr valign="top">
84
+ <th scope="row"><label for="editor_login_redirect"><?php _e('Editor Login Redirect'); ?></label></th>
85
+ <td>
86
+ <input name="editor_login_redirect" type="text" id="editor_login_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('editor_login_redirect') ) ); ?>" class="regular-text" size="75" />
87
+ <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
88
+ </td>
89
+ </tr>
90
+ <tr valign="top">
91
+ <th scope="row"><label for="admin_login_redirect"><?php _e('Administrator Login Redirect'); ?></label></th>
92
+ <td>
93
+ <input name="admin_login_redirect" type="text" id="admin_login_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('admin_login_redirect') ) ); ?>" class="regular-text" size="75" />
94
  <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
95
  </td>
96
  </tr>
97
  <tr valign="top">
98
  <th scope="row"><label for="logout_redirect"><?php _e('Redirect on Logout'); ?></label></th>
99
  <td>
100
+ <input name="logout_redirect" type="text" id="logout_redirect" value="<?php echo( htmlspecialchars ( $this->GetOption('logout_redirect') ) ); ?>" class="regular-text" size="75" />
101
  <span class="setting-description"><?php _e('Must be an absolute URL.'); ?></span>
102
  </td>
103
  </tr>
106
  <h3><?php _e('Template Settings'); ?></h3>
107
  <table class="form-table">
108
  <tr valign="top">
109
+ <th scope="row"><label for="theme_profile"><?php _e('Theme Subscriber\'s Profile?'); ?></label></th>
110
  <td>
111
  <input name="theme_profile" type="checkbox" id="theme_profile" value="1" <?php if ($this->GetOption('theme_profile')) { echo 'checked="checked"'; } ?> />
112
  <span class="setting-description"><?php _e('Check here to theme subscriber\'s profile. This is known to cause issues with plugins that have a user administration menu.'); ?></span>
includes/profile-actions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
4
  require_once (ABSPATH . '/wp-admin/includes/misc.php');
5
  require_once (ABSPATH . '/wp-admin/includes/user.php');
6
  require_once (ABSPATH . WPINC . '/registration.php');
1
  <?php
2
 
3
+ require_once (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
4
  require_once (ABSPATH . '/wp-admin/includes/misc.php');
5
  require_once (ABSPATH . '/wp-admin/includes/user.php');
6
  require_once (ABSPATH . WPINC . '/registration.php');
includes/profile-form.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
4
  require_once (ABSPATH . '/wp-admin/includes/misc.php');
5
  require_once (ABSPATH . '/wp-admin/includes/user.php');
6
 
1
  <?php
2
 
3
+ require_once (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
4
  require_once (ABSPATH . '/wp-admin/includes/misc.php');
5
  require_once (ABSPATH . '/wp-admin/includes/user.php');
6
 
includes/wp-login-actions.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  global $wp_version;
4
 
5
- require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
6
 
7
  if ( force_ssl_admin() && !is_ssl() ) {
8
  if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
@@ -45,10 +45,13 @@ case 'logout' :
45
  check_admin_referer('log-out');
46
  wp_logout();
47
 
48
-
49
- $redirect_to = get_option('siteurl') . '/wp-login.php?loggedout=true';
50
  if ( isset( $_REQUEST['redirect_to'] ) )
51
  $redirect_to = $_REQUEST['redirect_to'];
 
 
 
 
 
52
 
53
  wp_safe_redirect($redirect_to);
54
  exit();
@@ -111,26 +114,29 @@ case 'login' :
111
  }
112
  }
113
 
114
- if ( isset( $_REQUEST['redirect_to'] ) ) {
115
- $redirect_to = $_REQUEST['redirect_to'];
116
- // Redirect to https if user wants ssl
117
- if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
118
- $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
119
- } else {
120
- $redirect_to = $this->GetOption('login_redirect');
121
- }
122
-
123
- if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
124
  $secure_cookie = false;
125
 
126
  $user = wp_signon('', $secure_cookie);
127
 
128
- $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
129
-
130
  if ( !is_wp_error($user) ) {
131
- // If the user can't edit posts, send them to their profile.
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
133
  $redirect_to = admin_url('profile.php');
 
134
  wp_safe_redirect($redirect_to);
135
  exit();
136
  }
2
 
3
  global $wp_version;
4
 
5
+ require_once (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
6
 
7
  if ( force_ssl_admin() && !is_ssl() ) {
8
  if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
45
  check_admin_referer('log-out');
46
  wp_logout();
47
 
 
 
48
  if ( isset( $_REQUEST['redirect_to'] ) )
49
  $redirect_to = $_REQUEST['redirect_to'];
50
+ else
51
+ $redirect_to = $this->GetOption('logout_redirect');
52
+
53
+ if ( empty($redirect_to) )
54
+ $redirect_to = get_bloginfo('siteurl') . '/wp-login.php?loggedout=true';
55
 
56
  wp_safe_redirect($redirect_to);
57
  exit();
114
  }
115
  }
116
 
117
+ if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() )
 
 
 
 
 
 
 
 
 
118
  $secure_cookie = false;
119
 
120
  $user = wp_signon('', $secure_cookie);
121
 
 
 
122
  if ( !is_wp_error($user) ) {
123
+ if ($user->has_cap('subscriber'))
124
+ $redirect_to = $this->GetOption('subscr_login_redirect');
125
+ elseif ($user->has_cap('contributor'))
126
+ $redirect_to = $this->GetOption('contrb_login_redirect');
127
+ elseif ($user->has_cap('author'))
128
+ $redirect_to = $this->GetOption('author_login_redirect');
129
+ elseif ($user->has_cap('editor'))
130
+ $redirect_to = $this->GetOption('editor_login_redirect');
131
+ elseif ($user->has_cap('administrator'))
132
+ $redirect_to = $this->GetOption('admin_login_redirect');
133
+
134
+ if (empty($redirect_to))
135
+ $redirect_to = get_bloginfo('siteurl') . '/wp-admin';
136
+
137
  if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
138
  $redirect_to = admin_url('profile.php');
139
+
140
  wp_safe_redirect($redirect_to);
141
  exit();
142
  }
includes/wp-login-forms.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
4
 
5
  $http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
6
  $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
@@ -67,14 +67,6 @@ break;
67
 
68
  case 'login' :
69
  default :
70
- if ( isset( $_REQUEST['redirect_to'] ) ) {
71
- $redirect_to = $_REQUEST['redirect_to'];
72
- // Redirect to https if user wants ssl
73
- if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
74
- $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
75
- } else {
76
- $redirect_to = $this->GetOption('login_redirect');
77
- }
78
 
79
  // Clear errors if loggedout is set.
80
  if ( !empty($_GET['loggedout']) )
@@ -110,7 +102,6 @@ default :
110
  <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <?php _e('Remember Me'); ?></label></p>
111
  <p class="submit">
112
  <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
113
- <input type="hidden" name="redirect_to" value="<?php echo attribute_escape($redirect_to); ?>" />
114
  <input type="hidden" name="testcookie" value="1" />
115
  </p>
116
  </form>
1
  <?php
2
 
3
+ require_once (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
4
 
5
  $http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
6
  $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
67
 
68
  case 'login' :
69
  default :
 
 
 
 
 
 
 
 
70
 
71
  // Clear errors if loggedout is set.
72
  if ( !empty($_GET['loggedout']) )
102
  <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <?php _e('Remember Me'); ?></label></p>
103
  <p class="submit">
104
  <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
 
105
  <input type="hidden" name="testcookie" value="1" />
106
  </p>
107
  </form>
readme.txt CHANGED
@@ -1,64 +1,79 @@
1
  === Theme My Login ===
2
  Contributors: jfarthing84
3
- Donate link: http://webdesign.jaedub.com
4
- Tags: wordpress, login, register, theme, form, james kelly
5
  Requires at least: 2.5
6
  Tested up to: 2.7.1
7
- Stable tag: 2.0.8
8
 
9
- This plugin themes the WordPress login, register, forgot password and profile pages to look like the rest of your website.
10
 
11
 
12
  == Description ==
13
 
14
- This plugin themes the WordPress login, register, forgot password and profile pages to look like the rest of your website. It replaces the wp-login.php and profile.php by using a page template from your theme.
15
-
16
- To everybody who has been bearing with this plugin since the begining, thank you. I believe everything should be in well working order now. If you have any questions, comments or concerns, please contact me through my website listed here.
17
-
18
 
19
  == Installation ==
20
 
21
  Upload the Theme My Login plugin to your 'wp-content/plugins' directory and activate it. The 'Theme My Login' settings will apear under the 'Settings' menu in the WordPress admin. You will need to go in to these settings and set them according to your theme layout. Here is a desciption of what needs to go into each setting.
22
 
23
- 1. Redirect on Login - You can change this to any location you would like the user to be redirected to upon login. This defaults to 'wp-admin/'.
24
 
25
- 2. Redirect on Logout - You can change this to any location you would like the user to be redirected to upon logout. This defaults to 'wp-login.php?loggedout=true'.
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
- 3. Register Page Title - You can change this to whatever title you want for the registration page. You can use %blogname% for your blog name. This defaults to 'Register &rsaquo;'.
28
 
29
- 4. Register Text - You can change this to whatever text you want to appear above your registration form. This defaults to 'Register'.
30
 
31
- 5. Register Message - You can change this to whatever you want to appear below your registration form. This defaults to 'A password will be e-mailed to you.'
32
 
33
- 6. Login Page Title - You can change this to whatever title you want to for the login page. You can use %blogname% for your blog name. This defaults to 'Log In &rsaquo;'.
34
 
35
- 7. Login Text - You can change this to whatever text you want to appear above your login form. This defaults to 'Log In'.
36
 
37
- 8. Lost Password Page Title - You can change this to whatever title you want for the lost password page. You can use %blogname% for your blog name. This defaults to 'Lost Password &rsaquo;'.
38
 
39
- 9. Lost Password Text - You can change this to whatever text you want to appear above your lost password form. This defaults to 'Lost Password'.
40
 
41
- 10. Profile Page Title - You can change this to whatever title you want for the subscriber profile page. You can use %blogname% for your blog name. This defaults to 'Profile &rsqauo;'.
 
 
 
 
 
 
42
 
43
- 11. Profile Text - You can change this to whatever text you want to appear above the user profile form. This defaults to 'Your Profile'.
44
 
45
  Now you can save your changes and go test out your new themed login and registration pages. That's all!
46
 
47
 
48
  == Version History ==
49
 
50
- * 1.0.0 - 2009-03-13 - Initial release version
51
- * 1.0.1 - 2009-03-14 - Made backwards compatible to WordPress 2.5+
52
- * 1.1.0 - 2009-03-14 - Added custom profile to completely hide the back-end from subscribers
53
- * 1.1.1 - 2009-03-16 - Prepared plugin for internationalization and fixed a PHP version bug
54
- * 1.1.2 - 2009-03-20 - Updated to allow customization of text below registration form
55
- * 1.2.0 - 2009-03-26 - Added capability to customize page titles for all pages affected by plugin
56
- * 2.0.0 - 2009-03-27 - Completely rewrote plugin to use page template, no more specifying template files & HTML
57
- * 2.0.1 - 2009-03-30 - Fixed a bug that redirected users who were not yet logged in to profile page
58
- * 2.0.2 - 2009-03-31 - Fixed a bug that broke registration and broke other plugins using the_content filter
59
- * 2.0.3 - 2009-04-02 - Fixed various reported bugs and cleaned up code
60
- * 2.0.4 - 2009-04-03 - Fixed a bug regarding relative URL's in redirection
61
- * 2.0.5 - 2009-04-04 - Fixed a bug with default redirection and hid the login form from logged in users
62
- * 2.0.6 - 2009-04-08 - Added the option to turn on/off subscriber profile theming
63
  * 2.0.7 - 2009-04-10 - Fixed a bug that broke the Featured Content plugin
64
- * 2.0.8 - 2009-04-11 - Fixed a bug that broke the login with permalinks
 
 
 
 
 
 
 
 
 
 
 
 
1
  === Theme My Login ===
2
  Contributors: jfarthing84
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3836253
4
+ Tags: themed login, custom login, login redirection
5
  Requires at least: 2.5
6
  Tested up to: 2.7.1
7
+ Stable tag: 2.1
8
 
9
+ Themes the WordPress login pages according to your theme. Also allows you to redirect users based on their role upon login.
10
 
11
 
12
  == Description ==
13
 
14
+ This plugin themes the WordPress login, register, forgot password and profile pages according to your current theme. It replaces the wp-login.php and profile.php by using a page template from your theme. <strong>Since 2.1</strong>: Theme My Login now allows you to redirect users based on their role upon login!
 
 
 
15
 
16
  == Installation ==
17
 
18
  Upload the Theme My Login plugin to your 'wp-content/plugins' directory and activate it. The 'Theme My Login' settings will apear under the 'Settings' menu in the WordPress admin. You will need to go in to these settings and set them according to your theme layout. Here is a desciption of what needs to go into each setting.
19
 
 
20
 
21
+ -- Redirection Settings
22
+
23
+ * Subscriber Login Redirect - You can change this to any location on your site that you would like to redirect subscribers to upon login. This must be an absolute URL.
24
+
25
+ * Contributor Login Redirect - You can change this to any location on your site that you would like to redirect contributors to upon login. This must be an absolute URL.
26
+
27
+ * Author Login Redirect - You can change this to any location on your site that you would like to redirect authors to upon login. This must be an absolute URL.
28
+
29
+ * Editor Login Redirect - You can change this to any location on your site that you would like to redirect editors to upon login. This must be an absolute URL.
30
+
31
+ * Administrator Login Redirect - You can change this to any location on your site that you would like to redirect administrators to upon login. This must be an absolute URL.
32
+
33
+ * Redirect on Logout - You can change this to any location you would like all users to be redirected to upon logout.
34
+
35
 
36
+ -- Template Settings
37
 
38
+ * Theme Subscribers Profile - Check this option if you would like to theme subscriber's profiles. This is useful to hide the back-end from people who can't write posts anyway. <strong>WARNING</strong>: This will disable any user menus created by plugins.
39
 
40
+ * Register Page Title - You can change this to whatever title you want for the registration page. You can use %blogname% for your blog name.
41
 
42
+ * Register Text - You can change this to whatever text you want to appear above your registration form. This defaults to 'Register'.
43
 
44
+ * Register Message - You can change this to whatever you want to appear below your registration form.
45
 
46
+ * Login Page Title - You can change this to whatever title you want to for the login page. You can use %blogname% for your blog name.
47
 
48
+ * Login Text - You can change this to whatever text you want to appear above your login form.
49
 
50
+ * Lost Password Page Title - You can change this to whatever title you want for the lost password page. You can use %blogname% for your blog name.
51
+
52
+ * Lost Password Text - You can change this to whatever text you want to appear above your lost password form. This defaults to 'Lost Password'.
53
+
54
+ * Profile Page Title - You can change this to whatever title you want for the subscriber profile page. You can use %blogname% for your blog name.
55
+
56
+ * Profile Text - You can change this to whatever text you want to appear above the user profile form.
57
 
 
58
 
59
  Now you can save your changes and go test out your new themed login and registration pages. That's all!
60
 
61
 
62
  == Version History ==
63
 
64
+ * 2.1.0 - 2009-04-12 - Implemented login redirection based on user role
65
+ * 2.0.8 - 2009-04-11 - Fixed a bug that broke the login with permalinks
 
 
 
 
 
 
 
 
 
 
 
66
  * 2.0.7 - 2009-04-10 - Fixed a bug that broke the Featured Content plugin
67
+ * 2.0.6 - 2009-04-08 - Added the option to turn on/off subscriber profile theming
68
+ * 2.0.5 - 2009-04-04 - Fixed a bug with default redirection and hid the login form from logged in users
69
+ * 2.0.4 - 2009-04-03 - Fixed a bug regarding relative URL's in redirection
70
+ * 2.0.3 - 2009-04-02 - Fixed various reported bugs and cleaned up code
71
+ * 2.0.2 - 2009-03-31 - Fixed a bug that broke registration and broke other plugins using the_content filter
72
+ * 2.0.1 - 2009-03-30 - Fixed a bug that redirected users who were not yet logged in to profile page
73
+ * 2.0.0 - 2009-03-27 - Completely rewrote plugin to use page template, no more specifying template files & HTML
74
+ * 1.2.0 - 2009-03-26 - Added capability to customize page titles for all pages affected by plugin
75
+ * 1.1.2 - 2009-03-20 - Updated to allow customization of text below registration form
76
+ * 1.1.1 - 2009-03-16 - Prepared plugin for internationalization and fixed a PHP version bug
77
+ * 1.1.0 - 2009-03-14 - Added custom profile to completely hide the back-end from subscribers
78
+ * 1.0.1 - 2009-03-14 - Made backwards compatible to WordPress 2.5+
79
+ * 1.0.0 - 2009-03-13 - Initial release version
theme-my-login.php CHANGED
@@ -2,13 +2,12 @@
2
  /*
3
  Plugin Name: Theme My Login
4
  Plugin URI: http://webdesign.jaedub.com/wordpress-plugins/theme-my-login-plugin
5
- Description: Themes the WordPress login, register, forgot password and profile pages to look like the rest of your website.
6
- Version: 2.0.8
7
  Author: Jae Dub
8
  Author URI: http://webdesign.jaedub.com
9
  */
10
 
11
-
12
  global $wp_version;
13
 
14
  if ($wp_version < '2.6') {
@@ -27,7 +26,7 @@ if ($wp_version < '2.6') {
27
  if (!class_exists('ThemeMyLogin')) {
28
  class ThemeMyLogin {
29
 
30
- var $version = '2.0.8';
31
  var $options = array();
32
  var $errors = '';
33
 
@@ -65,11 +64,6 @@ if (!class_exists('ThemeMyLogin')) {
65
  $page_id = wp_insert_post($insert);
66
  } else $page_id = $theme_my_login->ID;
67
 
68
- if ($this->GetOption('login_redirect') == 'wp-admin/')
69
- $this->SetOption('login_redirect', admin_url());
70
- if ($this->GetOption('logout_redirect') == 'wp-login.php?loggedout=true')
71
- $this->SetOption('logout_redirect', site_url('wp-login.php?loggedout=true', 'login'));
72
-
73
  $this->SetOption('page_id', $page_id);
74
  $this->SaveOptions();
75
  }
@@ -83,20 +77,24 @@ if (!class_exists('ThemeMyLogin')) {
83
 
84
  # Sets up default options
85
  function InitOptions() {
86
- $this->options['chk_uninstall'] = 0;
87
- $this->options['version'] = $this->version;
88
- $this->options['page_id'] = '0';
89
- $this->options['login_redirect'] = admin_url();
90
- $this->options['logout_redirect'] = site_url('wp-login.php?loggedout=true', 'login');
91
- $this->options['login_title'] = '%blogname% &rsaquo; Log In';
92
- $this->options['login_text'] = 'Log In';
93
- $this->options['register_title'] = '%blogname% &rsaquo; Register';
94
- $this->options['register_text'] = 'Register';
95
- $this->options['register_msg'] = 'A password will be e-mailed to you.';
96
- $this->options['password_title'] = '%blogname% &rsaquo; Lost Password';
97
- $this->options['password_text'] = 'Lost Password';
98
- $this->options['profile_title'] = '%blogname% &rsaquo; Profile';
99
- $this->options['profile_text'] = 'Your Profile';
 
 
 
 
100
  }
101
 
102
  # Loads options from database
@@ -189,7 +187,7 @@ if (!class_exists('ThemeMyLogin')) {
189
  case 'wp-register.php':
190
  case 'wp-login.php':
191
  if ( is_user_logged_in() && $_REQUEST['action'] != 'logout' )
192
- $redirect_to = admin_url('profile.php');
193
  else
194
  $redirect_to = $this->ArgURL($permalink, $_GET);
195
  wp_safe_redirect($redirect_to);
2
  /*
3
  Plugin Name: Theme My Login
4
  Plugin URI: http://webdesign.jaedub.com/wordpress-plugins/theme-my-login-plugin
5
+ Description: Themes the WordPress login pages according to your theme. Also allows you to redirect users based on their role upon login.
6
+ Version: 2.1
7
  Author: Jae Dub
8
  Author URI: http://webdesign.jaedub.com
9
  */
10
 
 
11
  global $wp_version;
12
 
13
  if ($wp_version < '2.6') {
26
  if (!class_exists('ThemeMyLogin')) {
27
  class ThemeMyLogin {
28
 
29
+ var $version = '2.1';
30
  var $options = array();
31
  var $errors = '';
32
 
64
  $page_id = wp_insert_post($insert);
65
  } else $page_id = $theme_my_login->ID;
66
 
 
 
 
 
 
67
  $this->SetOption('page_id', $page_id);
68
  $this->SaveOptions();
69
  }
77
 
78
  # Sets up default options
79
  function InitOptions() {
80
+ $this->options['chk_uninstall'] = 0;
81
+ $this->options['version'] = $this->version;
82
+ $this->options['page_id'] = '0';
83
+ $this->options['subscr_login_redirect'] = admin_url();
84
+ $this->options['contrb_login_redirect'] = admin_url();
85
+ $this->options['author_login_redirect'] = admin_url();
86
+ $this->options['editor_login_redirect'] = admin_url();
87
+ $this->options['admin_login_redirect'] = admin_url();
88
+ $this->options['logout_redirect'] = site_url('wp-login.php?loggedout=true', 'login');
89
+ $this->options['login_title'] = 'Log In';
90
+ $this->options['login_text'] = 'Log In';
91
+ $this->options['register_title'] = 'Register';
92
+ $this->options['register_text'] = 'Register';
93
+ $this->options['register_msg'] = 'A password will be e-mailed to you.';
94
+ $this->options['password_title'] = 'Lost Password';
95
+ $this->options['password_text'] = 'Lost Password';
96
+ $this->options['profile_title'] = 'Your Profile';
97
+ $this->options['profile_text'] = 'Your Profile';
98
  }
99
 
100
  # Loads options from database
187
  case 'wp-register.php':
188
  case 'wp-login.php':
189
  if ( is_user_logged_in() && $_REQUEST['action'] != 'logout' )
190
+ $redirect_to = admin_url();
191
  else
192
  $redirect_to = $this->ArgURL($permalink, $_GET);
193
  wp_safe_redirect($redirect_to);