Login With Ajax - Version 2.21

Version Description

Download this release

Release Info

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

Code changes from version 2.2 to 2.21

Files changed (47) hide show
  1. {langs → trunk/langs}/login-with-ajax-cn_CN.mo +0 -0
  2. {langs → trunk/langs}/login-with-ajax-cn_CN.pot +0 -0
  3. {langs → trunk/langs}/login-with-ajax-da_DK.mo +0 -0
  4. {langs → trunk/langs}/login-with-ajax-da_DK.po +0 -0
  5. {langs → trunk/langs}/login-with-ajax-de_DE.mo +0 -0
  6. {langs → trunk/langs}/login-with-ajax-de_DE.po +0 -0
  7. {langs → trunk/langs}/login-with-ajax-es_ES.mo +0 -0
  8. {langs → trunk/langs}/login-with-ajax-es_ES.pot +0 -0
  9. {langs → trunk/langs}/login-with-ajax-fa_IR.mo +0 -0
  10. {langs → trunk/langs}/login-with-ajax-fa_IR.po +0 -0
  11. {langs → trunk/langs}/login-with-ajax-fi_FI.mo +0 -0
  12. {langs → trunk/langs}/login-with-ajax-fi_FI.po +0 -0
  13. {langs → trunk/langs}/login-with-ajax-fr_FR.mo +0 -0
  14. {langs → trunk/langs}/login-with-ajax-fr_FR.pot +0 -0
  15. {langs → trunk/langs}/login-with-ajax-it_IT.mo +0 -0
  16. {langs → trunk/langs}/login-with-ajax-it_IT.po +0 -0
  17. {langs → trunk/langs}/login-with-ajax-li_LI.mo +0 -0
  18. {langs → trunk/langs}/login-with-ajax-li_LI.pot +0 -0
  19. {langs → trunk/langs}/login-with-ajax-nl_NL.mo +0 -0
  20. {langs → trunk/langs}/login-with-ajax-nl_NL.po +0 -0
  21. {langs → trunk/langs}/login-with-ajax-pl_PL.mo +0 -0
  22. {langs → trunk/langs}/login-with-ajax-pl_PL.po +0 -0
  23. {langs → trunk/langs}/login-with-ajax-pt_BR.mo +0 -0
  24. {langs → trunk/langs}/login-with-ajax-pt_BR.po +0 -0
  25. {langs → trunk/langs}/login-with-ajax-ro_RO.mo +0 -0
  26. {langs → trunk/langs}/login-with-ajax-ro_RO.po +0 -0
  27. {langs → trunk/langs}/login-with-ajax-ru_RU.mo +0 -0
  28. {langs → trunk/langs}/login-with-ajax-ru_RU.po +0 -0
  29. {langs → trunk/langs}/login-with-ajax-tr_TR.mo +0 -0
  30. {langs → trunk/langs}/login-with-ajax-tr_TR.po +0 -0
  31. {langs → trunk/langs}/login-with-ajax.pot +0 -0
  32. login-with-ajax-admin.php → trunk/login-with-ajax-admin.php +0 -0
  33. login-with-ajax-widget.php → trunk/login-with-ajax-widget.php +0 -0
  34. login-with-ajax.js → trunk/login-with-ajax.js +0 -0
  35. login-with-ajax.php → trunk/login-with-ajax.php +23 -30
  36. login-with-ajax.source.js → trunk/login-with-ajax.source.js +0 -0
  37. readme.txt → trunk/readme.txt +8 -4
  38. screenshot-1.jpg → trunk/screenshot-1.jpg +0 -0
  39. screenshot-2.jpg → trunk/screenshot-2.jpg +0 -0
  40. screenshot-3.jpg → trunk/screenshot-3.jpg +0 -0
  41. screenshot-4.jpg → trunk/screenshot-4.jpg +0 -0
  42. screenshot-5.jpg → trunk/screenshot-5.jpg +0 -0
  43. screenshot-6.jpg → trunk/screenshot-6.jpg +0 -0
  44. {widget → trunk/widget}/loading.gif +0 -0
  45. {widget → trunk/widget}/widget.css +0 -0
  46. {widget → trunk/widget}/widget_in.php +0 -0
  47. {widget → trunk/widget}/widget_out.php +0 -0
{langs → trunk/langs}/login-with-ajax-cn_CN.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-cn_CN.pot RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-da_DK.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-da_DK.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-de_DE.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-de_DE.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-es_ES.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-es_ES.pot RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-fa_IR.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-fa_IR.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-fi_FI.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-fi_FI.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-fr_FR.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-fr_FR.pot RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-it_IT.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-it_IT.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-li_LI.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-li_LI.pot RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-nl_NL.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-nl_NL.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-pl_PL.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-pl_PL.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-pt_BR.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-pt_BR.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-ro_RO.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-ro_RO.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-ru_RU.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-ru_RU.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-tr_TR.mo RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax-tr_TR.po RENAMED
File without changes
{langs → trunk/langs}/login-with-ajax.pot RENAMED
File without changes
login-with-ajax-admin.php → trunk/login-with-ajax-admin.php RENAMED
File without changes
login-with-ajax-widget.php → trunk/login-with-ajax-widget.php RENAMED
File without changes
login-with-ajax.js → trunk/login-with-ajax.js RENAMED
File without changes
login-with-ajax.php → trunk/login-with-ajax.php RENAMED
@@ -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.2
8
  Author URI: http://netweblogic.com/
