Login With Ajax - Version 1.2

Version Description

  • Fixed redirection issue.
  • Added link to wp-admin profile page when logged in to default widget template.

=

Download this release

Release Info

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

Code changes from version 1.11 to 1.2

login-with-ajax-admin.php CHANGED
@@ -77,6 +77,16 @@ class LWA{
77
  <i>If you'd like to send the user to a specific URL after logout, enter it here (e.g. http://wordpress.org/)</i>
78
  </td>
79
  </tr>
 
 
 
 
 
 
 
 
 
 
80
  </tbody>
81
  <tfoot>
82
  <tr valign="top">
77
  <i>If you'd like to send the user to a specific URL after logout, enter it here (e.g. http://wordpress.org/)</i>
78
  </td>
79
  </tr>
80
+ <tr valign="top">
81
+ <td scope="row">
82
+ <label>Show profile link to wp-admin?</label>
83
+ </td>
84
+ <td>
85
+ <input type="checkbox" name="lwa_admin_link" value='1' <?= ($lwa_data['admin_link'] == '1') ? 'checked="checked"':'' ?> />
86
+ <br/>
87
+ <i>Checking this will show a link to their wp-admin profile in the sidebar widget when the user is logged in.</i>
88
+ </td>
89
+ </tr>
90
  </tbody>
91
  <tfoot>
92
  <tr valign="top">
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: 1.11
8
  Author URI: http://netweblogic.com/
9
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
10
 
@@ -101,7 +101,10 @@ class LoginWithAjax {
101
  $return['result'] = false;
102
  $return['error'] = 'An undefined error has ocurred';
103
  }
104
-
 
 
 
105
  //Return the result array with errors etc.
106
  return $return;
107
  }
@@ -126,16 +129,18 @@ class LoginWithAjax {
126
 
127
  function logoutRedirect(){
128
  $data = get_option('lwa_data');
129
- if( preg_match('/http(s)?:\/\//.+\.[a-zA-Z]{2,3}/',$data['logout_redirect'])){
130
- header("Location: {$data['logout_redirect']}");
 
131
  }
132
  }
133
 
134
  function loginRedirect(){
135
  $data = get_option('lwa_data');
136
- if( preg_match('/http(s)?:\/\//.+\.[a-zA-Z]{2,3}/',$data['login_redirect'])){
137
- header("Location: {$data['login_redirect']}");
138
- }
 
139
  }
140
  }
141
 
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: 1.2
8
  Author URI: http://netweblogic.com/
9
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
10
 
101
  $return['result'] = false;
102
  $return['error'] = 'An undefined error has ocurred';
103
  }
104
+ $data = get_option('lwa_data');
105
+ if($data['login_redirect'] != ''){
106
+ $return['redirect'] = $data['login_redirect'];
107
+ }
108
  //Return the result array with errors etc.
109
  return $return;
110
  }
129
 
130
  function logoutRedirect(){
131
  $data = get_option('lwa_data');
132
+ if($data['logout_redirect'] != ''){
133
+ wp_redirect($data['logout_redirect']);
134
+ exit();
135
  }
136
  }
137
 
138
  function loginRedirect(){
139
  $data = get_option('lwa_data');
140
+ if($data['login_redirect'] != ''){
141
+ wp_redirect($data['login_redirect']);
142
+ exit();
143
+ }
144
  }
145
  }
146
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: netweblogic
4
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
5
  Requires at least: 2.7
6
  Tested up to: 2.8.2
7
- Stable tag: 1.11
8
 
9
  Add smooth ajax during login, avoid screen refreshes and choose where users get redirected to upon login/logout. Supports SSL, MU, and BuddyPress.
10
 
@@ -18,13 +18,22 @@ This plugin allows full customization of your widget html by allowing you to cre
18
 
19
  Another useful feature (which can be used without the widget) is login and logout redirects, so you control where the user is taken upon login and logout.
20
 
 
 
