Version Description
- Added a login widget
Download this release
Release Info
Developer | jfarthing84 |
Plugin | Theme My Login |
Version | 3.0 |
Comparing to | |
See all releases |
Code changes from version 2.2 to 3.0
- includes/widget-control.php +59 -0
- includes/wp-login-actions.php +12 -6
- includes/wp-login-forms.php +19 -9
- includes/wp-login-functions.php +35 -7
- language/theme-my-login.pot +302 -0
- readme.txt +65 -23
- theme-my-login.php +78 -7
includes/widget-control.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
global $wp_roles;
|
4 |
+
$user_roles = $wp_roles->get_names();
|
5 |
+
|
6 |
+
if ( $_POST['tml_submit'] ) {
|
7 |
+
|
8 |
+
foreach ($user_roles as $role => $value) {
|
9 |
+
$dashboard_link[$role] = isset($_POST['tml_dashboard_link'][$role]) ? true : false;
|
10 |
+
$profile_link[$role] = isset($_POST['tml_profile_link'][$role]) ? true : false;
|
11 |
+
}
|
12 |
+
$this->SetOption('widget_show_logged_in', $_POST['tml_show_widget']);
|
13 |
+
$this->SetOption('widget_show_gravatar', $_POST['tml_show_gravatar']);
|
14 |
+
$this->SetOption('widget_gravatar_size', absint($_POST['tml_gravatar_size']));
|
15 |
+
$this->SetOption('widget_dashboard_link', $dashboard_link);
|
16 |
+
$this->SetOption('widget_profile_link', $profile_link);
|
17 |
+
$this->SaveOptions();
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
$show_widget = $this->GetOption('widget_show_logged_in');
|
22 |
+
$show_gravatar = $this->GetOption('widget_show_gravatar');
|
23 |
+
$dashboard_link = $this->GetOption('widget_dashboard_link');
|
24 |
+
$profile_link = $this->GetOption('widget_profile_link');
|
25 |
+
|
26 |
+
?>
|
27 |
+
|
28 |
+
<p>
|
29 |
+
<label for="tml_show_widget">Show Widget When Logged In:</label>
|
30 |
+
<select name="tml_show_widget" id="tml_show_widget"><option value="1" <?php if ($show_widget == true) echo 'selected="selected"'; ?>>Yes</option><option value="0" <?php if ($show_widget == false) echo 'selected="selected"'; ?>>No</option></select>
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<p>
|
34 |
+
<label for="tml_show_gravatar">Show Gravatar:</label>
|
35 |
+
<select name="tml_show_gravatar" id="tml_show_gravatar"><option value="1" <?php if ($show_gravatar == true) echo 'selected="selected"'; ?>>Yes</option><option value="0" <?php if ($show_gravatar == false) echo 'selected="selected"'; ?>>No</option></select>
|
36 |
+
</p>
|
37 |
+
|
38 |
+
<p>
|
39 |
+
<label for="tml_gravatar_size">Gravatar Size:</label>
|
40 |
+
<input name="tml_gravatar_size" type="text" id="tml_gravatar_size" value="<?php echo absint($this->GetOption('widget_gravatar_size')); ?>" size="2" />
|
41 |
+
</p>
|
42 |
+
|
43 |
+
<p>
|
44 |
+
<label for="tml_dashboard_link">Show Dashboard Link For:</label><br />
|
45 |
+
<?php foreach ($user_roles as $role => $value) : ?>
|
46 |
+
<input name="tml_dashboard_link[<?php echo $role; ?>]" type="checkbox" id="tml_dashboard_link[<?php echo $role; ?>]" value="1"<?php if ($dashboard_link[$role] == true) { echo 'checked="checked"'; } ?> /> <?php echo ucwords($role); ?><br />
|
47 |
+
<?php endforeach; ?>
|
48 |
+
</p>
|
49 |
+
|
50 |
+
<p>
|
51 |
+
<label for="tml_profile_link">Show Profile Link For:</label><br />
|
52 |
+
<?php foreach ($user_roles as $role => $value) : ?>
|
53 |
+
<input name="tml_profile_link[<?php echo $role; ?>]" type="checkbox" id="tml_profile_link[<?php echo $role; ?>]" value="1"<?php if ($profile_link[$role] == true) { echo 'checked="checked"'; } ?> /> <?php echo ucwords($role); ?><br />
|
54 |
+
<?php endforeach; ?>
|
55 |
+
</p>
|
56 |
+
|
57 |
+
<p>
|
58 |
+
<input type="hidden" id="tml_submit" name="tml_submit" value="1" />
|
59 |
+
</p>
|
includes/wp-login-actions.php
CHANGED
@@ -15,6 +15,7 @@ if ( force_ssl_admin() && !is_ssl() ) {
|
|
15 |
}
|
16 |
|
17 |
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
|
|
|
18 |
|
19 |
if ( isset($_GET['key']) )
|
20 |
$action = 'resetpass';
|
@@ -40,7 +41,7 @@ case 'logout' :
|
|
40 |
check_admin_referer('log-out');
|
41 |
wp_logout();
|
42 |
|
43 |
-
$redirect_to = site_url('wp-login.php?loggedout=true', 'login');
|
44 |
if ( isset( $_REQUEST['redirect_to'] ) )
|
45 |
$redirect_to = $_REQUEST['redirect_to'];
|
46 |
|
@@ -52,7 +53,8 @@ case 'retrievepassword' :
|
|
52 |
if ( $http_post ) {
|
53 |
$login_errors = retrieve_password();
|
54 |
if ( !is_wp_error($login_errors) ) {
|
55 |
-
|
|
|
56 |
exit();
|
57 |
}
|
58 |
}
|
@@ -65,16 +67,19 @@ case 'rp' :
|
|
65 |
$login_errors = reset_password($_GET['key']);
|
66 |
|
67 |
if ( ! is_wp_error($login_errors) ) {
|
68 |
-
|
|
|
69 |
exit();
|
70 |
}
|
71 |
|
72 |
-
|
|
|
73 |
exit();
|
74 |
break;
|
75 |
case 'register' :
|
76 |
if ( !get_option('users_can_register') ) {
|
77 |
-
|
|
|
78 |
exit();
|
79 |
}
|
80 |
|
@@ -86,7 +91,8 @@ case 'register' :
|
|
86 |
$login_errors = register_new_user($user_login, $user_email);
|
87 |
|
88 |
if ( !is_wp_error($login_errors) ) {
|
89 |
-
|
|
|
90 |
exit();
|
91 |
}
|
92 |
}
|
15 |
}
|
16 |
|
17 |
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
|
18 |
+
$post_from = isset($_REQUEST['post-from']) ? $_REQUEST['post-from'] : '';
|
19 |
|
20 |
if ( isset($_GET['key']) )
|
21 |
$action = 'resetpass';
|
41 |
check_admin_referer('log-out');
|
42 |
wp_logout();
|
43 |
|
44 |
+
$redirect_to = ('widget' == $post_from) ? theme_my_login_url(array('loggedout' => 'true')) : site_url('wp-login.php?loggedout=true', 'login');
|
45 |
if ( isset( $_REQUEST['redirect_to'] ) )
|
46 |
$redirect_to = $_REQUEST['redirect_to'];
|
47 |
|
53 |
if ( $http_post ) {
|
54 |
$login_errors = retrieve_password();
|
55 |
if ( !is_wp_error($login_errors) ) {
|
56 |
+
$redirect_to = ('widget' == $post_from) ? theme_my_login_url(array('checkemail' => 'confirm')) : site_url('wp-login.php?checkemail=confirm', 'login');
|
57 |
+
wp_redirect($redirect_to);
|
58 |
exit();
|
59 |
}
|
60 |
}
|
67 |
$login_errors = reset_password($_GET['key']);
|
68 |
|
69 |
if ( ! is_wp_error($login_errors) ) {
|
70 |
+
$redirect_to = ('widget' == $post_from) ? theme_my_login_url(array('checkemail' => 'newpass')) : site_url('wp-login.php?checkemail=newpass', 'login');
|
71 |
+
wp_redirect($redirect_to);
|
72 |
exit();
|
73 |
}
|
74 |
|
75 |
+
$redirect_to = ('widget' == $post_from) ? theme_my_login_url(array('action' => 'lostpassword', 'error' => 'invalidkey')) : site_url('wp-login.php?action=lostpassword&error=invalidkey', 'login');
|
76 |
+
wp_redirect($redirect_to);
|
77 |
exit();
|
78 |
break;
|
79 |
case 'register' :
|
80 |
if ( !get_option('users_can_register') ) {
|
81 |
+
$redirect_to = ('widget' == $post_from) ? theme_my_login_url(array('registration' => 'disabled')) : site_url('wp-login.php?registration=disabled', 'login');
|
82 |
+
wp_redirect($redirect_to);
|
83 |
exit();
|
84 |
}
|
85 |
|
91 |
$login_errors = register_new_user($user_login, $user_email);
|
92 |
|
93 |
if ( !is_wp_error($login_errors) ) {
|
94 |
+
$redirect_to = ('widget' == $post_from) ? theme_my_login_url(array('checkemail' => 'registered')) : site_url('wp-login.php?checkemail=registered', 'login');
|
95 |
+
wp_redirect($redirect_to);
|
96 |
exit();
|
97 |
}
|
98 |
}
|
includes/wp-login-forms.php
CHANGED
@@ -15,17 +15,21 @@ case 'retrievepassword' :
|
|
15 |
$user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';
|
16 |
?>
|
17 |
|
18 |
-
<form name="lostpasswordform" id="lostpasswordform" action="<?php echo add_query_arg('action', 'lostpassword', $this->permalink) ?>" method="post">
|
19 |
<p>
|
20 |
<label><?php _e('Username or E-mail:', 'theme-my-login') ?><br />
|
21 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape($user_login); ?>" size="20" tabindex="10" /></label>
|
22 |
</p>
|
23 |
<?php do_action('lostpassword_form'); ?>
|
24 |
-
<p class="submit"
|
|
|
|
|
|
|
|
|
25 |
</form>
|
26 |
|
27 |
<?php
|
28 |
-
login_footer();
|
29 |
break;
|
30 |
|
31 |
case 'register' :
|
@@ -34,22 +38,26 @@ case 'register' :
|
|
34 |
login_header('', $login_errors);
|
35 |
?>
|
36 |
|
37 |
-
<form name="registerform" id="registerform" action="<?php echo add_query_arg('action', 'register', $this->permalink) ?>" method="post">
|
38 |
<p>
|
39 |
<label><?php _e('Username', 'theme-my-login') ?><br />
|
40 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label>
|
41 |
</p>
|
42 |
<p>
|
43 |
<label><?php _e('E-mail', 'theme-my-login') ?><br />
|
44 |
-
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo attribute_escape(stripslashes($user_email)); ?>" size="
|
45 |
</p>
|
46 |
<?php do_action('register_form'); ?>
|
47 |
<p id="reg_passmail"><?php _e($this->GetOption('register_msg')) ?></p>
|
48 |
-
<p class="submit"
|
|
|
|
|
|
|
|
|
49 |
</form>
|
50 |
|
51 |
<?php
|
52 |
-
login_footer();
|
53 |
break;
|
54 |
|
55 |
case 'login' :
|
@@ -87,7 +95,7 @@ default :
|
|
87 |
$user_login = ( 'incorrect_password' == $login_errors->get_error_code() || 'empty_password' == $login_errors->get_error_code() ) ? attribute_escape(stripslashes($_POST['log'])) : '';
|
88 |
?>
|
89 |
<?php if ( !isset($_GET['checkemail']) || !in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
|
90 |
-
<form name="loginform" id="loginform" action="
|
91 |
<p>
|
92 |
<label><?php _e('Username', 'theme-my-login') ?><br />
|
93 |
<input type="text" name="log" id="user_login" class="input" value="<?php echo isset($user_login) ? $user_login : ''; ?>" size="20" tabindex="10" /></label>
|
@@ -99,6 +107,8 @@ default :
|
|
99 |
<?php do_action('login_form'); ?>
|
100 |
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <?php _e('Remember Me', 'theme-my-login'); ?></label></p>
|
101 |
<p class="submit">
|
|
|
|
|
102 |
<input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Log In', 'theme-my-login'); ?>" tabindex="100" />
|
103 |
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($redirect_to); ?>" />
|
104 |
<input type="hidden" name="testcookie" value="1" />
|
@@ -107,7 +117,7 @@ default :
|
|
107 |
<?php endif; ?>
|
108 |
|
109 |
<?php
|
110 |
-
login_footer();
|
111 |
break;
|
112 |
|
113 |
endswitch;
|
15 |
$user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';
|
16 |
?>
|
17 |
|
18 |
+
<form name="lostpasswordform" id="lostpasswordform" action="<?php //echo add_query_arg('action', 'lostpassword', $this->permalink) ?>" method="post">
|
19 |
<p>
|
20 |
<label><?php _e('Username or E-mail:', 'theme-my-login') ?><br />
|
21 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape($user_login); ?>" size="20" tabindex="10" /></label>
|
22 |
</p>
|
23 |
<?php do_action('lostpassword_form'); ?>
|
24 |
+
<p class="submit">
|
25 |
+
<input type="hidden" name="post-from" id="post-from" value="<?php echo $type; ?>" />
|
26 |
+
<input type="hidden" name="action" id="action" value="lostpassword" />
|
27 |
+
<input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Get New Password', 'theme-my-login'); ?>" tabindex="100" />
|
28 |
+
</p>
|
29 |
</form>
|
30 |
|
31 |
<?php
|
32 |
+
login_footer($type);
|
33 |
break;
|
34 |
|
35 |
case 'register' :
|
38 |
login_header('', $login_errors);
|
39 |
?>
|
40 |
|
41 |
+
<form name="registerform" id="registerform" action="<?php //echo add_query_arg('action', 'register', $this->permalink) ?>" method="post">
|
42 |
<p>
|
43 |
<label><?php _e('Username', 'theme-my-login') ?><br />
|
44 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label>
|
45 |
</p>
|
46 |
<p>
|
47 |
<label><?php _e('E-mail', 'theme-my-login') ?><br />
|
48 |
+
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo attribute_escape(stripslashes($user_email)); ?>" size="20" tabindex="20" /></label>
|
49 |
</p>
|
50 |
<?php do_action('register_form'); ?>
|
51 |
<p id="reg_passmail"><?php _e($this->GetOption('register_msg')) ?></p>
|
52 |
+
<p class="submit">
|
53 |
+
<input type="hidden" name="post-from" id="post-from" value="<?php echo $type; ?>" />
|
54 |
+
<input type="hidden" name="action" id="action" value="register" />
|
55 |
+
<input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Register', 'theme-my-login'); ?>" tabindex="100" />
|
56 |
+
</p>
|
57 |
</form>
|
58 |
|
59 |
<?php
|
60 |
+
login_footer($type);
|
61 |
break;
|
62 |
|
63 |
case 'login' :
|
95 |
$user_login = ( 'incorrect_password' == $login_errors->get_error_code() || 'empty_password' == $login_errors->get_error_code() ) ? attribute_escape(stripslashes($_POST['log'])) : '';
|
96 |
?>
|
97 |
<?php if ( !isset($_GET['checkemail']) || !in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
|
98 |
+
<form name="loginform" id="loginform" action="" method="post">
|
99 |
<p>
|
100 |
<label><?php _e('Username', 'theme-my-login') ?><br />
|
101 |
<input type="text" name="log" id="user_login" class="input" value="<?php echo isset($user_login) ? $user_login : ''; ?>" size="20" tabindex="10" /></label>
|
107 |
<?php do_action('login_form'); ?>
|
108 |
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <?php _e('Remember Me', 'theme-my-login'); ?></label></p>
|
109 |
<p class="submit">
|
110 |
+
<input type="hidden" name="post-from" id="post-from" value="<?php echo $type; ?>" />
|
111 |
+
<input type="hidden" name="action" id="action" value="login" />
|
112 |
<input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Log In', 'theme-my-login'); ?>" tabindex="100" />
|
113 |
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($redirect_to); ?>" />
|
114 |
<input type="hidden" name="testcookie" value="1" />
|
117 |
<?php endif; ?>
|
118 |
|
119 |
<?php
|
120 |
+
login_footer($type);
|
121 |
break;
|
122 |
|
123 |
endswitch;
|
includes/wp-login-functions.php
CHANGED
@@ -1,5 +1,27 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
if (!function_exists('login_header')) :
|
4 |
function login_header($message = '', $wp_error = '') {
|
5 |
global $error;
|
@@ -38,15 +60,21 @@ function login_header($message = '', $wp_error = '') {
|
|
38 |
endif;
|
39 |
|
40 |
if (!function_exists('login_footer')) :
|
41 |
-
function login_footer() {
|
42 |
$_GET['action'] = isset($_GET['action']) ? $_GET['action'] : 'login';
|
43 |
echo '<ul class="links">' . "\n";
|
44 |
-
if (in_array($_GET['action'], array('register', 'lostpassword')) || $_GET['action'] == 'login' && isset($_GET['checkemail']))
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
if ($_GET['action'] != '
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
echo '</ul>' . "\n";
|
51 |
echo '</div>' . "\n";
|
52 |
}
|
1 |
<?php
|
2 |
|
3 |
+
if (!function_exists('theme_my_login_url')) :
|
4 |
+
function theme_my_login_url($args = array()) {
|
5 |
+
$login_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
|
6 |
+
|
7 |
+
if ($_SERVER["SERVER_PORT"] != "80") {
|
8 |
+
$login_url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
9 |
+
} else {
|
10 |
+
$login_url .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
11 |
+
}
|
12 |
+
|
13 |
+
$keys = array('action', 'checkemail', 'error', 'loggedout', 'registered', 'redirect_to', 'updated', 'key');
|
14 |
+
$login_url = remove_query_arg($keys, $login_url);
|
15 |
+
|
16 |
+
if (!empty($args)) {
|
17 |
+
foreach ($args as $key => $value)
|
18 |
+
$login_url = add_query_arg($key, $value, $login_url);
|
19 |
+
}
|
20 |
+
|
21 |
+
return $login_url;
|
22 |
+
}
|
23 |
+
endif;
|
24 |
+
|
25 |
if (!function_exists('login_header')) :
|
26 |
function login_header($message = '', $wp_error = '') {
|
27 |
global $error;
|
60 |
endif;
|
61 |
|
62 |
if (!function_exists('login_footer')) :
|
63 |
+
function login_footer($type = 'page') {
|
64 |
$_GET['action'] = isset($_GET['action']) ? $_GET['action'] : 'login';
|
65 |
echo '<ul class="links">' . "\n";
|
66 |
+
if (in_array($_GET['action'], array('register', 'lostpassword')) || $_GET['action'] == 'login' && isset($_GET['checkemail'])) {
|
67 |
+
$url = ($type == 'widget') ? add_query_arg('action', 'login', wp_guess_url()) : site_url('wp-login.php', 'login');
|
68 |
+
echo '<li><a href="' . $url . '">' . __('Log in') . '</a></li>' . "\n";
|
69 |
+
}
|
70 |
+
if (get_option('users_can_register') && $_GET['action'] != 'register') {
|
71 |
+
$url = ($type == 'widget') ? add_query_arg('action', 'register', wp_guess_url()) : site_url('wp-login.php?action=register', 'login');
|
72 |
+
echo '<li><a href="' . $url . '">' . __('Register') . '</a></li>' . "\n";
|
73 |
+
}
|
74 |
+
if ($_GET['action'] != 'lostpassword') {
|
75 |
+
$url = ($type == 'widget') ? add_query_arg('action', 'lostpassword', wp_guess_url()) : site_url('wp-login.php?action=lostpassword', 'login');
|
76 |
+
echo '<li><a href="' . $url . '" title="' . __('Password Lost and Found') . '">' . __('Lost your password?') . '</a></li>' . "\n";
|
77 |
+
}
|
78 |
echo '</ul>' . "\n";
|
79 |
echo '</div>' . "\n";
|
80 |
}
|
language/theme-my-login.pot
ADDED
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR Jeff Farthing
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
#, fuzzy
|
7 |
+
msgid ""
|
8 |
+
msgstr ""
|
9 |
+
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/theme-my-login\n"
|
11 |
+
"POT-Creation-Date: 2009-07-02 04:02+0000\n"
|
12 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
+
"MIME-Version: 1.0\n"
|
16 |
+
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
+
"Content-Transfer-Encoding: 8bit\n"
|
18 |
+
|
19 |
+
#: includes/admin-page.php:17
|
20 |
+
msgid ""
|
21 |
+
"To complete uninstall, deactivate this plugin. If you do not wish to "
|
22 |
+
"uninstall, please uncheck the \"Complete Uninstall\" checkbox."
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: includes/admin-page.php:19
|
26 |
+
msgid "Settings saved."
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: includes/admin-page.php:25
|
30 |
+
msgid ""
|
31 |
+
"If you like this plugin, please help keep it up to date by <a href=\"http://"
|
32 |
+
"www.jfarthing.com/donate\">donating through PayPal</a>!"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: includes/admin-page.php:35
|
36 |
+
msgid "Theme My Login Settings"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: includes/admin-page.php:40
|
40 |
+
msgid "General Settings"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: includes/admin-page.php:43
|
44 |
+
msgid "Plugin"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: includes/admin-page.php:46
|
48 |
+
msgid "Uninstall"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: includes/admin-page.php:51
|
52 |
+
msgid "Template Settings"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: includes/admin-page.php:54
|
56 |
+
msgid "Register Title"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: includes/admin-page.php:60
|
60 |
+
msgid "Register Message"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: includes/admin-page.php:66
|
64 |
+
msgid "Registration Complete Message"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: includes/admin-page.php:72
|
68 |
+
msgid "Login Title"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: includes/admin-page.php:78
|
72 |
+
msgid "Lost Password Title"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
#: includes/admin-page.php:84
|
76 |
+
msgid "Lost Password Message"
|
77 |
+
msgstr ""
|
78 |
+
|
79 |
+
#: includes/admin-page.php:91
|
80 |
+
msgid "Save Changes"
|
81 |
+
msgstr ""
|
82 |
+
|
83 |
+
#: includes/compat.php:84
|
84 |
+
#, php-format
|
85 |
+
msgid "Password Lost and Changed for user: %s"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: includes/compat.php:85
|
89 |
+
#, php-format
|
90 |
+
msgid "[%s] Password Lost/Changed"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: includes/wp-login-actions.php:61
|
94 |
+
msgid "Sorry, that key does not appear to be valid."
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: includes/wp-login-forms.php:20
|
98 |
+
msgid "Username or E-mail:"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: includes/wp-login-forms.php:24
|
102 |
+
msgid "Get New Password"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: includes/wp-login-forms.php:39 includes/wp-login-forms.php:92
|
106 |
+
msgid "Username"
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: includes/wp-login-forms.php:43
|
110 |
+
msgid "E-mail"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: includes/wp-login-forms.php:48 includes/wp-login-functions.php:47
|
114 |
+
#: theme-my-login.php:89
|
115 |
+
msgid "Register"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: includes/wp-login-forms.php:75
|
119 |
+
msgid ""
|
120 |
+
"<strong>ERROR</strong>: Cookies are blocked or not supported by your "
|
121 |
+
"browser. You must <a href='http://www.google.com/cookies.html'>enable "
|
122 |
+
"cookies</a> to use WordPress."
|
123 |
+
msgstr ""
|
124 |
+
|
125 |
+
#: includes/wp-login-forms.php:78
|
126 |
+
msgid "You are now logged out."
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: includes/wp-login-forms.php:79
|
130 |
+
msgid "User registration is currently not allowed."
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: includes/wp-login-forms.php:80
|
134 |
+
msgid "Check your e-mail for the confirmation link."
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: includes/wp-login-forms.php:81
|
138 |
+
msgid "Check your e-mail for your new password."
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: includes/wp-login-forms.php:82 theme-my-login.php:91
|
142 |
+
msgid "Registration complete. Please check your e-mail."
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: includes/wp-login-forms.php:96
|
146 |
+
msgid "Password"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: includes/wp-login-forms.php:100
|
150 |
+
msgid "Remember Me"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: includes/wp-login-forms.php:102 theme-my-login.php:88
|
154 |
+
msgid "Log In"
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: includes/wp-login-functions.php:45
|
158 |
+
msgid "Log in"
|
159 |
+
msgstr ""
|
160 |
+
|
161 |
+
#: includes/wp-login-functions.php:49
|
162 |
+
msgid "Password Lost and Found"
|
163 |
+
msgstr ""
|
164 |
+
|
165 |
+
#: includes/wp-login-functions.php:49
|
166 |
+
msgid "Lost your password?"
|
167 |
+
msgstr ""
|
168 |
+
|
169 |
+
#: includes/wp-login-functions.php:62
|
170 |
+
msgid "<strong>ERROR</strong>: Enter a username or e-mail address."
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: includes/wp-login-functions.php:67
|
174 |
+
msgid ""
|
175 |
+
"<strong>ERROR</strong>: There is no user registered with that email address."
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: includes/wp-login-functions.php:79
|
179 |
+
msgid "<strong>ERROR</strong>: Invalid username or e-mail."
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: includes/wp-login-functions.php:93
|
183 |
+
msgid "Password reset is not allowed for this user"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: includes/wp-login-functions.php:105
|
187 |
+
msgid ""
|
188 |
+
"Someone has asked to reset the password for the following site and username."
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
#: includes/wp-login-functions.php:107 includes/wp-login-functions.php:136
|
192 |
+
#, php-format
|
193 |
+
msgid "Username: %s"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: includes/wp-login-functions.php:108
|
197 |
+
msgid ""
|
198 |
+
"To reset your password visit the following address, otherwise just ignore "
|
199 |
+
"this email and nothing will happen."
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#: includes/wp-login-functions.php:111
|
203 |
+
#, php-format
|
204 |
+
msgid "[%s] Password Reset"
|
205 |
+
msgstr ""
|
206 |
+
|
207 |
+
#: includes/wp-login-functions.php:112 includes/wp-login-functions.php:141
|
208 |
+
msgid "The e-mail could not be sent."
|
209 |
+
msgstr ""
|
210 |
+
|
211 |
+
#: includes/wp-login-functions.php:112 includes/wp-login-functions.php:141
|
212 |
+
msgid "Possible reason: your host may have disabled the mail() function..."
|
213 |
+
msgstr ""
|
214 |
+
|
215 |
+
#: includes/wp-login-functions.php:125 includes/wp-login-functions.php:129
|
216 |
+
msgid "Invalid key"
|
217 |
+
msgstr ""
|
218 |
+
|
219 |
+
#: includes/wp-login-functions.php:137
|
220 |
+
#, php-format
|
221 |
+
msgid "Password: %s"
|
222 |
+
msgstr ""
|
223 |
+
|
224 |
+
#: includes/wp-login-functions.php:140
|
225 |
+
#, php-format
|
226 |
+
msgid "[%s] Your new password"
|
227 |
+
msgstr ""
|
228 |
+
|
229 |
+
#: includes/wp-login-functions.php:158
|
230 |
+
msgid "<strong>ERROR</strong>: Please enter a username."
|
231 |
+
msgstr ""
|
232 |
+
|
233 |
+
#: includes/wp-login-functions.php:160
|
234 |
+
msgid ""
|
235 |
+
"<strong>ERROR</strong>: This username is invalid. Please enter a valid "
|
236 |
+
"username."
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: includes/wp-login-functions.php:163
|
240 |
+
msgid ""
|
241 |
+
"<strong>ERROR</strong>: This username is already registered, please choose "
|
242 |
+
"another one."
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: includes/wp-login-functions.php:167
|
246 |
+
msgid "<strong>ERROR</strong>: Please type your e-mail address."
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: includes/wp-login-functions.php:169
|
250 |
+
msgid "<strong>ERROR</strong>: The email address isn’t correct."
|
251 |
+
msgstr ""
|
252 |
+
|
253 |
+
#: includes/wp-login-functions.php:172
|
254 |
+
msgid ""
|
255 |
+
"<strong>ERROR</strong>: This email is already registered, please choose "
|
256 |
+
"another one."
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: includes/wp-login-functions.php:184
|
260 |
+
#, php-format
|
261 |
+
msgid ""
|
262 |
+
"<strong>ERROR</strong>: Couldn’t register you... please contact the <a "
|
263 |
+
"href=\"mailto:%s\">webmaster</a> !"
|
264 |
+
msgstr ""
|
265 |
+
|
266 |
+
#: theme-my-login.php:90
|
267 |
+
msgid "A password will be e-mailed to you."
|
268 |
+
msgstr ""
|
269 |
+
|
270 |
+
#: theme-my-login.php:92
|
271 |
+
msgid "Lost Password"
|
272 |
+
msgstr ""
|
273 |
+
|
274 |
+
#: theme-my-login.php:93
|
275 |
+
msgid ""
|
276 |
+
"Please enter your username or e-mail address. You will receive a new "
|
277 |
+
"password via e-mail."
|
278 |
+
msgstr ""
|
279 |
+
|
280 |
+
#. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
|
281 |
+
#. Plugin Name of an extension
|
282 |
+
#: theme-my-login.php:126
|
283 |
+
msgid "Theme My Login"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#. Plugin URI of an extension
|
287 |
+
msgid "http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin"
|
288 |
+
msgstr ""
|
289 |
+
|
290 |
+
#. Description of an extension
|
291 |
+
msgid ""
|
292 |
+
"Themes the WordPress login, registration and forgot password pages according "
|
293 |
+
"to your theme."
|
294 |
+
msgstr ""
|
295 |
+
|
296 |
+
#. Author of an extension
|
297 |
+
msgid "Jeff Farthing"
|
298 |
+
msgstr ""
|
299 |
+
|
300 |
+
#. Author URI of an extension
|
301 |
+
msgid "http://www.jfarthing.com"
|
302 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -1,39 +1,81 @@
|
|
1 |
=== Theme My Login ===
|
2 |
Contributors: jfarthing84
|
3 |
Donate link: http://www.jfarthing.com/donate
|
4 |
-
Tags:
|
5 |
Requires at least: 2.5
|
6 |
-
Tested up to: 2.8
|
7 |
-
Stable tag:
|
8 |
|
9 |
Themes the WordPress login pages according to your theme.
|
10 |
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
This plugin themes the WordPress login, registration and forgot password pages according to your current theme. It replaces the wp-login.php and profile.php by using a page template from your theme.
|
|
|
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.
|
19 |
|
20 |
|
21 |
-
==
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
*
|
30 |
-
|
31 |
-
|
32 |
-
*
|
33 |
-
|
34 |
-
|
35 |
-
*
|
36 |
-
|
37 |
-
|
38 |
-
*
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
=== Theme My Login ===
|
2 |
Contributors: jfarthing84
|
3 |
Donate link: http://www.jfarthing.com/donate
|
4 |
+
Tags: widget, login, registration, theme, custom, log in, register, sidebar
|
5 |
Requires at least: 2.5
|
6 |
+
Tested up to: 2.8.1
|
7 |
+
Stable tag: trunk
|
8 |
|
9 |
Themes the WordPress login pages according to your theme.
|
10 |
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
This plugin themes the WordPress login, registration and forgot password pages according to your current theme. It replaces the wp-login.php and profile.php by using a page template from your theme. Also includes a widget for sidebar login.
|
15 |
+
|
16 |
|
17 |
== Installation ==
|
18 |
|
19 |
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.
|
20 |
|
21 |
|
22 |
+
== Frequently Asked Questions ==
|
23 |
+
|
24 |
+
None yet. Please visit http://www.jfarthing.com/forum for any support!
|
25 |
+
|
26 |
+
|
27 |
+
== Changelog ==
|
28 |
+
|
29 |
+
= 3.0 =
|
30 |
+
* Added a login widget
|
31 |
+
|
32 |
+
= 2.2 =
|
33 |
+
* Removed all "bloatware"
|
34 |
+
|
35 |
+
= 2.1 =
|
36 |
+
* Implemented login redirection based on user role
|
37 |
+
|
38 |
+
= 2.0.8 =
|
39 |
+
* Fixed a bug that broke the login with permalinks
|
40 |
+
|
41 |
+
= 2.0.7 =
|
42 |
+
* Fixed a bug that broke the Featured Content plugin
|
43 |
+
|
44 |
+
= 2.0.6 =
|
45 |
+
* Added the option to turn on/off subscriber profile theming
|
46 |
+
|
47 |
+
= 2.0.5 =
|
48 |
+
* Fixed a bug with default redirection and hid the login form from logged in users
|
49 |
+
|
50 |
+
= 2.0.4 =
|
51 |
+
* Fixed a bug regarding relative URL's in redirection
|
52 |
+
|
53 |
+
= 2.0.3 =
|
54 |
+
* Fixed various reported bugs and cleaned up code
|
55 |
+
|
56 |
+
= 2.0.2 =
|
57 |
+
* Fixed a bug that broke registration and broke other plugins using the_content filter
|
58 |
+
|
59 |
+
= 2.0.1 =
|
60 |
+
* Fixed a bug that redirected users who were not yet logged in to profile page
|
61 |
+
|
62 |
+
= 2.0 =
|
63 |
+
* Completely rewrote plugin to use page template, no more specifying template files & HTML
|
64 |
+
|
65 |
+
= 1.2 =
|
66 |
+
* Added capability to customize page titles for all pages affected by plugin
|
67 |
+
|
68 |
+
= 1.1.2 =
|
69 |
+
* Updated to allow customization of text below registration form
|
70 |
+
|
71 |
+
= 1.1.1 =
|
72 |
+
* Prepared plugin for internationalization and fixed a PHP version bug
|
73 |
+
|
74 |
+
= 1.1.0 =
|
75 |
+
* Added custom profile to completely hide the back-end from subscribers
|
76 |
+
|
77 |
+
= 1.0.1 =
|
78 |
+
* Made backwards compatible to WordPress 2.5+
|
79 |
+
|
80 |
+
= 1.0.0 =
|
81 |
+
* Initial release version
|
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:
|
7 |
Author: Jae Dub
|
8 |
Author URI: http://www.jfarthing.com
|
9 |
*/
|
@@ -26,7 +26,7 @@ if ($wp_version < '2.6') {
|
|
26 |
if (!class_exists('ThemeMyLogin')) {
|
27 |
class ThemeMyLogin {
|
28 |
|
29 |
-
var $version = '
|
30 |
var $options = array();
|
31 |
var $permalink = '';
|
32 |
|
@@ -44,6 +44,7 @@ if (!class_exists('ThemeMyLogin')) {
|
|
44 |
add_action('admin_menu', array(&$this, 'AddAdminPage'));
|
45 |
add_action('init', array(&$this, 'Init'));
|
46 |
add_action('parse_request', array(&$this, 'ParseRequest'));
|
|
|
47 |
|
48 |
add_filter('wp_head', array(&$this, 'WPHead'));
|
49 |
add_filter('wp_title', array(&$this, 'WPTitle'));
|
@@ -91,6 +92,13 @@ if (!class_exists('ThemeMyLogin')) {
|
|
91 |
$this->options['register_complete'] = __('Registration complete. Please check your e-mail.', 'theme-my-login');
|
92 |
$this->options['password_title'] = __('Lost Password', 'theme-my-login');
|
93 |
$this->options['password_msg'] = __('Please enter your username or e-mail address. You will receive a new password via e-mail.', 'theme-my-login');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
|
96 |
function LoadOptions() {
|
@@ -137,9 +145,13 @@ if (!class_exists('ThemeMyLogin')) {
|
|
137 |
$pagename = isset($wp->query_vars['pagename']) ? $wp->query_vars['pagename'] : '';
|
138 |
|
139 |
if ( isset($page_id) && $page_id == $this->GetOption('page_id') || isset($pagename) && strtolower($pagename) == 'login' ) {
|
140 |
-
|
141 |
-
|
|
|
|
|
142 |
}
|
|
|
|
|
143 |
}
|
144 |
|
145 |
function Init() {
|
@@ -151,7 +163,7 @@ if (!class_exists('ThemeMyLogin')) {
|
|
151 |
case 'wp-register.php':
|
152 |
case 'wp-login.php':
|
153 |
$redirect_to = admin_url();
|
154 |
-
|
155 |
exit;
|
156 |
break;
|
157 |
}
|
@@ -159,12 +171,12 @@ if (!class_exists('ThemeMyLogin')) {
|
|
159 |
|
160 |
function TheContent($content) {
|
161 |
if (strpos($content, '[theme-my-login]') !== false)
|
162 |
-
return $this->DisplayLogin();
|
163 |
else
|
164 |
return $content;
|
165 |
}
|
166 |
|
167 |
-
function DisplayLogin() {
|
168 |
global $login_errors;
|
169 |
|
170 |
require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-forms.php');
|
@@ -240,6 +252,65 @@ if (!class_exists('ThemeMyLogin')) {
|
|
240 |
}
|
241 |
return $url;
|
242 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
}
|
244 |
}
|
245 |
|
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: 3.0
|
7 |
Author: Jae Dub
|
8 |
Author URI: http://www.jfarthing.com
|
9 |
*/
|
26 |
if (!class_exists('ThemeMyLogin')) {
|
27 |
class ThemeMyLogin {
|
28 |
|
29 |
+
var $version = '3.0';
|
30 |
var $options = array();
|
31 |
var $permalink = '';
|
32 |
|
44 |
add_action('admin_menu', array(&$this, 'AddAdminPage'));
|
45 |
add_action('init', array(&$this, 'Init'));
|
46 |
add_action('parse_request', array(&$this, 'ParseRequest'));
|
47 |
+
add_action('plugins_loaded', array(&$this, 'PluginsLoaded'));
|
48 |
|
49 |
add_filter('wp_head', array(&$this, 'WPHead'));
|
50 |
add_filter('wp_title', array(&$this, 'WPTitle'));
|
92 |
$this->options['register_complete'] = __('Registration complete. Please check your e-mail.', 'theme-my-login');
|
93 |
$this->options['password_title'] = __('Lost Password', 'theme-my-login');
|
94 |
$this->options['password_msg'] = __('Please enter your username or e-mail address. You will receive a new password via e-mail.', 'theme-my-login');
|
95 |
+
|
96 |
+
// Widget options
|
97 |
+
$this->options['widget_show_logged_in'] = 1;
|
98 |
+
$this->options['widget_show_gravatar'] = 1;
|
99 |
+
$this->options['widget_gravatar_size'] = 50;
|
100 |
+
$this->options['widget_dashboard_link'] = array('subscriber' => 1, 'contributor' => 1, 'author' => 1, 'editor' => 1, 'administrator' => 1);
|
101 |
+
$this->options['widget_profile_link'] = array('subscriber' => 1, 'contributor' => 1, 'author' => 1, 'editor' => 1, 'administrator' => 1);
|
102 |
}
|
103 |
|
104 |
function LoadOptions() {
|
145 |
$pagename = isset($wp->query_vars['pagename']) ? $wp->query_vars['pagename'] : '';
|
146 |
|
147 |
if ( isset($page_id) && $page_id == $this->GetOption('page_id') || isset($pagename) && strtolower($pagename) == 'login' ) {
|
148 |
+
if ( is_user_logged_in() && 'logout' != $_GET['action'] ) {
|
149 |
+
wp_redirect(get_bloginfo('home'));
|
150 |
+
exit;
|
151 |
+
}
|
152 |
}
|
153 |
+
$login_errors = new WP_Error();
|
154 |
+
require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-actions.php');
|
155 |
}
|
156 |
|
157 |
function Init() {
|
163 |
case 'wp-register.php':
|
164 |
case 'wp-login.php':
|
165 |
$redirect_to = admin_url();
|
166 |
+
wp_redirect($redirect_to);
|
167 |
exit;
|
168 |
break;
|
169 |
}
|
171 |
|
172 |
function TheContent($content) {
|
173 |
if (strpos($content, '[theme-my-login]') !== false)
|
174 |
+
return str_replace('[theme-my-login]', $this->DisplayLogin(), $content);
|
175 |
else
|
176 |
return $content;
|
177 |
}
|
178 |
|
179 |
+
function DisplayLogin($type = 'page') {
|
180 |
global $login_errors;
|
181 |
|
182 |
require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-forms.php');
|
252 |
}
|
253 |
return $url;
|
254 |
}
|
255 |
+
|
256 |
+
function PluginsLoaded() {
|
257 |
+
wp_register_sidebar_widget('theme-my-login', 'Theme My Login', array(&$this, 'Widget'), array('description' => 'A login form for your blog'));
|
258 |
+
wp_register_widget_control('theme-my-login', 'Theme My Login', array(&$this, 'WidgetControl'));
|
259 |
+
}
|
260 |
+
|
261 |
+
function Widget($args) {
|
262 |
+
global $user_ID, $current_user, $login_errors;
|
263 |
+
|
264 |
+
get_currentuserinfo();
|
265 |
+
|
266 |
+
extract ($args);
|
267 |
+
|
268 |
+
if (!is_page($this->GetOption('page_id'))) :
|
269 |
+
if ($user_ID != '' && $this->GetOption('widget_show_logged_in')) {
|
270 |
+
$user_role = $current_user->roles[0];
|
271 |
+
$dashboard_link = $this->GetOption('widget_dashboard_link');
|
272 |
+
$profile_link = $this->GetOption('widget_profile_link');
|
273 |
+
echo $before_widget . $before_title . __('Welcome', 'theme-my-login') . ', ' . $current_user->display_name . $after_title . "\n";
|
274 |
+
if ($this->GetOption('widget_show_gravatar') == true) :
|
275 |
+
echo '<div class="theme-my-login-avatar">' . get_avatar( $user_ID, $size = $this->GetOption('widget_gravatar_size') ) . '</div>' . "\n";
|
276 |
+
endif;
|
277 |
+
do_action('theme_my_login_avatar', $current_user);
|
278 |
+
echo '<ul class="theme-my-login-links">' . "\n";
|
279 |
+
if ($dashboard_link[$user_role] == true) :
|
280 |
+
echo '<li><a href="' . admin_url() . '">' . __('Dashboard', 'theme-my-login') . '</a></li>' . "\n";
|
281 |
+
endif;
|
282 |
+
if ($profile_link[$user_role] == true) :
|
283 |
+
echo '<li><a href="' . admin_url('profile.php') . '">' . __('Profile', 'theme-my-login') . '</a></li>' . "\n";
|
284 |
+
endif;
|
285 |
+
do_action('theme_my_login_links', $user_role);
|
286 |
+
echo '<li><a href="' . wp_logout_url(wp_guess_url()) . '">' . __('Logout', 'theme-my-login') . '</a></li>' . "\n";
|
287 |
+
echo '</ul>' . "\n";
|
288 |
+
} elseif (empty($user_ID)) {
|
289 |
+
switch ($_GET['action']) {
|
290 |
+
case 'register':
|
291 |
+
$title = $this->GetOption('register_title');
|
292 |
+
break;
|
293 |
+
case 'lostpassword':
|
294 |
+
case 'retrievepassword':
|
295 |
+
case 'resetpass':
|
296 |
+
case 'rp':
|
297 |
+
$title = $this->GetOption('password_title');
|
298 |
+
break;
|
299 |
+
case 'login':
|
300 |
+
default:
|
301 |
+
$title = $this->GetOption('login_title');
|
302 |
+
break;
|
303 |
+
}
|
304 |
+
echo $before_widget . $before_title . $title . $after_title . "\n";
|
305 |
+
$this->DisplayLogin('widget');
|
306 |
+
}
|
307 |
+
echo $after_widget;
|
308 |
+
endif;
|
309 |
+
}
|
310 |
+
|
311 |
+
function WidgetControl() {
|
312 |
+
require (WP_PLUGIN_DIR . '/theme-my-login/includes/widget-control.php');
|
313 |
+
}
|
314 |
}
|
315 |
}
|
316 |
|