9
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
10
 
@@ -147,21 +147,17 @@ class LoginWithAjax {
147
  $user_role = 'null';
148
  if ( strtolower(get_class($loginResult)) == 'wp_user' ) {
149
  //User login successful
150
- $this->current_user = wp_get_current_user();
151
  /* @var $loginResult WP_User */
152
  $return['result'] = true;
153
  $return['message'] = __("Login Successful, redirecting...",'login-with-ajax');
154
  //Do a redirect if necessary
155
- $data = $this->data;
156
- $user_role = array_shift($loginResult->roles); //Checking for role-based redirects
157
- if( isset($data["role_login"][$user_role]) ){
158
- $return['redirect'] = $data["role_login"][$user_role];
159
- }else if($data['login_redirect'] != ''){
160
- $return['redirect'] = $data['login_redirect'];
161
  }
162
- $return['redirect'] = str_replace('%USERNAME%', $loginResult->user_login, $data['login_redirect']);
163
  //If the widget should just update with ajax, then supply the URL here.
164
- if( $data['no_login_refresh'] == 1 ){
165
  //Is this coming from a template?
166
  $template = ($_GET['template'] != '') ? "&template={$_GET['template']}" : '';
167
  $return['widget'] = get_bloginfo('wpurl')."?login-with-ajax-widget=1$template";
@@ -206,10 +202,7 @@ class LoginWithAjax {
206
 
207
  function logoutRedirect(){
208
  $redirect = $this->getLogoutRedirect();
209
- if ( $redirect == '%LASTURL%'){
210
- wp_redirect($_SERVER['HTTP_REFERER']);
211
- exit();
212
- }elseif($redirect != ''){
213
  wp_redirect($redirect);
214
  exit();
215
  }
@@ -217,6 +210,9 @@ class LoginWithAjax {
217
 
218
  function getLogoutRedirect(){
219
  $data = $this->data;
 
 
 
220
  if( strtolower(get_class($this->current_user)) == "wp_user" ){
221
  //Do a redirect if necessary
222
  $data = $this->data;
@@ -225,39 +221,36 @@ class LoginWithAjax {
225
  $redirect = $data["role_logout"][$user_role];
226
  }
227
  }
228
- if($data['logout_redirect'] != ''){
229
- $redirect = $data['logout_redirect'];
230
- }
231
  return $redirect;
232
  }
233
 
234
  function loginRedirect( $redirect, $redirect_notsurewhatthisis, $user ){
235
  $data = $this->data;
236
- $lwa_redirect = $this->getLoginRedirect($user);
237
- if( $lwa_redirect != '' ){
238
- wp_redirect($lwa_redirect);
239
- exit();
 
 
240
  }
241
  return $redirect;
242
  }
243
 
244
  function getLoginRedirect($user){
245
- $data = $this->data;
246
- if( $data['login_redirect'] == "same" ){
247
-
248
  }
249
  if( strtolower(get_class($user)) == "wp_user" ){
250
  $user_role = array_shift($user->roles); //Checking for role-based redirects
251
  if( isset($data["role_login"][$user_role]) ){
252
  $redirect = $data["role_login"][$user_role];
253
- $redirect = str_replace('%USERNAME%', $user->user_login, $redirect);
254
  }
255
- }
256
- if($data['login_redirect'] != ''){
257
- $redirect = $data["login_redirect"];
258
- $redirect = str_replace('%USERNAME%', $user->user_login, $redirect);
259
  }
260
- return $redrect;
 
 
261
  }
262
 
263
  /*
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.21
8
  Author URI: http://netweblogic.com/
9
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
10
 
147
  $user_role = 'null';
148
  if ( strtolower(get_class($loginResult)) == 'wp_user' ) {
149
  //User login successful
150
+ $this->current_user = $loginResult;
151
  /* @var $loginResult WP_User */
152
  $return['result'] = true;
153
  $return['message'] = __("Login Successful, redirecting...",'login-with-ajax');
154
  //Do a redirect if necessary
155
+ $redirect = $this->getLoginRedirect($this->current_user);
156
+ if( $redirect != '' ){
157
+ $return['redirect'] = $redirect;
 
 
 
158
  }
 
159
  //If the widget should just update with ajax, then supply the URL here.
160
+ if( $this->data['no_login_refresh'] == 1 ){
161
  //Is this coming from a template?
162
  $template = ($_GET['template'] != '') ? "&template={$_GET['template']}" : '';
163
  $return['widget'] = get_bloginfo('wpurl')."?login-with-ajax-widget=1$template";
202
 
203
  function logoutRedirect(){
204
  $redirect = $this->getLogoutRedirect();
205
+ if($redirect != ''){
 
 
 
206
  wp_redirect($redirect);
207
  exit();
208
  }
210
 
211
  function getLogoutRedirect(){
212
  $data = $this->data;
213
+ if($data['logout_redirect'] != ''){
214
+ $redirect = $data['logout_redirect'];
215
+ }
216
  if( strtolower(get_class($this->current_user)) == "wp_user" ){
217
  //Do a redirect if necessary
218
  $data = $this->data;
221
  $redirect = $data["role_logout"][$user_role];
222
  }
223
  }
224
+ $redirect = str_replace("%LASTURL%", $_SERVER['HTTP_REFERER'], $redirect);
 
 
225
  return $redirect;
226
  }
227
 
228
  function loginRedirect( $redirect, $redirect_notsurewhatthisis, $user ){
229
  $data = $this->data;
230
+ if(is_user_logged_in()){
231
+ $lwa_redirect = $this->getLoginRedirect($user);
232
+ if( $lwa_redirect != '' ){
233
+ wp_redirect($lwa_redirect);
234
+ exit();
235
+ }
236
  }
237
  return $redirect;
238
  }
239
 
240
  function getLoginRedirect($user){
241
+ $data = $this->data;
242
+ if($data['login_redirect'] != ''){
243
+ $redirect = $data["login_redirect"];
244
  }
245
  if( strtolower(get_class($user)) == "wp_user" ){
246
  $user_role = array_shift($user->roles); //Checking for role-based redirects
247
  if( isset($data["role_login"][$user_role]) ){
248
  $redirect = $data["role_login"][$user_role];
 
249
  }
 
 
 
 
250
  }
251
+ //Do string replacements
252
+ $redirect = str_replace('%USERNAME%', $user->user_login, $redirect);
253
+ return $redirect;
254
  }
255
 
256
  /*
login-with-ajax.source.js → trunk/login-with-ajax.source.js RENAMED
File without changes
readme.txt → trunk/readme.txt RENAMED
@@ -3,7 +3,7 @@ Contributors: netweblogic
3
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
4
  Requires at least: 2.8
5
  Tested up to: 3.0
6
- Stable tag: 2.2
7
 
8
  Add smooth ajax login effects to your blog and choose where users get redirected upon login/logout. Supports SSL, MU, and BuddyPress.
9
 
@@ -131,10 +131,14 @@ For further questions and answers (or to submit one yourself) go to our [http://
131
  * Changed logged in widget to fix avatar display issue for both BuddyPress and WP. (Using ID instead of email for get_avatar and changed depreciated BP function).
132
  * Added Danish Translation
133
 
134
- = 2.2 (stable - [http://downloads.wordpress.org/plugin/login-with-ajax.zip] ) =
135
- * Added Turkish and Brazilian Translation
136
  * Fixed buddypress avatar not showing when logged in
137
  * Removed capitalization of username in logged in widget
138
  * Fixed all other known bugs
139
  * Added placeholders for redirects (e.g. %USERNAME% for username when logged in)
140
- * Added seamless login, screen doesn't refresh upon successful login.
 
 
 
 
3
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
4
  Requires at least: 2.8
5
  Tested up to: 3.0
6
+ Stable tag: 2.21
7
 
8
  Add smooth ajax login effects to your blog and choose where users get redirected upon login/logout. Supports SSL, MU, and BuddyPress.
9
 
131
  * Changed logged in widget to fix avatar display issue for both BuddyPress and WP. (Using ID instead of email for get_avatar and changed depreciated BP function).
132
  * Added Danish Translation
133
 
134
+ = 2.2 =
135
+ * Added Polish, Turkish and Brazilian Translation
136
  * Fixed buddypress avatar not showing when logged in
137
  * Removed capitalization of username in logged in widget
138
  * Fixed all other known bugs
139
  * Added placeholders for redirects (e.g. %USERNAME% for username when logged in)
140
+ * Added seamless login, screen doesn't refresh upon successful login.
141
+
142
+ = 2.21 =
143
+ * Redirect bug fix
144
+ * Hopefully fixed encoding issue
screenshot-1.jpg → trunk/screenshot-1.jpg RENAMED
File without changes
screenshot-2.jpg → trunk/screenshot-2.jpg RENAMED
File without changes
screenshot-3.jpg → trunk/screenshot-3.jpg RENAMED
File without changes
screenshot-4.jpg → trunk/screenshot-4.jpg RENAMED
File without changes
screenshot-5.jpg → trunk/screenshot-5.jpg RENAMED
File without changes
screenshot-6.jpg → trunk/screenshot-6.jpg RENAMED
File without changes
{widget → trunk/widget}/loading.gif RENAMED
File without changes
{widget → trunk/widget}/widget.css RENAMED
File without changes
{widget → trunk/widget}/widget_in.php RENAMED
File without changes
{widget → trunk/widget}/widget_out.php RENAMED
File without changes