Login With Ajax - Version 2.1

Version Description

  • Added translation POT files.
  • Spanish translation (quick/poor attempt on my part, just to get things going)
  • Fixed result bug on [http://netweblogic.com/forums/topic/undefined-error-on-logging-in-with-wp-29]
  • Fixed bug on [http://wordpress.org/support/topic/355406]
Download this release

Release Info

Developer netweblogic
Plugin Icon 128x128 Login With Ajax
Version 2.1
Comparing to
See all releases

Code changes from version 2.0.4 to 2.1

langs/login-with-ajax-es_ES.mo ADDED
Binary file
langs/login-with-ajax-es_ES.pot ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translation of the WordPress plugin Login With Ajax 2.0.4 by NetWebLogic.
2
+ # Copyright (C) 2010 NetWebLogic
3
+ # This file is distributed under the same license as the Login With Ajax package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: Login With Ajax 2.0.4\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/login-with-ajax\n"
10
+ "POT-Creation-Date: 2010-02-10 13:35+0000\n"
11
+ "PO-Revision-Date: 2010-02-10 14:43+0100\n"
12
+ "Last-Translator: Marcus Sykes <marcus@netweblogic.com>\n"
13
+ "Language-Team: \n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+
18
+ #: login-with-ajax-admin.php:67
19
+ msgid "Changes saved."
20
+ msgstr "Cambios Guardado"
21
+
22
+ #: login-with-ajax-admin.php:71
23
+ msgid "There were issues when saving your settings. Please try again."
24
+ msgstr "Hube problemas guardando sus preferencias. Intentalo denuevo por favor."
25
+
26
+ #: login-with-ajax-admin.php:99
27
+ msgid "Global Login Redirect"
28
+ msgstr "Desvio Despues de Login"
29
+
30
+ #: login-with-ajax-admin.php:103
31
+ msgid "If you'd like to send the user to a specific URL after login, enter it here (e.g. http://wordpress.org/)"
32
+ msgstr "Si quieres mandar el usario a un enlace especial despues del login, ponelo aquie (e.g. http://wordpress.org)"
33
+
34
+ #: login-with-ajax-admin.php:108
35
+ msgid "Global Logout Redirect"
36
+ msgstr "Desvio Despues de Logout"
37
+
38
+ #: login-with-ajax-admin.php:112
39
+ msgid "If you'd like to send the user to a specific URL after logout, enter it here (e.g. http://wordpress.org/)"
40
+ msgstr "Si quieres mandar el usario a un enlace especial despues del logout, ponelo aquie (e.g. http://wordpress.org)"
41
+
42
+ #: login-with-ajax-admin.php:117
43
+ msgid "Role-Based Custom Login Redirects"
44
+ msgstr "Desvios de Login por Tipo de Usario"
45
+
46
+ #: login-with-ajax-admin.php:120
47
+ msgid "If you would like a specific user role to be redirected to a custom URL upon login, place it here (blank value will default to the global redirect)"
48
+ msgstr "Si quieres mandar tipos de usarios a enlace diferentes despues del login, ponelo aquie (e.g. http://wordpress.org)"
49
+
50
+ #: login-with-ajax-admin.php:140
51
+ msgid "Role-Based Custom Logout Redirects"
52
+ msgstr "Desvios de Logout por Tipo de Usario"
53
+
54
+ #: login-with-ajax-admin.php:143
55
+ msgid "If you would like a specific user role to be redirected to a custom URL upon logout, place it here (blank value will default to the global redirect)"
56
+ msgstr "Si quieres mandar tipos de usarios a enlace diferentes despues del logout, ponelo aquie (e.g. http://wordpress.org)"
57
+
58
+ #: login-with-ajax-admin.php:167
59
+ msgid "Save Changes"
60
+ msgstr "Guardar Cambios"
61
+
62
+ #: login-with-ajax-widget.php:5
63
+ msgid "Login widget with AJAX capabilities."
64
+ msgstr "Widget de Login con capacidad de AJAX"
65
+
66
+ #: login-with-ajax-widget.php:25
67
+ msgid "Show profile link?"
68
+ msgstr "Mostrar enlace al perfil de usario?"
69
+
70
+ #: login-with-ajax.php:126
71
+ #: login-with-ajax.php:148
72
+ msgid "An undefined error has ocurred"
73
+ msgstr "A occurido un error"
74
+
75
+ #: widget/widget_in.php:11
76
+ msgid "Hi"
77
+ msgstr "Hola"
78
+
79
+ #: widget/widget_in.php:34
80
+ msgid "Profile"
81
+ msgstr "Perfil"
82
+
83
+ #: widget/widget_in.php:40
84
+ #: widget/widget_in.php:44
85
+ msgid "Log Out"
86
+ msgstr "Desconectar"
87
+
88
+ #: widget/widget_in.php:51
89
+ msgid "blog admin"
90
+ msgstr "Gestion de Blog"
91
+
92
+ #: widget/widget_out.php:10
93
+ #: widget/widget_out.php:35
94
+ msgid "Log In"
95
+ msgstr "Entrar"
96
+
97
+ #: widget/widget_out.php:19
98
+ msgid "Username"
99
+ msgstr "Usario"
100
+
101
+ #: widget/widget_out.php:27
102
+ msgid "Password"
103
+ msgstr "Contraseña"
104
+
105
+ #: widget/widget_out.php:41
106
+ msgid "Remember Me"
107
+ msgstr "Acuerda"
108
+
109
+ #: widget/widget_out.php:43
110
+ msgid "Password Lost and Found"
111
+ msgstr ""
112
+
113
+ #: widget/widget_out.php:43
114
+ msgid "Lost your password?"
115
+ msgstr ""
116
+
117
+ # Translated by WP
118
+ #: widget/widget_out.php:52
119
+ #: widget/widget_out.php:56
120
+ msgid "Register"
121
+ msgstr ""
122
+
123
+ # Translated by WP
124
+ #: widget/widget_out.php:62
125
+ msgid "Sign Up"
126
+ msgstr ""
127
+
128
+ #: widget/widget_out.php:74
129
+ msgid "Forgotten Password"
130
+ msgstr "Contraseña Olvidado"
131
+
132
+ #: widget/widget_out.php:79
133
+ msgid "Enter username or email"
134
+ msgstr "Indique nombre de usario o email"
135
+
136
+ #: widget/widget_out.php:85
137
+ msgid "Get New Password"
138
+ msgstr "Obtener nueva contraseña"
139
+
140
+ #. Plugin Name of an extension
141
+ msgid "Login With Ajax"
142
+ msgstr ""
143
+
144
+ #. Plugin URI of an extension
145
+ msgid "http://netweblogic.com/wordpress/plugins/login-with-ajax/"
146
+ msgstr ""
147
+
148
+ #. Description of an extension
149
+ msgid "Ajax driven login widget. Customisable from within your template folder, and advanced settings from the admin area."
150
+ msgstr "Widget para login con AJAX. Puedes modificarlo dentro de la carpeta de tu tema, y dentro de la area de gestión."
151
+
152
+ #. Author of an extension
153
+ msgid "NetWebLogic"
154
+ msgstr ""
155
+
156
+ #. Author URI of an extension
157
+ msgid "http://netweblogic.com/"
158
+ msgstr ""
159
+
160
+ #. Tags of an extension
161
+ msgid "Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget"
162
+ msgstr ""
163
+
langs/login-with-ajax.pot ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translation of the WordPress plugin Login With Ajax 2.0.4 by NetWebLogic.
2
+ # Copyright (C) 2010 NetWebLogic
3
+ # This file is distributed under the same license as the Login With Ajax package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: Login With Ajax 2.0.4\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/login-with-ajax\n"
10
+ "POT-Creation-Date: 2010-02-10 13:35+0000\n"
11
+ "PO-Revision-Date: 2010-02-10 14:38+0100\n"
12
+ "Last-Translator: Marcus Sykes <marcus@netweblogic.com>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=utf-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+
18
+ # Translated by WP
19
+ #: login-with-ajax-admin.php:67
20
+ msgid "Changes saved."
21
+ msgstr ""
22
+
23
+ #: login-with-ajax-admin.php:71
24
+ msgid "There were issues when saving your settings. Please try again."
25
+ msgstr ""
26
+
27
+ #: login-with-ajax-admin.php:99
28
+ msgid "Global Login Redirect"
29
+ msgstr ""
30
+
31
+ #: login-with-ajax-admin.php:103
32
+ msgid "If you'd like to send the user to a specific URL after login, enter it here (e.g. http://wordpress.org/)"
33
+ msgstr ""
34
+
35
+ #: login-with-ajax-admin.php:108
36
+ msgid "Global Logout Redirect"
37
+ msgstr ""
38
+
39
+ #: login-with-ajax-admin.php:112
40
+ msgid "If you'd like to send the user to a specific URL after logout, enter it here (e.g. http://wordpress.org/)"
41
+ msgstr ""
42
+
43
+ #: login-with-ajax-admin.php:117
44
+ msgid "Role-Based Custom Login Redirects"
45
+ msgstr ""
46
+
47
+ #: login-with-ajax-admin.php:120
48
+ msgid "If you would like a specific user role to be redirected to a custom URL upon login, place it here (blank value will default to the global redirect)"
49
+ msgstr ""
50
+
51
+ #: login-with-ajax-admin.php:140
52
+ msgid "Role-Based Custom Logout Redirects"
53
+ msgstr ""
54
+
55
+ #: login-with-ajax-admin.php:143
56
+ msgid "If you would like a specific user role to be redirected to a custom URL upon logout, place it here (blank value will default to the global redirect)"
57
+ msgstr ""
58
+
59
+ # Translated by WP
60
+ #: login-with-ajax-admin.php:167
61
+ msgid "Save Changes"
62
+ msgstr ""
63
+
64
+ #: login-with-ajax-widget.php:5
65
+ msgid "Login widget with AJAX capabilities."
66
+ msgstr ""
67
+
68
+ #: login-with-ajax-widget.php:25
69
+ msgid "Show profile link?"
70
+ msgstr ""
71
+
72
+ #: login-with-ajax.php:126
73
+ #: login-with-ajax.php:148
74
+ msgid "An undefined error has ocurred"
75
+ msgstr ""
76
+
77
+ #: widget/widget_in.php:11
78
+ msgid "Hi"
79
+ msgstr ""
80
+
81
+ # Translated by WP
82
+ #: widget/widget_in.php:34
83
+ msgid "Profile"
84
+ msgstr ""
85
+
86
+ # Translated by WP
87
+ #: widget/widget_in.php:40
88
+ #: widget/widget_in.php:44
89
+ msgid "Log Out"
90
+ msgstr ""
91
+
92
+ #: widget/widget_in.php:51
93
+ msgid "blog admin"
94
+ msgstr ""
95
+
96
+ # Translated by WP
97
+ #: widget/widget_out.php:10
98
+ #: widget/widget_out.php:35
99
+ msgid "Log In"
100
+ msgstr ""
101
+
102
+ # Translated by WP
103
+ #: widget/widget_out.php:19
104
+ msgid "Username"
105
+ msgstr ""
106
+
107
+ # Translated by WP
108
+ #: widget/widget_out.php:27
109
+ msgid "Password"
110
+ msgstr ""
111
+
112
+ # Translated by WP
113
+ #: widget/widget_out.php:41
114
+ msgid "Remember Me"
115
+ msgstr ""
116
+
117
+ #: widget/widget_out.php:43
118
+ msgid "Password Lost and Found"
119
+ msgstr ""
120
+
121
+ #: widget/widget_out.php:43
122
+ msgid "Lost your password?"
123
+ msgstr ""
124
+
125
+ # Translated by WP
126
+ #: widget/widget_out.php:52
127
+ #: widget/widget_out.php:56
128
+ msgid "Register"
129
+ msgstr ""
130
+
131
+ # Translated by WP
132
+ #: widget/widget_out.php:62
133
+ msgid "Sign Up"
134
+ msgstr ""
135
+
136
+ #: widget/widget_out.php:74
137
+ msgid "Forgotten Password"
138
+ msgstr ""
139
+
140
+ #: widget/widget_out.php:79
141
+ msgid "Enter username or email"
142
+ msgstr ""
143
+
144
+ #: widget/widget_out.php:85
145
+ msgid "Get New Password"
146
+ msgstr ""
147
+
148
+ #. Plugin Name of an extension
149
+ msgid "Login With Ajax"
150
+ msgstr ""
151
+
152
+ #. Plugin URI of an extension
153
+ msgid "http://netweblogic.com/wordpress/plugins/login-with-ajax/"
154
+ msgstr ""
155
+
156
+ #. Description of an extension
157
+ msgid "Ajax driven login widget. Customisable from within your template folder, and advanced settings from the admin area."
158
+ msgstr ""
159
+
160
+ #. Author of an extension
161
+ msgid "NetWebLogic"
162
+ msgstr ""
163
+
164
+ #. Author URI of an extension
165
+ msgid "http://netweblogic.com/"
166
+ msgstr ""
167
+
168
+ #. Tags of an extension
169
+ msgid "Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget"
170
+ msgstr ""
171
+
login-with-ajax-admin.php CHANGED
@@ -64,11 +64,11 @@ class LoginWithAjaxAdmin{
64
  }
65
  update_option('lwa_data', $lwa_data);
66
  ?>
67
- <div class="updated"><p><strong><?php _e('Options saved.'); ?></strong></p></div>
68
  <?php
69
  }else{
70
  ?>
71
- <div class="error"><p><strong><?php _e('There were issues when saving your settings. Please try again.'); ?></strong></p></div>
72
  <?php
73
  }
74
  }else{
@@ -91,33 +91,34 @@ class LoginWithAjaxAdmin{
91
  </div>
92
  <div id="post-body">
93
  <div id="post-body-content">
 
94
  <p>If you have any suggestions, come over to our plugin page and leave a comment. It may just happen!</p>
95
  <table class="form-table">
96
  <tbody id="lwa-body">
97
  <tr valign="top">
98
  <td scope="row">
99
- <label>Global Login Redirect</label>
100
  </td>
101
  <td>
102
  <input type="text" name="lwa_login_redirect" value='<?php echo $lwa_data['login_redirect'] ?>' class='wide' />
103
- <i>If you'd like to send the user to a specific URL after login, enter it here (e.g. http://wordpress.org/)</i>
104
  </td>
105
  </tr>
106
  <tr valign="top">
107
  <td scope="row">
108
- <label>Global Logout Redirect</label>
109
  </td>
110
  <td>
111
  <input type="text" name="lwa_logout_redirect" value='<?php echo $lwa_data['logout_redirect'] ?>' class='wide' />
112
- <i>If you'd like to send the user to a specific URL after logout, enter it here (e.g. http://wordpress.org/)</i>
113
  </td>
114
  </tr>
115
  <tr valign="top">
116
  <td scope="row">
117
- <label>Role-Based Custom Login Redirects</label>
118
  </td>
119
  <td>
120
- <i>If you would like a specific user role to be redirected to a custom URL upon login, place it here (blank value will default to the global redirect)</i>
121
  <table>
122
  <?php
123
  //Taken from /wp-admin/includes/template.php Line 2715
@@ -137,10 +138,10 @@ class LoginWithAjaxAdmin{
137
  </tr>
138
  <tr valign="top">
139
  <td scope="row">
140
- <label>Role-Based Custom Logout Redirects</label>
141
  </td>
142
  <td>
143
- <i>If you would like a specific user role to be redirected to a custom URL upon logout, place it here (blank value will default to the global redirect)</i>
144
  <table>
145
  <?php
146
  //Taken from /wp-admin/includes/template.php Line 2715
64
  }
65
  update_option('lwa_data', $lwa_data);
66
  ?>
67
+ <div class="updated"><p><strong><?php _e('Changes saved.'); ?></strong></p></div>
68
  <?php
69
  }else{
70
  ?>
71
+ <div class="error"><p><strong><?php _e('There were issues when saving your settings. Please try again.', 'login-with-ajax'); ?></strong></p></div>
72
  <?php
73
  }
74
  }else{
91
  </div>
92
  <div id="post-body">
93
  <div id="post-body-content">
94
+ <p class="updated">Calling all translators! If you'd like to translate this plugin, the language files are in the langs folder. Please email any translations to wp.plugins@netweblogic.com and we'll incorporate it into the plugin.</p>
95
  <p>If you have any suggestions, come over to our plugin page and leave a comment. It may just happen!</p>
96
  <table class="form-table">
97
  <tbody id="lwa-body">
98
  <tr valign="top">
99
  <td scope="row">
100
+ <label><?php _e("Global Login Redirect", 'login-with-ajax'); ?></label>
101
  </td>
102
  <td>
103
  <input type="text" name="lwa_login_redirect" value='<?php echo $lwa_data['login_redirect'] ?>' class='wide' />
104
+ <i><?php _e("If you'd like to send the user to a specific URL after login, enter it here (e.g. http://wordpress.org/)", 'login-with-ajax'); ?></i>
105
  </td>
106
  </tr>
107
  <tr valign="top">
108
  <td scope="row">
109
+ <label><?php _e("Global Logout Redirect", 'login-with-ajax'); ?></label>
110
  </td>
111
  <td>
112
  <input type="text" name="lwa_logout_redirect" value='<?php echo $lwa_data['logout_redirect'] ?>' class='wide' />
113
+ <i><?php _e("If you'd like to send the user to a specific URL after logout, enter it here (e.g. http://wordpress.org/)", 'login-with-ajax'); ?></i>
114
  </td>
115
  </tr>
116
  <tr valign="top">
117
  <td scope="row">
118
+ <label><?php _e("Role-Based Custom Login Redirects", 'login-with-ajax'); ?></label>
119
  </td>
120
  <td>
121
+ <i><?php _e("If you would like a specific user role to be redirected to a custom URL upon login, place it here (blank value will default to the global redirect)", 'login-with-ajax'); ?></i>
122
  <table>
123
  <?php
124
  //Taken from /wp-admin/includes/template.php Line 2715
138
  </tr>
139
  <tr valign="top">
140
  <td scope="row">
141
+ <label><?php _e("Role-Based Custom Logout Redirects", 'login-with-ajax'); ?></label>
142
  </td>
143
  <td>
144
+ <i><?php _e("If you would like a specific user role to be redirected to a custom URL upon logout, place it here (blank value will default to the global redirect)", 'login-with-ajax'); ?></i>
145
  <table>
146
  <?php
147
  //Taken from /wp-admin/includes/template.php Line 2715
login-with-ajax-widget.php CHANGED
@@ -2,7 +2,7 @@
2
  class LoginWithAjaxWidget extends WP_Widget {
3
  /** constructor */
4
  function LoginWithAjaxWidget() {
5
- $widget_ops = array('description' => __( "Login widget with AJAX capabilities.") );
6
  parent::WP_Widget(false, $name = 'Login With Ajax', $widget_ops);
7
  }
8
 
@@ -22,7 +22,7 @@ class LoginWithAjaxWidget extends WP_Widget {
22
  $profile_link = $instance['profile_link'];
23
  ?>
24
  <p>
25
- <label for="<?php echo $this->get_field_id('profile_link'); ?>"><?php _e('Show profile link?'); ?> </label>
26
  <input id="<?php echo $this->get_field_id('profile_link'); ?>" name="<?php echo $this->get_field_name('profile_link'); ?>" type="checkbox" value="1" <?php echo ($profile_link) ? 'checked="checked"':""; ?> />
27
  </p>
28
  <?php
2
  class LoginWithAjaxWidget extends WP_Widget {
3
  /** constructor */
4
  function LoginWithAjaxWidget() {
5
+ $widget_ops = array('description' => __( "Login widget with AJAX capabilities.", 'login-with-ajax') );
6
  parent::WP_Widget(false, $name = 'Login With Ajax', $widget_ops);
7
  }
8
 
22
  $profile_link = $instance['profile_link'];
23
  ?>
24
  <p>
25
+ <label for="<?php echo $this->get_field_id('profile_link'); ?>"><?php _e('Show profile link?', 'login-with-ajax'); ?> </label>
26
  <input id="<?php echo $this->get_field_id('profile_link'); ?>" name="<?php echo $this->get_field_name('profile_link'); ?>" type="checkbox" value="1" <?php echo ($profile_link) ? 'checked="checked"':""; ?> />
27
  </p>
28
  <?php
login-with-ajax.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Login With Ajax
4
  Plugin URI: http://netweblogic.com/wordpress/plugins/login-with-ajax/
5
  Description: Ajax driven login widget. Customisable from within your template folder, and advanced settings from the admin area.
6
  Author: NetWebLogic
7
- Version: 2.0.3
8
  Author URI: http://netweblogic.com/
9
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
10
 
@@ -39,7 +39,13 @@ class LoginWithAjax {
39
  //Make decision on what to display
40
  if ( function_exists('register_widget') && !isset($_GET["login-with-ajax"]) ){
41
  //Enqueue scripts
42
- wp_enqueue_script( "login-with-ajax", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/login-with-ajax.js"), array( 'jquery' ) );
 
 
 
 
 
 
43
  //Enqueue stylesheets
44
  if( file_exists(get_stylesheet_directory().'/plugins/login-with-ajax/widget.css') ){
45
  wp_enqueue_style( "login-with-ajax-css", get_stylesheet_directory_uri().'/plugins/login-with-ajax/widget.css' );
@@ -94,7 +100,7 @@ class LoginWithAjax {
94
  $return = array(); //What we send back
95
  $loginResult = wp_signon();
96
  $user_role = 'null';
97
- if ( get_class($loginResult) == 'WP_User' ) {
98
  //User login successful
99
  /* @var $loginResult WP_User */
100
  $return['result'] = true;
@@ -106,7 +112,7 @@ class LoginWithAjax {
106
  }else if($data['login_redirect'] != ''){
107
  $return['redirect'] = $data['login_redirect'];
108
  }
109
- } elseif ( get_class($loginResult) == 'WP_Error' ) {
110
  //User login failed
111
  /* @var $loginResult WP_Error */
112
  $return['result'] = false;
@@ -114,7 +120,7 @@ class LoginWithAjax {
114
  } else {
115
  //Undefined Error
116
  $return['result'] = false;
117
- $return['error'] = 'An undefined error has ocurred';
118
  }
119
  //Return the result array with errors etc.
120
  return $return;
@@ -128,7 +134,7 @@ class LoginWithAjax {
128
  if ( $result === true ) {
129
  //Password correctly remembered
130
  $return['result'] = true;
131
- } elseif ( get_class($result) == 'WP_Error' ) {
132
  //Something went wrong
133
  /* @var $result WP_Error */
134
  $return['result'] = false;
@@ -136,7 +142,7 @@ class LoginWithAjax {
136
  } else {
137
  //Undefined Error
138
  $return['result'] = false;
139
- $return['error'] = 'An undefined error has ocurred';
140
  }
141
  //Return the result array with errors etc.
142
  return $return;
@@ -144,7 +150,7 @@ class LoginWithAjax {
144
 
145
  function logoutRedirect(){
146
  $data = get_option('lwa_data');
147
- if( get_class($this->current_user) == "WP_User" ){
148
  //Do a redirect if necessary
149
  $data = get_option('lwa_data');
150
  $user_role = array_shift($this->current_user->roles); //Checking for role-based redirects
@@ -162,7 +168,7 @@ class LoginWithAjax {
162
  function loginRedirect(){
163
  $data = get_option('lwa_data');
164
  $user = wp_get_current_user();
165
- if( get_class($user) == "WP_User" ){
166
  //Do a redirect if necessary
167
  $data = get_option('lwa_data');
168
  $user_role = array_shift($user->roles); //Checking for role-based redirects
@@ -279,6 +285,9 @@ class LoginWithAjax {
279
  return $result;
280
  }
281
  }
 
 
 
282
  //Include admin file if needed
283
  if(is_admin()){
284
  include_once('login-with-ajax-admin.php');
4
  Plugin URI: http://netweblogic.com/wordpress/plugins/login-with-ajax/
5
  Description: Ajax driven login widget. Customisable from within your template folder, and advanced settings from the admin area.
6
  Author: NetWebLogic
7
+ Version: 2.1
8
  Author URI: http://netweblogic.com/
9
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
10
 
39
  //Make decision on what to display
40
  if ( function_exists('register_widget') && !isset($_GET["login-with-ajax"]) ){
41
  //Enqueue scripts
42
+ if( file_exists(get_stylesheet_directory().'/plugins/login-with-ajax/login-with-ajax.js') ){
43
+ wp_enqueue_script( "login-with-ajax", get_stylesheet_directory_uri()."/plugins/login-with-ajax/login-with-ajax.js", array( 'jquery' ) );
44
+ }else if( file_exists(get_template_directory().'/plugins/login-with-ajax/login-with-ajax.js') ){
45
+ wp_enqueue_script( "login-with-ajax", get_stylesheet_directory_uri()."/plugins/login-with-ajax/login-with-ajax.js", array( 'jquery' ) );
46
+ }else{
47
+ wp_enqueue_script( "login-with-ajax", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/login-with-ajax.js"), array( 'jquery' ) );
48
+ }
49
  //Enqueue stylesheets
50
  if( file_exists(get_stylesheet_directory().'/plugins/login-with-ajax/widget.css') ){
51
  wp_enqueue_style( "login-with-ajax-css", get_stylesheet_directory_uri().'/plugins/login-with-ajax/widget.css' );
100
  $return = array(); //What we send back
101
  $loginResult = wp_signon();
102
  $user_role = 'null';
103
+ if ( strtolower(get_class($loginResult)) == 'wp_user' ) {
104
  //User login successful
105
  /* @var $loginResult WP_User */
106
  $return['result'] = true;
112
  }else if($data['login_redirect'] != ''){
113
  $return['redirect'] = $data['login_redirect'];
114
  }
115
+ } elseif ( strtolower(get_class($loginResult)) == 'wp_error' ) {
116
  //User login failed
117
  /* @var $loginResult WP_Error */
118
  $return['result'] = false;
120
  } else {
121
  //Undefined Error
122
  $return['result'] = false;
123
+ $return['error'] = __('An undefined error has ocurred', 'login-with-ajax');
124
  }
125
  //Return the result array with errors etc.
126
  return $return;
134
  if ( $result === true ) {
135
  //Password correctly remembered
136
  $return['result'] = true;
137
+ } elseif ( strtolower(get_class($result)) == 'wp_error' ) {
138
  //Something went wrong
139
  /* @var $result WP_Error */
140
  $return['result'] = false;
142
  } else {
143
  //Undefined Error
144
  $return['result'] = false;
145
+ $return['error'] = __('An undefined error has ocurred', 'login-with-ajax');
146
  }
147
  //Return the result array with errors etc.
148
  return $return;
150
 
151
  function logoutRedirect(){
152
  $data = get_option('lwa_data');
153
+ if( strtolower(get_class($this->current_user)) == "wp_user" ){
154
  //Do a redirect if necessary
155
  $data = get_option('lwa_data');
156
  $user_role = array_shift($this->current_user->roles); //Checking for role-based redirects
168
  function loginRedirect(){
169
  $data = get_option('lwa_data');
170
  $user = wp_get_current_user();
171
+ if( strtolower(get_class($user)) == "wp_user" ){
172
  //Do a redirect if necessary
173
  $data = get_option('lwa_data');
174
  $user_role = array_shift($user->roles); //Checking for role-based redirects
285
  return $result;
286
  }
287
  }
288
+ //Add translation
289
+ load_plugin_textdomain('login-with-ajax', "/wp-content/plugins/login-with-ajax/langs/");
290
+
291
  //Include admin file if needed
292
  if(is_admin()){
293
  include_once('login-with-ajax-admin.php');
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: netweblogic
3
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
4
  Requires at least: 2.7
5
- Tested up to: 2.8.6
6
- Stable tag: 2.0.4
7
 
8
  Add smooth ajax during login, avoid screen refreshes and choose where users get redirected to upon login/logout. Supports SSL, MU, and BuddyPress.
9
 
@@ -23,8 +23,9 @@ Some of the features:
23
  * shortcode and template tags available
24
  * Fallback mechanism, will still work on javascript-disabled browsers
25
  * Widget specific option to show link to profile page
 
26
 
27
- If you have any problems with the plugins, please visit our [support forums](http://netweblogic.com/forums/) for further information and provide some feedback first, we may be able to help. It's considered rude to just give low ratings and nothing reason for doing so.
28
 
29
  If you find this plugin useful and would like to say thanks, a link, digg, or some other form of recognition to the plugin page on our blog would be appreciated.
30
 
@@ -53,7 +54,7 @@ When creating customized themes for your widget, there are a few points to consi
53
  * If you have a child theme, you can place the customizations in the child or parent folder (you should probably want to put it in the child folder).
54
  * If you want to customize the login-with-ajax.js javascript, you can also copy that into the same folder above (/yourthemepath/plugins/login-with-ajax/).
55
  * Unless you change the javascript, make sure you wrap your widget with an element with id="login-with-ajax" or "LoginWithAjax". If you use the $before_widget ... variables, this should be done automatically depending on your theme. I recommend you just wrap a div with id="LoginWithAjax" for fuller compatability across themes.
56
- * To force SSL, see [this page](http://codex.wordpress.org/Administration_Over_SSL). The plugin will automatically detect the wordpress settings.
57
 
58
  = Important information if upgrading from 1.2 and you have a customized widget =
59
 
@@ -80,7 +81,7 @@ Yes, see the notes section.
80
  = Do you have a shortcode or template tag? =
81
  Yes, see the notes section.
82
 
83
- For further questions and answers (or to submit one yourself) go to our [support forums](http://netweblogic.com/forums/).
84
 
85
 
86
  == Changelog ==
@@ -124,5 +125,8 @@ For further questions and answers (or to submit one yourself) go to our [support
124
  = 2.0.3 =
125
  * Fixed login_with_ajax function so it echoes correctly.
126
 
127
- = 2.0.3 =
128
- * Changed short opening tag
 
 
 
2
  Contributors: netweblogic
3
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
4
  Requires at least: 2.7
5
+ Tested up to: 2.9.1
6
+ Stable tag: 2.1
7
 
8
  Add smooth ajax during login, avoid screen refreshes and choose where users get redirected to upon login/logout. Supports SSL, MU, and BuddyPress.
9
 
23
  * shortcode and template tags available
24
  * Fallback mechanism, will still work on javascript-disabled browsers
25
  * Widget specific option to show link to profile page
26
+ * Now translatable (currently only Spanish is available, please contact me to contribute)
27
 
28
+ If you have any problems with the plugins, please visit our [http://netweblogic.com/forums/](support forums) for further information and provide some feedback first, we may be able to help. It's considered rude to just give low ratings and nothing reason for doing so.
29
 
30
  If you find this plugin useful and would like to say thanks, a link, digg, or some other form of recognition to the plugin page on our blog would be appreciated.
31
 
54
  * If you have a child theme, you can place the customizations in the child or parent folder (you should probably want to put it in the child folder).
55
  * If you want to customize the login-with-ajax.js javascript, you can also copy that into the same folder above (/yourthemepath/plugins/login-with-ajax/).
56
  * Unless you change the javascript, make sure you wrap your widget with an element with id="login-with-ajax" or "LoginWithAjax". If you use the $before_widget ... variables, this should be done automatically depending on your theme. I recommend you just wrap a div with id="LoginWithAjax" for fuller compatability across themes.
57
+ * To force SSL, see [http://codex.wordpress.org/Administration_Over_SSL]("this page"). The plugin will automatically detect the wordpress settings.
58
 
59
  = Important information if upgrading from 1.2 and you have a customized widget =
60
 
81
  = Do you have a shortcode or template tag? =
82
  Yes, see the notes section.
83
 
84
+ For further questions and answers (or to submit one yourself) go to our [http://netweblogic.com/forums/](support forums).
85
 
86
 
87
  == Changelog ==
125
  = 2.0.3 =
126
  * Fixed login_with_ajax function so it echoes correctly.
127
 
128
+ = 2.1 =
129
+ * Added translation POT files.
130
+ * Spanish translation (quick/poor attempt on my part, just to get things going)
131
+ * Fixed result bug on [http://netweblogic.com/forums/topic/undefined-error-on-logging-in-with-wp-29]
132
+ * Fixed bug on [http://wordpress.org/support/topic/355406]
widget/widget_in.php CHANGED
@@ -8,7 +8,7 @@
8
  <?php
9
  global $current_user;
10
  if( $is_widget ){
11
- echo $before_widget . $before_title . __( 'Hi ' ) . ucwords($current_user->display_name) . $after_title;
12
  }
13
  ?>
14
  <div id="LoginWithAjax">
@@ -48,7 +48,7 @@
48
  <?php
49
  if( !empty($wpmu_version) ) {
50
  ?>
51
- <a href="<?php bloginfo('siteurl') ?>/wp-admin/">blog admin</a>
52
  <?php
53
  }
54
  ?>
8
  <?php
9
  global $current_user;
10
  if( $is_widget ){
11
+ echo $before_widget . $before_title . __( 'Hi', 'login-with-ajax' ) . ucwords($current_user->display_name) . $after_title;
12
  }
13
  ?>
14
  <div id="LoginWithAjax">
48
  <?php
49
  if( !empty($wpmu_version) ) {
50
  ?>
51
+ <a href="<?php bloginfo('siteurl') ?>/wp-admin/"><?php _e("blog admin", 'loginwithajax'); ?></a>
52
  <?php
53
  }
54
  ?>
widget/widget_out.php CHANGED
@@ -71,19 +71,19 @@
71
  <table width='100%' cellspacing="0" cellpadding="0">
72
  <tr>
73
  <td>
74
- <strong><?php echo __("Forgotten Password") ?></strong>
75
  </td>
76
  </tr>
77
  <tr>
78
  <td class="forgot-pass-email">
79
- <?php $msg = __("Enter username or email"); ?>
80
  <input type="text" name="user_login" id="lwa_user_remember" value="<?php echo $msg ?>" onfocus="if(this.value == '<?php echo $msg ?>'){this.value = '';}" onblur="if(this.value == ''){this.value = '<?php echo $msg ?>'}" />
81
  </td>
82
  </tr>
83
  <tr>
84
  <td>
85
- <input type="submit" value="<?php echo __("Get New Password") ?>" />
86
- <a href="#" id="LoginWithAjax_Links_Remember_Cancel">Cancel</a>
87
  <input type="hidden" name="login-with-ajax" value="remember" />
88
  </td>
89
  </tr>
71
  <table width='100%' cellspacing="0" cellpadding="0">
72
  <tr>
73
  <td>
74
+ <strong><?php echo __("Forgotten Password", 'login-with-ajax'); ?></strong>
75
  </td>
76
  </tr>
77
  <tr>
78
  <td class="forgot-pass-email">
79
+ <?php $msg = __("Enter username or email", 'login-with-ajax'); ?>
80
  <input type="text" name="user_login" id="lwa_user_remember" value="<?php echo $msg ?>" onfocus="if(this.value == '<?php echo $msg ?>'){this.value = '';}" onblur="if(this.value == ''){this.value = '<?php echo $msg ?>'}" />
81
  </td>
82
  </tr>
83
  <tr>
84
  <td>
85
+ <input type="submit" value="<?php echo __("Get New Password", 'login-with-ajax'); ?>" />
86
+ <a href="#" id="LoginWithAjax_Links_Remember_Cancel"><?php _e("Cancel"); ?></a>
87
  <input type="hidden" name="login-with-ajax" value="remember" />
88
  </td>
89
  </tr>