Version Description
- Filterable error classes
- Tweak to how SSL logins are handled.
- FR translation
- Fix $link_cap
Download this release
Release Info
Developer | jolley_small |
Plugin | Sidebar Login |
Version | 2.5.1 |
Comparing to | |
See all releases |
Code changes from version 2.5.0 to 2.5.1
- assets/js/sidebar-login.js +5 -5
- assets/js/sidebar-login.min.js +1 -1
- includes/class-sidebar-login-widget.php +3 -2
- languages/sidebar_login-fr_FR.mo +0 -0
- languages/sidebar_login-fr_FR.po +125 -0
- readme.txt +7 -1
- sidebar-login.php +8 -5
assets/js/sidebar-login.js
CHANGED
@@ -6,23 +6,23 @@ jQuery(function(){
|
|
6 |
var $thisform = jQuery( this );
|
7 |
var action = $thisform.attr('action');
|
8 |
|
9 |
-
jQuery('.
|
10 |
|
11 |
// Check required fields as a minimum
|
12 |
var user_login = $thisform.find('input[name="log"]').val();
|
13 |
var user_password = $thisform.find('input[name="pwd"]').val();
|
14 |
|
15 |
if ( ! user_login ) {
|
16 |
-
$thisform.prepend('<p class="
|
17 |
return false;
|
18 |
}
|
19 |
if ( ! user_password ) {
|
20 |
-
|
21 |
return false;
|
22 |
}
|
23 |
|
24 |
// Check for SSL/FORCE SSL LOGIN
|
25 |
-
if (
|
26 |
return true;
|
27 |
|
28 |
$thisform.block({ message: null, overlayCSS: {
|
@@ -54,7 +54,7 @@ jQuery(function(){
|
|
54 |
if ( result.success == 1 ) {
|
55 |
window.location = result.redirect;
|
56 |
} else {
|
57 |
-
$thisform.prepend('<p class="
|
58 |
$thisform.unblock();
|
59 |
}
|
60 |
}
|
6 |
var $thisform = jQuery( this );
|
7 |
var action = $thisform.attr('action');
|
8 |
|
9 |
+
jQuery('.'+sidebar_login_params.error_class).remove();
|
10 |
|
11 |
// Check required fields as a minimum
|
12 |
var user_login = $thisform.find('input[name="log"]').val();
|
13 |
var user_password = $thisform.find('input[name="pwd"]').val();
|
14 |
|
15 |
if ( ! user_login ) {
|
16 |
+
$thisform.prepend('<p class="' + sidebar_login_params.error_class + '">' + sidebar_login_params.i18n_username_required + '</p>');
|
17 |
return false;
|
18 |
}
|
19 |
if ( ! user_password ) {
|
20 |
+
$thisform.prepend('<p class="' + sidebar_login_params.error_class + '">' + sidebar_login_params.i18n_password_required + '</p>');
|
21 |
return false;
|
22 |
}
|
23 |
|
24 |
// Check for SSL/FORCE SSL LOGIN
|
25 |
+
if ( sidebar_login_params.force_ssl_login == 1 && sidebar_login_params.is_ssl == 0 )
|
26 |
return true;
|
27 |
|
28 |
$thisform.block({ message: null, overlayCSS: {
|
54 |
if ( result.success == 1 ) {
|
55 |
window.location = result.redirect;
|
56 |
} else {
|
57 |
+
$thisform.prepend('<p class="' + sidebar_login_params.error_class + '">' + result.error + '</p>');
|
58 |
$thisform.unblock();
|
59 |
}
|
60 |
}
|
assets/js/sidebar-login.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(){jQuery(".widget_wp_sidebarlogin form").submit(function(){var e=jQuery(this),t=e.attr("action");jQuery(".
|
1 |
+
jQuery(function(){jQuery(".widget_wp_sidebarlogin form").submit(function(){var e=jQuery(this),t=e.attr("action");jQuery("."+sidebar_login_params.error_class).remove();var n=e.find('input[name="log"]').val(),r=e.find('input[name="pwd"]').val();if(!n){e.prepend('<p class="'+sidebar_login_params.error_class+'">'+sidebar_login_params.i18n_username_required+"</p>");return!1}if(!r){e.prepend('<p class="'+sidebar_login_params.error_class+'">'+sidebar_login_params.i18n_password_required+"</p>");return!1}if(sidebar_login_params.force_ssl_login==1&&sidebar_login_params.is_ssl==0)return!0;e.block({message:null,overlayCSS:{backgroundColor:"#fff",opacity:.6}});e.find('input[name="rememberme"]:checked').size()>0?remember=e.find('input[name="rememberme"]:checked').val():remember="";var i={action:"sidebar_login_process",security:sidebar_login_params.login_nonce,user_login:n,user_password:r,remember:remember,redirect_to:e.find('input[name="redirect_to"]').val()};jQuery.ajax({url:sidebar_login_params.ajax_url,data:i,type:"POST",success:function(t){if(t.success==1)window.location=t.redirect;else{e.prepend('<p class="'+sidebar_login_params.error_class+'">'+t.error+"</p>");e.unblock()}}});return!1})});
|
includes/class-sidebar-login-widget.php
CHANGED
@@ -134,7 +134,8 @@ class Sidebar_Login_Widget extends WP_Widget {
|
|
134 |
$raw_links = array_map( 'trim', explode( "\n", $links ) );
|
135 |
$links = array();
|
136 |
foreach ( $raw_links as $link ) {
|
137 |
-
$link
|
|
|
138 |
|
139 |
if ( sizeof( $link ) == 3 )
|
140 |
list( $link_text, $link_href, $link_cap ) = $link;
|
@@ -145,7 +146,7 @@ class Sidebar_Login_Widget extends WP_Widget {
|
|
145 |
|
146 |
// Check capability
|
147 |
if ( ! empty( $link_cap ) )
|
148 |
-
if ( ! current_user_can( $link_cap ) )
|
149 |
continue;
|
150 |
|
151 |
$links[ sanitize_title( $link_text ) ] = array(
|
134 |
$raw_links = array_map( 'trim', explode( "\n", $links ) );
|
135 |
$links = array();
|
136 |
foreach ( $raw_links as $link ) {
|
137 |
+
$link = array_map( 'trim', explode( '|', $link ) );
|
138 |
+
$link_cap = '';
|
139 |
|
140 |
if ( sizeof( $link ) == 3 )
|
141 |
list( $link_text, $link_href, $link_cap ) = $link;
|
146 |
|
147 |
// Check capability
|
148 |
if ( ! empty( $link_cap ) )
|
149 |
+
if ( ! current_user_can( strtolower( $link_cap ) ) )
|
150 |
continue;
|
151 |
|
152 |
$links[ sanitize_title( $link_text ) ] = array(
|
languages/sidebar_login-fr_FR.mo
ADDED
Binary file
|
languages/sidebar_login-fr_FR.po
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: sidebar-login\n"
|
4 |
+
"POT-Creation-Date: 2013-04-02 16:11+0100\n"
|
5 |
+
"PO-Revision-Date: 2013-04-02 16:29+0100\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Generator: Poedit 1.5.4\n"
|
12 |
+
"X-Poedit-KeywordsList: _e;__;_n\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-SearchPath-0: ../.\n"
|
15 |
+
"X-Poedit-SearchPath-1: .\n"
|
16 |
+
|
17 |
+
#: .././sidebar-login.php:79
|
18 |
+
msgid "Please enter your username"
|
19 |
+
msgstr "Renseignez votre identifiant s'il vous plait"
|
20 |
+
|
21 |
+
#: .././sidebar-login.php:80
|
22 |
+
msgid "Please enter your password"
|
23 |
+
msgstr "Renseignez votre mot de passe s'il vous plait"
|
24 |
+
|
25 |
+
#: .././sidebar-login.php:166
|
26 |
+
msgid "Please enter your username and password to login."
|
27 |
+
msgstr "Renseignez votre identifiant et votre mot de passe s'il vous plait"
|
28 |
+
|
29 |
+
#: .././includes/class-sidebar-login-widget.php:23
|
30 |
+
msgid "Displays a login area in the sidebar."
|
31 |
+
msgstr "Affiche une zone de connexion dans la sidebar."
|
32 |
+
|
33 |
+
#: .././includes/class-sidebar-login-widget.php:26
|
34 |
+
msgid "Sidebar Login"
|
35 |
+
msgstr "Sidebar Connexion"
|
36 |
+
|
37 |
+
#: .././includes/class-sidebar-login-widget.php:39
|
38 |
+
msgid "Logged-out title"
|
39 |
+
msgstr "Titre (état déconnecté)"
|
40 |
+
|
41 |
+
#: .././includes/class-sidebar-login-widget.php:40
|
42 |
+
#: .././includes/class-sidebar-login-widget.php:225
|
43 |
+
msgid "Login"
|
44 |
+
msgstr "Connexion"
|
45 |
+
|
46 |
+
#: .././includes/class-sidebar-login-widget.php:44
|
47 |
+
#: .././includes/class-sidebar-login-widget.php:74
|
48 |
+
msgid "Links"
|
49 |
+
msgstr "Liens"
|
50 |
+
|
51 |
+
#: .././includes/class-sidebar-login-widget.php:44
|
52 |
+
msgid "<code>Text | HREF</code>"
|
53 |
+
msgstr "<code>Texte | HREF</code>"
|
54 |
+
|
55 |
+
#: .././includes/class-sidebar-login-widget.php:49
|
56 |
+
msgid "Show lost password link"
|
57 |
+
msgstr "Montrer le lien mot de passe perdu"
|
58 |
+
|
59 |
+
#: .././includes/class-sidebar-login-widget.php:54
|
60 |
+
msgid "Show register link"
|
61 |
+
msgstr "Montrer le lien d'enregistrement"
|
62 |
+
|
63 |
+
#: .././includes/class-sidebar-login-widget.php:56
|
64 |
+
#, php-format
|
65 |
+
msgid "<a href=\"%s\">Anyone can register</a> must be enabled."
|
66 |
+
msgstr "<a href=\"%s\">Tout le monde peut s'enregister</a> doit être actif."
|
67 |
+
|
68 |
+
#: .././includes/class-sidebar-login-widget.php:60
|
69 |
+
msgid "Login Redirect URL"
|
70 |
+
msgstr "URL de redirection (connexion)"
|
71 |
+
|
72 |
+
#: .././includes/class-sidebar-login-widget.php:69
|
73 |
+
msgid "Logged-in title"
|
74 |
+
msgstr "Titre (état connecté)"
|
75 |
+
|
76 |
+
#: .././includes/class-sidebar-login-widget.php:70
|
77 |
+
#: .././includes/class-sidebar-login-widget.php:224
|
78 |
+
msgid "Welcome %username%"
|
79 |
+
msgstr "Bienvenue %username%"
|
80 |
+
|
81 |
+
#: .././includes/class-sidebar-login-widget.php:74
|
82 |
+
msgid "<code>Text | HREF | Capability</code>"
|
83 |
+
msgstr "<code>Texte | HREF | Capacité</code>"
|
84 |
+
|
85 |
+
#: .././includes/class-sidebar-login-widget.php:75
|
86 |
+
#, php-format
|
87 |
+
msgid ""
|
88 |
+
"<a href=\"%s\">Capability</a> (optional) refers to the type of user who can "
|
89 |
+
"view the link."
|
90 |
+
msgstr ""
|
91 |
+
"<a href=\"%s\">Capacité</a> (optionnel) se base sur le type d'utilisateur "
|
92 |
+
"qui peut voir le lien."
|
93 |
+
|
94 |
+
#: .././includes/class-sidebar-login-widget.php:80
|
95 |
+
msgid "Show logged-in user avatar"
|
96 |
+
msgstr "Montrer l'avatar de l'utilisateur connecté"
|
97 |
+
|
98 |
+
#: .././includes/class-sidebar-login-widget.php:85
|
99 |
+
msgid "Logout Redirect URL"
|
100 |
+
msgstr "URL de redirection (déconnexion)"
|
101 |
+
|
102 |
+
#: .././includes/class-sidebar-login-widget.php:164
|
103 |
+
#: .././includes/class-sidebar-login-widget.php:171
|
104 |
+
msgid "Register"
|
105 |
+
msgstr "S'enregistrer"
|
106 |
+
|
107 |
+
#: .././includes/class-sidebar-login-widget.php:181
|
108 |
+
msgid "Lost Password"
|
109 |
+
msgstr "Mot de passe perdu ?"
|
110 |
+
|
111 |
+
#: .././includes/class-sidebar-login-widget.php:271
|
112 |
+
msgid "Username"
|
113 |
+
msgstr "Identifiant"
|
114 |
+
|
115 |
+
#: .././includes/class-sidebar-login-widget.php:272
|
116 |
+
msgid "Password"
|
117 |
+
msgstr "Mot de passe"
|
118 |
+
|
119 |
+
#: .././includes/class-sidebar-login-widget.php:273
|
120 |
+
msgid "Remember Me"
|
121 |
+
msgstr "Me retenir"
|
122 |
+
|
123 |
+
#: .././includes/class-sidebar-login-widget.php:274
|
124 |
+
msgid "Login →"
|
125 |
+
msgstr "Connexion →"
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mike.jol
|
|
4 |
Tags: login, sidebar, widget, sidebar login, meta, form, register
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.5
|
7 |
-
Stable tag: 2.5.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -70,6 +70,12 @@ These tags can be used in the widget settings for titles + links and will be rep
|
|
70 |
|
71 |
== Changelog ==
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
= 2.5.0 =
|
74 |
* Rewrite and code cleanup - class based.
|
75 |
* Optionless - Moved all settings to the widgets themselves rather than having a settings page.
|
4 |
Tags: login, sidebar, widget, sidebar login, meta, form, register
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.5
|
7 |
+
Stable tag: 2.5.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
70 |
|
71 |
== Changelog ==
|
72 |
|
73 |
+
= 2.5.1 =
|
74 |
+
* Filterable error classes
|
75 |
+
* Tweak to how SSL logins are handled.
|
76 |
+
* FR translation
|
77 |
+
* Fix $link_cap
|
78 |
+
|
79 |
= 2.5.0 =
|
80 |
* Rewrite and code cleanup - class based.
|
81 |
* Optionless - Moved all settings to the widgets themselves rather than having a settings page.
|
sidebar-login.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
Plugin Name: Sidebar Login
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/sidebar-login/
|
5 |
Description: Allows you to easily add an ajax-enhanced login widget to your WordPress blog sidebar.
|
6 |
-
Version: 2.5.
|
7 |
Author: Mike Jolley
|
8 |
Author URI: http://mikejolley.com
|
9 |
Requires at least: 3.5
|
10 |
Tested up to: 3.5
|
11 |
|
12 |
-
Copyright:
|
13 |
License: GNU General Public License v3.0
|
14 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
15 |
*/
|
@@ -19,7 +19,7 @@ Tested up to: 3.5
|
|
19 |
*/
|
20 |
class Sidebar_Login {
|
21 |
|
22 |
-
private $version = '2.5.
|
23 |
|
24 |
/**
|
25 |
* __construct function.
|
@@ -56,13 +56,15 @@ class Sidebar_Login {
|
|
56 |
*/
|
57 |
public function enqueue() {
|
58 |
|
|
|
|
|
59 |
$js_in_footer = apply_filters( 'sidebar_login_js_in_footer', false );
|
60 |
|
61 |
// Register BLOCK UI
|
62 |
wp_register_script( 'jquery-blockui', plugins_url( 'assets/js/blockui.min.js', __FILE__ ), array( 'jquery' ), '2.57', $js_in_footer );
|
63 |
|
64 |
// Enqueue Sidebar Login JS
|
65 |
-
wp_enqueue_script( 'sidebar-login', plugins_url( 'assets/js/sidebar-login.
|
66 |
|
67 |
// Enqueue Styles
|
68 |
if ( apply_filters( 'sidebar_login_include_css', true ) ) {
|
@@ -77,7 +79,8 @@ class Sidebar_Login {
|
|
77 |
'force_ssl_admin' => force_ssl_admin() ? 1 : 0,
|
78 |
'is_ssl' => is_ssl() ? 1 : 0,
|
79 |
'i18n_username_required' => __( 'Please enter your username', 'sidebar_login' ),
|
80 |
-
'i18n_password_required' => __( 'Please enter your password', 'sidebar_login' )
|
|
|
81 |
);
|
82 |
|
83 |
wp_localize_script( 'sidebar-login', 'sidebar_login_params', $sidebar_login_params );
|
3 |
Plugin Name: Sidebar Login
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/sidebar-login/
|
5 |
Description: Allows you to easily add an ajax-enhanced login widget to your WordPress blog sidebar.
|
6 |
+
Version: 2.5.1
|
7 |
Author: Mike Jolley
|
8 |
Author URI: http://mikejolley.com
|
9 |
Requires at least: 3.5
|
10 |
Tested up to: 3.5
|
11 |
|
12 |
+
Copyright: 2013 Mike Jolley.
|
13 |
License: GNU General Public License v3.0
|
14 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
15 |
*/
|
19 |
*/
|
20 |
class Sidebar_Login {
|
21 |
|
22 |
+
private $version = '2.5.1';
|
23 |
|
24 |
/**
|
25 |
* __construct function.
|
56 |
*/
|
57 |
public function enqueue() {
|
58 |
|
59 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
60 |
+
|
61 |
$js_in_footer = apply_filters( 'sidebar_login_js_in_footer', false );
|
62 |
|
63 |
// Register BLOCK UI
|
64 |
wp_register_script( 'jquery-blockui', plugins_url( 'assets/js/blockui.min.js', __FILE__ ), array( 'jquery' ), '2.57', $js_in_footer );
|
65 |
|
66 |
// Enqueue Sidebar Login JS
|
67 |
+
wp_enqueue_script( 'sidebar-login', plugins_url( 'assets/js/sidebar-login' . $suffix . '.js', __FILE__ ), array( 'jquery', 'jquery-blockui' ), $this->version, $js_in_footer );
|
68 |
|
69 |
// Enqueue Styles
|
70 |
if ( apply_filters( 'sidebar_login_include_css', true ) ) {
|
79 |
'force_ssl_admin' => force_ssl_admin() ? 1 : 0,
|
80 |
'is_ssl' => is_ssl() ? 1 : 0,
|
81 |
'i18n_username_required' => __( 'Please enter your username', 'sidebar_login' ),
|
82 |
+
'i18n_password_required' => __( 'Please enter your password', 'sidebar_login' ),
|
83 |
+
'error_class' => apply_filters( 'sidebar_login_widget_error_class', 'sidebar_login_error' )
|
84 |
);
|
85 |
|
86 |
wp_localize_script( 'sidebar-login', 'sidebar_login_params', $sidebar_login_params );
|