21
  If you find this plugin useful and would like to donate something, all we ask is you please add a link on your site to the plugin page on our blog or digg our plugin page [http://netweblogic.com/wordpress/plugins/login-with-ajax/](http://netweblogic.com/wordpress/plugins/login-with-ajax/) thanks!
22
 
23
  == Changelog ==
24
 
25
  = 1.1 =
26
  * Fixed JavaScript for http to https support.
27
- * Added shortcut tag login_with_ajax()
 
 
 
 
 
 
 
28
 
29
  == Installation ==
30
 
4
  Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
5
  Requires at least: 2.7
6
  Tested up to: 2.8.2
7
+ Stable tag: 1.2
8
 
9
  Add smooth ajax during login, avoid screen refreshes and choose where users get redirected to upon login/logout. Supports SSL, MU, and BuddyPress.
10
 
18
 
19
  Another useful feature (which can be used without the widget) is login and logout redirects, so you control where the user is taken upon login and logout.
20
 
21
+ If you have any problems with the plugins, please leave a comment on the plugin page or at least give feedback before giving a low rating. It's rude to just give low ratings and nothing else.
22
+
23
  If you find this plugin useful and would like to donate something, all we ask is you please add a link on your site to the plugin page on our blog or digg our plugin page [http://netweblogic.com/wordpress/plugins/login-with-ajax/](http://netweblogic.com/wordpress/plugins/login-with-ajax/) thanks!
24
 
25
  == Changelog ==
26
 
27
  = 1.1 =
28
  * Fixed JavaScript for http to https support.
29
+ * Added shortcut tag login_with_ajax().
30
+
31
+ = 1.11 =
32
+ * Fixed regular expression issue.
33
+
34
+ = 1.2 =
35
+ * Fixed redirection issue.
36
+ * Added link to wp-admin profile page when logged in to default widget template.
37
 
38
  == Installation ==
39
 
widget/widget_in.php CHANGED
@@ -13,6 +13,7 @@
13
  global $current_user;
14
  global $wpmu_version;
15
  get_currentuserinfo();
 
16
  ?>
17
  <table cellpadding="0" cellspacing="0" width="100%">
18
  <tr>
@@ -25,7 +26,13 @@
25
  </td>
26
  <td id="LoginWithAjax_Title">
27
  <?php
28
- /* Always add a log out list item to the end of the navigation */
 
 
 
 
 
 
29
  if ( function_exists( 'wp_logout_url' ) ) {
30
  ?>
31
  <a id="wp-logout" href="<?= wp_logout_url( site_url() ) ?>"><?= strtolower(__( 'Log Out' )) ?></a>
@@ -34,7 +41,7 @@
34
  ?>
35
  <a id="wp-logout" href="<?= site_url() . '/wp-login.php?action=logout&amp;redirect_to=' . site_url() ?>"><?= strtolower(__( 'Log Out' )) ?></a>
36
  <?php
37
- }
38
  ?>
39
  <?php
40
  if( !empty($wpmu_version) ) {
13
  global $current_user;
14
  global $wpmu_version;
15
  get_currentuserinfo();
16
+ $lwa_data = get_option('lwa_data');
17
  ?>
18
  <table cellpadding="0" cellspacing="0" width="100%">
19
  <tr>
26
  </td>
27
  <td id="LoginWithAjax_Title">
28
  <?php
29
+ //Admin URL
30
+ if ( $lwa_data['admin_link'] == '1' ) {
31
+ ?>
32
+ <a href="<?php bloginfo('siteurl') ?>/wp-admin/profile.php"><?= strtolower(__('Profile')) ?></a><br/>
33
+ <?php
34
+ }
35
+ //Logout URL
36
  if ( function_exists( 'wp_logout_url' ) ) {
37
  ?>
38
  <a id="wp-logout" href="<?= wp_logout_url( site_url() ) ?>"><?= strtolower(__( 'Log Out' )) ?></a>
41
  ?>
42
  <a id="wp-logout" href="<?= site_url() . '/wp-login.php?action=logout&amp;redirect_to=' . site_url() ?>"><?= strtolower(__( 'Log Out' )) ?></a>
43
  <?php
44
+ }
45
  ?>
46
  <?php
47
  if( !empty($wpmu_version) ) {