Version Description
- %LASTURL% now works for logins as well
- Profile link plays nice with buddypress
- Added fix to stop wp_new_user_notification conflicts
- Empty logins now have an error message too.
Download this release
Release Info
Developer | netweblogic |
Plugin | Login With Ajax |
Version | 3.0b3 |
Comparing to | |
See all releases |
Code changes from version 3.0b2 to 3.0b3
- langs/login-with-ajax-es_ES.mo +0 -0
- langs/login-with-ajax-es_ES.pot +2 -2
- langs/login-with-ajax-li_LI.mo +0 -0
- langs/login-with-ajax-li_LI.pot +178 -0
- login-with-ajax-admin.php +20 -25
- login-with-ajax.php +60 -48
- pluggable.php +0 -1
- readme.txt +9 -2
- widget/default/register.php +36 -0
- widget/default/widget_in.php +9 -3
- widget/widget.css +1 -0
langs/login-with-ajax-es_ES.mo
CHANGED
Binary file
|
langs/login-with-ajax-es_ES.pot
CHANGED
@@ -8,7 +8,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-
|
12 |
"Last-Translator: Marcus Sykes <marcus@netweblogic.com>\n"
|
13 |
"Language-Team: \n"
|
14 |
"MIME-Version: 1.0\n"
|
@@ -69,7 +69,7 @@ msgstr "Mostrar enlace al perfil de usario?"
|
|
69 |
|
70 |
#: login-with-ajax.php:107
|
71 |
msgid "Login Successful, redirecting..."
|
72 |
-
msgstr "Contraseña
|
73 |
|
74 |
#: login-with-ajax.php:126
|
75 |
#: login-with-ajax.php:148
|
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-09-21 17:33+0100\n"
|
12 |
"Last-Translator: Marcus Sykes <marcus@netweblogic.com>\n"
|
13 |
"Language-Team: \n"
|
14 |
"MIME-Version: 1.0\n"
|
69 |
|
70 |
#: login-with-ajax.php:107
|
71 |
msgid "Login Successful, redirecting..."
|
72 |
+
msgstr "Contraseña correcta, espere un momento..."
|
73 |
|
74 |
#: login-with-ajax.php:126
|
75 |
#: login-with-ajax.php:148
|
langs/login-with-ajax-li_LI.mo
ADDED
Binary file
|
langs/login-with-ajax-li_LI.pot
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2010 NetWebLogic
|
2 |
+
# This file is distributed under the same license as the Login With Ajax package.
|
3 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
4 |
+
#
|
5 |
+
msgid ""
|
6 |
+
msgstr ""
|
7 |
+
"Project-Id-Version: Login With Ajax 2.0.4\n"
|
8 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/login-with-ajax\n"
|
9 |
+
"POT-Creation-Date: 2010-02-10 13:35+0000\n"
|
10 |
+
"PO-Revision-Date: 2010-05-11 14:01+0100\n"
|
11 |
+
"Last-Translator: Marcus Sykes <marcus@netweblogic.com>\n"
|
12 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
15 |
+
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
|
17 |
+
# Translated by WP
|
18 |
+
#: login-with-ajax-admin.php:67
|
19 |
+
msgid "Changes saved."
|
20 |
+
msgstr "Pakeitimai išsaugoti"
|
21 |
+
|
22 |
+
#: login-with-ajax-admin.php:71
|
23 |
+
msgid "There were issues when saving your settings. Please try again."
|
24 |
+
msgstr "Įvyko klaida išsaugant pakeitimus, parašome pabandyti dar kartą"
|
25 |
+
|
26 |
+
#: login-with-ajax-admin.php:99
|
27 |
+
msgid "Global Login Redirect"
|
28 |
+
msgstr "Globalūs peradresvimo nustatymai prisijungus"
|
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 "Jei norite, kad vartotojai būtų nukreipiami į tam tikrą nuorodą prisijungus - įveskite ją čia (pvz.: http://wordpress.org/)"
|
33 |
+
|
34 |
+
#: login-with-ajax-admin.php:108
|
35 |
+
msgid "Global Logout Redirect"
|
36 |
+
msgstr "Globalūs peradresvimo nustatymai atsijungus"
|
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 "Jei norite, kad vartotojai būtų nukreipiami į tam tikrą nuorodą atsijungus - įveskite ją čia (pvz.: http://wordpress.org/)"
|
41 |
+
|
42 |
+
#: login-with-ajax-admin.php:117
|
43 |
+
msgid "Role-Based Custom Login Redirects"
|
44 |
+
msgstr "Specifinių vartotojų peradresavimas po prisijungimo"
|
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 "Jei norite, kad specifiniai vartotojai būtų nukreipiami į tam tikrą nuorodą prisijungus - įveskite ją čia (palikus tuščią lauką bus naudojama globali nuoroda)"
|
49 |
+
|
50 |
+
#: login-with-ajax-admin.php:140
|
51 |
+
msgid "Role-Based Custom Logout Redirects"
|
52 |
+
msgstr "Specifinių vartotojų peradresavimas po atsijungimo"
|
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 "Jei norite, kad specifiniai vartotojai būtų nukreipiami į tam tikrą nuorodą atsijungus - įveskite ją čia (palikus tuščią lauką bus naudojama globali nuoroda)"
|
57 |
+
|
58 |
+
# Translated by WP
|
59 |
+
#: login-with-ajax-admin.php:167
|
60 |
+
msgid "Save Changes"
|
61 |
+
msgstr "Išsaugoti pakeitimus"
|
62 |
+
|
63 |
+
#: login-with-ajax-widget.php:5
|
64 |
+
msgid "Login widget with AJAX capabilities."
|
65 |
+
msgstr "Prisijungimo laukas su Ajax galimybėmis"
|
66 |
+
|
67 |
+
#: login-with-ajax-widget.php:25
|
68 |
+
msgid "Show profile link?"
|
69 |
+
msgstr "Rodyti nuorodą į profilį?"
|
70 |
+
|
71 |
+
#: login-with-ajax.php:107
|
72 |
+
msgid "Login Successful, redirecting..."
|
73 |
+
msgstr "Prisijungimas sėkmingas, peradresuojama..."
|
74 |
+
|
75 |
+
#: login-with-ajax.php:126
|
76 |
+
#: login-with-ajax.php:148
|
77 |
+
msgid "An undefined error has ocurred"
|
78 |
+
msgstr "Įvyko neatpažįstama klaida"
|
79 |
+
|
80 |
+
#: login-with-ajax.php:138
|
81 |
+
msgid "We have sent you an email"
|
82 |
+
msgstr "Mes jums išsiuntėme elektroninį laišką"
|
83 |
+
|
84 |
+
#: widget/widget_in.php:11
|
85 |
+
msgid "Hi"
|
86 |
+
msgstr "Labas"
|
87 |
+
|
88 |
+
# Translated by WP
|
89 |
+
#: widget/widget_in.php:34
|
90 |
+
msgid "Profile"
|
91 |
+
msgstr "Profilis"
|
92 |
+
|
93 |
+
# Translated by WP
|
94 |
+
#: widget/widget_in.php:40
|
95 |
+
#: widget/widget_in.php:44
|
96 |
+
msgid "Log Out"
|
97 |
+
msgstr "Atsijungti"
|
98 |
+
|
99 |
+
#: widget/widget_in.php:51
|
100 |
+
msgid "blog admin"
|
101 |
+
msgstr "administratorius"
|
102 |
+
|
103 |
+
# Translated by WP
|
104 |
+
#: widget/widget_out.php:10
|
105 |
+
#: widget/widget_out.php:35
|
106 |
+
msgid "Log In"
|
107 |
+
msgstr "Prisijungti"
|
108 |
+
|
109 |
+
# Translated by WP
|
110 |
+
#: widget/widget_out.php:19
|
111 |
+
msgid "Username"
|
112 |
+
msgstr "Vart. vardas"
|
113 |
+
|
114 |
+
# Translated by WP
|
115 |
+
#: widget/widget_out.php:27
|
116 |
+
msgid "Password"
|
117 |
+
msgstr "Slaptažodis"
|
118 |
+
|
119 |
+
# Translated by WP
|
120 |
+
#: widget/widget_out.php:41
|
121 |
+
msgid "Remember Me"
|
122 |
+
msgstr "Prisiminti mane"
|
123 |
+
|
124 |
+
#: widget/widget_out.php:43
|
125 |
+
msgid "Password Lost and Found"
|
126 |
+
msgstr "Pamištas ir gautas slaptažodis"
|
127 |
+
|
128 |
+
#: widget/widget_out.php:43
|
129 |
+
msgid "Lost your password?"
|
130 |
+
msgstr "Pamiršai slaptažodį?"
|
131 |
+
|
132 |
+
# Translated by WP
|
133 |
+
#: widget/widget_out.php:52
|
134 |
+
#: widget/widget_out.php:56
|
135 |
+
msgid "Register"
|
136 |
+
msgstr "Rekistruotis"
|
137 |
+
|
138 |
+
# Translated by WP
|
139 |
+
#: widget/widget_out.php:62
|
140 |
+
msgid "Sign Up"
|
141 |
+
msgstr "Registruotis"
|
142 |
+
|
143 |
+
#: widget/widget_out.php:74
|
144 |
+
msgid "Forgotten Password"
|
145 |
+
msgstr "Pamirštas slaptažodis"
|
146 |
+
|
147 |
+
#: widget/widget_out.php:79
|
148 |
+
msgid "Enter username or email"
|
149 |
+
msgstr "Įveskite vart. vardą arba slaptažodį"
|
150 |
+
|
151 |
+
#: widget/widget_out.php:85
|
152 |
+
msgid "Get New Password"
|
153 |
+
msgstr "Gauk naują slaptažodį"
|
154 |
+
|
155 |
+
#. Plugin Name of an extension
|
156 |
+
msgid "Login With Ajax"
|
157 |
+
msgstr "Prisijunk su Ajax"
|
158 |
+
|
159 |
+
#. Plugin URI of an extension
|
160 |
+
msgid "http://netweblogic.com/wordpress/plugins/login-with-ajax/"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#. Description of an extension
|
164 |
+
msgid "Ajax driven login widget. Customisable from within your template folder, and advanced settings from the admin area."
|
165 |
+
msgstr "Ajax paremtas prisijungimo laukas. Redaguojamas iš jūsų template aplanko ir papildomi nustatymai per administratoriaus meniu"
|
166 |
+
|
167 |
+
#. Author of an extension
|
168 |
+
msgid "NetWebLogic"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#. Author URI of an extension
|
172 |
+
msgid "http://netweblogic.com/"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#. Tags of an extension
|
176 |
+
msgid "Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget"
|
177 |
+
msgstr ""
|
178 |
+
|
login-with-ajax-admin.php
CHANGED
@@ -67,33 +67,28 @@ class LoginWithAjaxAdmin{
|
|
67 |
|
68 |
if( is_admin() and $_POST['lwasubmitted']==1 ){
|
69 |
//Build the array of options here
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
$lwa_data[substr($postKey, 4)] = $postValue;
|
85 |
-
}
|
86 |
}
|
87 |
}
|
88 |
-
update_option('lwa_data', $lwa_data);
|
89 |
-
?>
|
90 |
-
<div class="updated"><p><strong><?php _e('Changes saved.'); ?></strong></p></div>
|
91 |
-
<?php
|
92 |
-
}else{
|
93 |
-
?>
|
94 |
-
<div class="error"><p><strong><?php _e('There were issues when saving your settings. Please try again.', 'login-with-ajax'); ?></strong></p></div>
|
95 |
-
<?php
|
96 |
}
|
|
|
|
|
|
|
|
|
|
|
97 |
}else{
|
98 |
$lwa_data = get_option('lwa_data');
|
99 |
}
|
@@ -106,7 +101,7 @@ class LoginWithAjaxAdmin{
|
|
106 |
<div class="handlediv" title="Click to toggle"></div>
|
107 |
<h3 class="hndle">Donations</h3>
|
108 |
<div class="inside">
|
109 |
-
|
110 |
<div style="text-align:center;">
|
111 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
112 |
<input type="hidden" name="cmd" value="_s-xclick">
|
67 |
|
68 |
if( is_admin() and $_POST['lwasubmitted']==1 ){
|
69 |
//Build the array of options here
|
70 |
+
foreach ($_POST as $postKey => $postValue){
|
71 |
+
if( $postValue != '' && preg_match('/lwa_role_log(in|out)_/', $postKey) ){
|
72 |
+
//Custom role-based redirects
|
73 |
+
if( preg_match('/lwa_role_login/', $postKey) ){
|
74 |
+
//Login
|
75 |
+
$lwa_data['role_login'][str_replace('lwa_role_login_', '', $postKey)] = $postValue;
|
76 |
+
}else{
|
77 |
+
//Logout
|
78 |
+
$lwa_data['role_logout'][str_replace('lwa_role_logout_', '', $postKey)] = $postValue;
|
79 |
+
}
|
80 |
+
}elseif( substr($postKey, 0, 4) == 'lwa_' ){
|
81 |
+
//For now, no validation, since this is in admin area.
|
82 |
+
if($postValue != ''){
|
83 |
+
$lwa_data[substr($postKey, 4)] = $postValue;
|
|
|
|
|
84 |
}
|
85 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
+
update_option('lwa_data', $lwa_data);
|
88 |
+
update_option('lwa_notification_override',$_POST['lwa_notification_override']);
|
89 |
+
?>
|
90 |
+
<div class="updated"><p><strong><?php _e('Changes saved.'); ?></strong></p></div>
|
91 |
+
<?php
|
92 |
}else{
|
93 |
$lwa_data = get_option('lwa_data');
|
94 |
}
|
101 |
<div class="handlediv" title="Click to toggle"></div>
|
102 |
<h3 class="hndle">Donations</h3>
|
103 |
<div class="inside">
|
104 |
+
<em>Plugins don't grow on trees.</em> Please remember that this plugin is provided to you free of charge, yet it takes many hours of work to maintain and improve!
|
105 |
<div style="text-align:center;">
|
106 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
107 |
<input type="hidden" name="cmd" value="_s-xclick">
|
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: 3.
|
8 |
Author URI: http://netweblogic.com/
|
9 |
Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
|
10 |
|
@@ -23,7 +23,6 @@ GNU General Public License for more details.
|
|
23 |
You should have received a copy of the GNU General Public License
|
24 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
25 |
*/
|
26 |
-
|
27 |
class LoginWithAjax {
|
28 |
|
29 |
/**
|
@@ -110,22 +109,24 @@ class LoginWithAjax {
|
|
110 |
}elseif ( function_exists('register_widget') ){ //WP < 2.8 safety check
|
111 |
$plugin_url = path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ));
|
112 |
//Enqueue scripts - Only one script enqueued here.... theme JS takes priority, then default JS
|
113 |
-
if(
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
|
|
129 |
}
|
130 |
|
131 |
//Register widget
|
@@ -165,36 +166,41 @@ class LoginWithAjax {
|
|
165 |
// Reads ajax login creds via POSt, calls the login script and interprets the result
|
166 |
function login(){
|
167 |
$return = array(); //What we send back
|
168 |
-
$
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
$
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
-
}
|
190 |
-
//User login failed
|
191 |
-
/* @var $loginResult WP_Error */
|
192 |
-
$return['result'] = false;
|
193 |
-
$return['error'] = $loginResult->get_error_message();
|
194 |
-
} else {
|
195 |
-
//Undefined Error
|
196 |
$return['result'] = false;
|
197 |
-
$return['error'] = __('
|
198 |
}
|
199 |
//Return the result array with errors etc.
|
200 |
return $return;
|
@@ -302,6 +308,7 @@ class LoginWithAjax {
|
|
302 |
}
|
303 |
//Do string replacements
|
304 |
$redirect = str_replace('%USERNAME%', $user->user_login, $redirect);
|
|
|
305 |
return $redirect;
|
306 |
}
|
307 |
|
@@ -485,8 +492,12 @@ if(is_admin()){
|
|
485 |
}
|
486 |
//Include widget
|
487 |
include_once('login-with-ajax-widget.php');
|
488 |
-
|
489 |
-
|
|
|
|
|
|
|
|
|
490 |
|
491 |
//Template Tag
|
492 |
function login_with_ajax($atts = ''){
|
@@ -498,4 +509,5 @@ function login_with_ajax($atts = ''){
|
|
498 |
// Start plugin
|
499 |
global $LoginWithAjax;
|
500 |
$LoginWithAjax = new LoginWithAjax();
|
|
|
501 |
?>
|
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: 3.0b3
|
8 |
Author URI: http://netweblogic.com/
|
9 |
Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
|
10 |
|
23 |
You should have received a copy of the GNU General Public License
|
24 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
25 |
*/
|
|
|
26 |
class LoginWithAjax {
|
27 |
|
28 |
/**
|
109 |
}elseif ( function_exists('register_widget') ){ //WP < 2.8 safety check
|
110 |
$plugin_url = path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) ));
|
111 |
//Enqueue scripts - Only one script enqueued here.... theme JS takes priority, then default JS
|
112 |
+
if( !is_admin() ) {
|
113 |
+
if( file_exists(get_stylesheet_directory().'/plugins/login-with-ajax/login-with-ajax.js') ){ //Child Theme (or just theme)
|
114 |
+
wp_enqueue_script( "login-with-ajax", get_stylesheet_directory_uri()."/plugins/login-with-ajax/login-with-ajax.js", array( 'jquery' ) );
|
115 |
+
}else if( file_exists(get_template_directory().'/plugins/login-with-ajax/login-with-ajax.js') ){ //Parent Theme (if parent exists)
|
116 |
+
wp_enqueue_script( "login-with-ajax", get_template_directory_uri()."/plugins/login-with-ajax/login-with-ajax.js", array( 'jquery' ) );
|
117 |
+
}else{ //Default file in plugin folder
|
118 |
+
wp_enqueue_script( "login-with-ajax", $plugin_url."/widget/login-with-ajax.js", array( 'jquery' ) );
|
119 |
+
}
|
120 |
+
wp_enqueue_script( "login-with-ajax-jquerytools", "http://cdn.jquerytools.org/1.2.2/all/jquery.tools.min.js", array( 'jquery' ) );
|
121 |
+
|
122 |
+
//Enqueue stylesheets - Only one style enqueued here.... theme CSS takes priority, then default CSS
|
123 |
+
if( file_exists(get_stylesheet_directory().'/plugins/login-with-ajax/widget.css') ){ //Child Theme (or just theme)
|
124 |
+
wp_enqueue_style( "login-with-ajax", get_stylesheet_directory_uri().'/plugins/login-with-ajax/widget.css' );
|
125 |
+
}else if( file_exists(get_template_directory().'/plugins/login-with-ajax/widget.css') ){ //Parent Theme (if parent exists)
|
126 |
+
wp_enqueue_style( "login-with-ajax", get_template_directory_uri().'/plugins/login-with-ajax/widget.css' );
|
127 |
+
}else{ //Default file in plugin folder
|
128 |
+
wp_enqueue_style( "login-with-ajax", $plugin_url."/widget/widget.css" );
|
129 |
+
}
|
130 |
}
|
131 |
|
132 |
//Register widget
|
166 |
// Reads ajax login creds via POSt, calls the login script and interprets the result
|
167 |
function login(){
|
168 |
$return = array(); //What we send back
|
169 |
+
if( !empty($_REQUEST['log']) && !empty($_REQUEST['pwd']) && trim($_REQUEST['log']) != '' && trim($_REQUEST['pwd'] != '') ){
|
170 |
+
$loginResult = wp_signon();
|
171 |
+
$user_role = 'null';
|
172 |
+
if ( strtolower(get_class($loginResult)) == 'wp_user' ) {
|
173 |
+
//User login successful
|
174 |
+
$this->current_user = $loginResult;
|
175 |
+
/* @var $loginResult WP_User */
|
176 |
+
$return['result'] = true;
|
177 |
+
$return['message'] = __("Login Successful, redirecting...",'login-with-ajax');
|
178 |
+
//Do a redirect if necessary
|
179 |
+
$redirect = $this->getLoginRedirect($this->current_user);
|
180 |
+
if( $redirect != '' ){
|
181 |
+
$return['redirect'] = $redirect;
|
182 |
+
}
|
183 |
+
//If the widget should just update with ajax, then supply the URL here.
|
184 |
+
if( $this->data['no_login_refresh'] == 1 ){
|
185 |
+
//Is this coming from a template?
|
186 |
+
$query_vars = ($_GET['template'] != '') ? "&template={$_GET['template']}" : '';
|
187 |
+
$query_vars .= ($_REQUEST['lwa_profile_link'] == '1') ? "&lwa_profile_link=1" : '';
|
188 |
+
$return['widget'] = get_bloginfo('wpurl')."?login-with-ajax-widget=1$query_vars";
|
189 |
+
$return['message'] = __("Login successful, updating...",'login-with-ajax');
|
190 |
+
}
|
191 |
+
} elseif ( strtolower(get_class($loginResult)) == 'wp_error' ) {
|
192 |
+
//User login failed
|
193 |
+
/* @var $loginResult WP_Error */
|
194 |
+
$return['result'] = false;
|
195 |
+
$return['error'] = $loginResult->get_error_message();
|
196 |
+
} else {
|
197 |
+
//Undefined Error
|
198 |
+
$return['result'] = false;
|
199 |
+
$return['error'] = __('An undefined error has ocurred', 'login-with-ajax');
|
200 |
}
|
201 |
+
}else{
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
$return['result'] = false;
|
203 |
+
$return['error'] = __('Please supply your username and password.', 'login-with-ajax');
|
204 |
}
|
205 |
//Return the result array with errors etc.
|
206 |
return $return;
|
308 |
}
|
309 |
//Do string replacements
|
310 |
$redirect = str_replace('%USERNAME%', $user->user_login, $redirect);
|
311 |
+
$redirect = str_replace("%LASTURL%", $_SERVER['HTTP_REFERER'], $redirect);
|
312 |
return $redirect;
|
313 |
}
|
314 |
|
492 |
}
|
493 |
//Include widget
|
494 |
include_once('login-with-ajax-widget.php');
|
495 |
+
|
496 |
+
//Include pluggable functions file if user specifies in settings
|
497 |
+
$lwa_data = get_option('lwa_data');
|
498 |
+
if( $lwa_data['notification_override'] == '1' ){
|
499 |
+
include_once('pluggable.php');
|
500 |
+
}
|
501 |
|
502 |
//Template Tag
|
503 |
function login_with_ajax($atts = ''){
|
509 |
// Start plugin
|
510 |
global $LoginWithAjax;
|
511 |
$LoginWithAjax = new LoginWithAjax();
|
512 |
+
|
513 |
?>
|
pluggable.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
//Replace the user registration welcome email
|
4 |
if ( !function_exists('wp_new_user_notification') ) :
|
5 |
/**
|
1 |
<?php
|
|
|
2 |
//Replace the user registration welcome email
|
3 |
if ( !function_exists('wp_new_user_notification') ) :
|
4 |
/**
|
readme.txt
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
=== Login With Ajax ===
|
2 |
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: 3.
|
7 |
|
8 |
Add smooth ajax login and registration effects to your blog and choose where users get redirected upon login/logout. Supports SSL, MU, and BuddyPress.
|
9 |
|
@@ -152,5 +153,11 @@ For further questions and answers (or to submit one yourself) go to our [http://
|
|
152 |
* Improved JavaScript code
|
153 |
* Ajax Registration Option
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
= 3.0 (coming soon) =
|
156 |
* Option to choose from various widget templates.
|
1 |
=== Login With Ajax ===
|
2 |
Contributors: netweblogic
|
3 |
+
Donate link: http://netweblogic.com/wordpress/plugins/login-with-ajax/
|
4 |
Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
|
5 |
Requires at least: 2.8
|
6 |
+
Tested up to: 3.0.1
|
7 |
+
Stable tag: 3.0b3
|
8 |
|
9 |
Add smooth ajax login and registration effects to your blog and choose where users get redirected upon login/logout. Supports SSL, MU, and BuddyPress.
|
10 |
|
153 |
* Improved JavaScript code
|
154 |
* Ajax Registration Option
|
155 |
|
156 |
+
= 3.0b3 =
|
157 |
+
* %LASTURL% now works for logins as well
|
158 |
+
* Profile link plays nice with buddypress
|
159 |
+
* Added fix to stop wp_new_user_notification conflicts
|
160 |
+
* Empty logins now have an error message too.
|
161 |
+
|
162 |
= 3.0 (coming soon) =
|
163 |
* Option to choose from various widget templates.
|
widget/default/register.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Taken from wp-login.php
|
4 |
+
* If you place a register.php file in your lwa template folder, you'll have it inserted automatically at the footer
|
5 |
+
* of your theme, providing it calls the wp_footer action.
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<div id="LoginWithAjax_Register" style="display:none;" class="default">
|
9 |
+
<h4 class="message register"><?php _e('Register For This Site') ?></h4>
|
10 |
+
<form name="registerform" id="registerform" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
|
11 |
+
<p>
|
12 |
+
<label><?php _e('Username') ?><br />
|
13 |
+
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label>
|
14 |
+
</p>
|
15 |
+
<p>
|
16 |
+
<label><?php _e('E-mail') ?><br />
|
17 |
+
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(stripslashes($user_email)); ?>" size="25" tabindex="20" /></label>
|
18 |
+
</p>
|
19 |
+
<?php do_action('register_form'); ?>
|
20 |
+
<p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
|
21 |
+
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p>
|
22 |
+
<input type="hidden" name="lwa" value="1" />
|
23 |
+
</form>
|
24 |
+
</div>
|
25 |
+
<script type="text/javascript">
|
26 |
+
jQuery(document).ready(function($) {
|
27 |
+
var triggers = $("#LoginWithAjax_Links_Register").overlay({
|
28 |
+
mask: {
|
29 |
+
color: '#ebecff',
|
30 |
+
loadSpeed: 200,
|
31 |
+
opacity: 0.9
|
32 |
+
},
|
33 |
+
closeOnClick: true
|
34 |
+
});
|
35 |
+
});
|
36 |
+
</script>
|
widget/default/widget_in.php
CHANGED
@@ -30,9 +30,15 @@
|
|
30 |
<?php
|
31 |
//Admin URL
|
32 |
if ( $lwa_data['profile_link'] == '1' ) {
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
//Logout URL
|
38 |
?>
|
30 |
<?php
|
31 |
//Admin URL
|
32 |
if ( $lwa_data['profile_link'] == '1' ) {
|
33 |
+
if( function_exists('bp_loggedin_user_link') ){
|
34 |
+
?>
|
35 |
+
<a href="<?php bp_loggedin_user_link(); ?>"><?php echo strtolower(__('Profile')) ?></a><br/>
|
36 |
+
<?php
|
37 |
+
}else{
|
38 |
+
?>
|
39 |
+
<a href="<?php bloginfo('url') ?>/wp-admin/profile.php"><?php echo strtolower(__('Profile')) ?></a><br/>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
}
|
43 |
//Logout URL
|
44 |
?>
|
widget/widget.css
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
#LoginWithAjax { margin-bottom:10px; position:relative; font-size:1em; }
|
2 |
#LoginWithAjax td { padding-top:7px; vertical-align:top; background-color:none; }
|
3 |
|
1 |
+
@charset "utf-8";
|
2 |
#LoginWithAjax { margin-bottom:10px; position:relative; font-size:1em; }
|
3 |
#LoginWithAjax td { padding-top:7px; vertical-align:top; background-color:none; }
|
4 |
|