Theme My Login - Version 4.1.2

Version Description

  • Added the ability to change main login page ID (Only needed for debugging)
  • The login will now revert to default wp-login in the case of plugin failure
Download this release

Release Info

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

Code changes from version 4.1.1 to 4.1.2

Files changed (3) hide show
  1. includes/admin-page.php +8 -0
  2. readme.txt +4 -0
  3. theme-my-login.php +18 -11
includes/admin-page.php CHANGED
@@ -11,6 +11,7 @@ if ( $_POST ) {
11
  $ThemeMyLogin->options['general']['defaults'] = ( isset($_POST['general']['defaults']) ) ? 1 : 0;
12
  $ThemeMyLogin->options['general']['show_page'] = ( isset($_POST['general']['show_page']) ) ? 1 : 0;
13
  $ThemeMyLogin->options['general']['custom_pass'] = ( isset($_POST['general']['custom_pass']) ) ? 1 : 0;
 
14
  $ThemeMyLogin->options['general']['from_name'] = stripslashes($_POST['general']['from_name']);
15
  $ThemeMyLogin->options['general']['from_email'] = stripslashes($_POST['general']['from_email']);
16
 
@@ -118,6 +119,13 @@ $emails = $ThemeMyLogin->GetOption('emails');
118
  <label for="general[custom_pass]"><?php _e('Allow Users To Set Their Own Password', 'theme-my-login'); ?></label>
119
  </td>
120
  </tr>
 
 
 
 
 
 
 
121
  </table>
122
 
123
  </div>
11
  $ThemeMyLogin->options['general']['defaults'] = ( isset($_POST['general']['defaults']) ) ? 1 : 0;
12
  $ThemeMyLogin->options['general']['show_page'] = ( isset($_POST['general']['show_page']) ) ? 1 : 0;
13
  $ThemeMyLogin->options['general']['custom_pass'] = ( isset($_POST['general']['custom_pass']) ) ? 1 : 0;
14
+ $ThemeMyLogin->options['general']['page_id'] = (int) $_POST['general']['page_id'];
15
  $ThemeMyLogin->options['general']['from_name'] = stripslashes($_POST['general']['from_name']);
16
  $ThemeMyLogin->options['general']['from_email'] = stripslashes($_POST['general']['from_email']);
17
 
119
  <label for="general[custom_pass]"><?php _e('Allow Users To Set Their Own Password', 'theme-my-login'); ?></label>
120
  </td>
121
  </tr>
122
+ <tr valign="top">
123
+ <th scope="row"><label for="general[page_id]"><?php _e('Page ID', 'theme-my-login'); ?></label></th>
124
+ <td>
125
+ <input name="general[page_id]" type="text" id="general[page_id]" value="<?php echo $ThemeMyLogin->options['general']['page_id']; ?>" size="1" />
126
+ <span class="description"><strong>DO NOT</strong> change this unless you are <strong>ABSOLUTELY POSITIVE</strong> you know what you are doing!</span>
127
+ </td>
128
+ </tr>
129
  </table>
130
 
131
  </div>
readme.txt CHANGED
@@ -37,6 +37,10 @@ None yet. Please visit http://www.jfarthing.com/forum for any support!
37
 
38
  == Changelog ==
39
 
 
 
 
 
40
  = 4.1.1 =
41
  * Fixed a major bug dealing with saving options that broke the plugin
42
  * Fixed a CSS bug causing interference with other interfaces that use jQuery UI Tabs
37
 
38
  == Changelog ==
39
 
40
+ = 4.1.2 =
41
+ * Added the ability to change main login page ID (Only needed for debugging)
42
+ * The login will now revert to default wp-login in the case of plugin failure
43
+
44
  = 4.1.1 =
45
  * Fixed a major bug dealing with saving options that broke the plugin
46
  * Fixed a CSS bug causing interference with other interfaces that use jQuery UI Tabs
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-plugin
5
  Description: Themes the WordPress login, registration and forgot password pages according to your theme.
6
- Version: 4.1.1
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login
@@ -21,7 +21,7 @@ if ($wp_version < '2.6') {
21
  if (!class_exists('ThemeMyLogin')) {
22
  class ThemeMyLogin extends WPPluginShell {
23
 
24
- var $version = '4.1.1';
25
  var $options = array();
26
  var $permalink = '';
27
  var $instances = 0;
@@ -68,6 +68,9 @@ if (!class_exists('ThemeMyLogin')) {
68
  $this->SaveOptions();
69
  }
70
 
 
 
 
71
  $this->SetMailFrom($this->options['general']['from_email'], $this->options['general']['from_name']);
72
 
73
  $this->WPPluginShell();
@@ -184,9 +187,11 @@ if (!class_exists('ThemeMyLogin')) {
184
  switch ( $pagenow ) {
185
  case 'wp-register.php':
186
  case 'wp-login.php':
187
- $redirect_to = add_query_arg($_GET, $this->permalink);
188
- wp_redirect($redirect_to);
189
- exit();
 
 
190
  break;
191
  }
192
 
@@ -403,12 +408,14 @@ if (!class_exists('ThemeMyLogin')) {
403
  function SiteURL($url, $path) {
404
  global $wp_rewrite;
405
 
406
- if ( preg_match('/wp-login.php/', $url) ) {
407
- $parsed_url = parse_url($url);
408
- if ( isset($parsed_url['query']) )
409
- $url = $wp_rewrite->using_permalinks() ? $this->permalink.'?'.$parsed_url['query'] : $this->permalink.'&'.$parsed_url['query'];
410
- else
411
- $url = $this->permalink;
 
 
412
  }
413
  return $url;
414
  }
3
  Plugin Name: Theme My Login
4
  Plugin URI: http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin
5
  Description: Themes the WordPress login, registration and forgot password pages according to your theme.
6
+ Version: 4.1.2
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login
21
  if (!class_exists('ThemeMyLogin')) {
22
  class ThemeMyLogin extends WPPluginShell {
23
 
24
+ var $version = '4.1.2';
25
  var $options = array();
26
  var $permalink = '';
27
  var $instances = 0;
68
  $this->SaveOptions();
69
  }
70
 
71
+ //if ( empty($this->options['general']['page_id']) )
72
+ //return;
73
+
74
  $this->SetMailFrom($this->options['general']['from_email'], $this->options['general']['from_name']);
75
 
76
  $this->WPPluginShell();
187
  switch ( $pagenow ) {
188
  case 'wp-register.php':
189
  case 'wp-login.php':
190
+ if ( !empty($this->options['general']['page_id']) ) {
191
+ $redirect_to = add_query_arg($_GET, $this->permalink);
192
+ wp_redirect($redirect_to);
193
+ exit();
194
+ }
195
  break;
196
  }
197
 
408
  function SiteURL($url, $path) {
409
  global $wp_rewrite;
410
 
411
+ if ( !empty($this->options['general']['page_id']) ) {
412
+ if ( preg_match('/wp-login.php/', $url) ) {
413
+ $parsed_url = parse_url($url);
414
+ if ( isset($parsed_url['query']) )
415
+ $url = $wp_rewrite->using_permalinks() ? $this->permalink.'?'.$parsed_url['query'] : $this->permalink.'&'.$parsed_url['query'];
416
+ else
417
+ $url = $this->permalink;
418
+ }
419
  }
420
  return $url;
421
  }