Version Description
- Min level setting for links. Add user level after |true when defining the logged in links.
- Moved 'settings' from tools to settings.
- Encoded ampersand for valid markup
- Moved Labels about
- Fixed SSL url
- Reusable widget
Download this release
Release Info
Developer | jolley_small |
Plugin | Sidebar Login |
Version | 2.2.8 |
Comparing to | |
See all releases |
Code changes from version 2.2.7 to 2.2.8
- langs/sblogin-tr_TR.mo +0 -0
- langs/sblogin-tr_TR.po +125 -0
- readme.txt +79 -69
- sidebar-login.php +475 -467
langs/sblogin-tr_TR.mo
ADDED
Binary file
|
langs/sblogin-tr_TR.po
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: sidebar-login\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2009-06-03 11:43+0100\n"
|
6 |
+
"PO-Revision-Date: 2009-08-24 18:41+0200\n"
|
7 |
+
"Last-Translator: tribak <tribak.zero@gmail.com>\n"
|
8 |
+
"Language-Team: Türlçe <muzo178@gmail.com>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-Language: Turkish\n"
|
13 |
+
"X-Poedit-Country: TURKEY\n"
|
14 |
+
|
15 |
+
#: sidebar-login.php:14
|
16 |
+
#: sidebar-login.php:57
|
17 |
+
msgid "Sidebar Login"
|
18 |
+
msgstr "Sidebar Login"
|
19 |
+
|
20 |
+
#: sidebar-login.php:46
|
21 |
+
msgid "<p>Changes saved</p>"
|
22 |
+
msgstr "<p>Değişiklikler kaydedildi</p>"
|
23 |
+
|
24 |
+
#: sidebar-login.php:62
|
25 |
+
msgid "Login redirect URL"
|
26 |
+
msgstr "Giriş sonrası yönlendirme URL"
|
27 |
+
|
28 |
+
#: sidebar-login.php:63
|
29 |
+
msgid "Url to redirect the user to after login. Leave blank to use their current page."
|
30 |
+
msgstr "Kullanıcı giriş yaptıktan sonra yönlendirileceği adres. Bulundukları sayfada kalmalarını istiyorsanız boş bırakınız."
|
31 |
+
|
32 |
+
#: sidebar-login.php:66
|
33 |
+
msgid "Logout redirect URL"
|
34 |
+
msgstr "Çıkış sonrası yönlendirme URL"
|
35 |
+
|
36 |
+
#: sidebar-login.php:67
|
37 |
+
msgid "Url to redirect the user to after logout. Leave blank to use their current page."
|
38 |
+
msgstr "Kullanıcı çıkış yaptıktan sonra yönlendirileceği adres. Bulundukları sayfada kalmalarını istiyorsanız boş bırakınız."
|
39 |
+
|
40 |
+
#: sidebar-login.php:70
|
41 |
+
msgid "Show Register Link"
|
42 |
+
msgstr "Kayıt olma linkini göster"
|
43 |
+
|
44 |
+
#: sidebar-login.php:72
|
45 |
+
#: sidebar-login.php:79
|
46 |
+
msgid "Yes"
|
47 |
+
msgstr "Evet"
|
48 |
+
|
49 |
+
#: sidebar-login.php:73
|
50 |
+
#: sidebar-login.php:80
|
51 |
+
msgid "No"
|
52 |
+
msgstr "Hayır"
|
53 |
+
|
54 |
+
#: sidebar-login.php:74
|
55 |
+
msgid "User registrations must also be turned on for this to work ('Anyone can register' checkbox in settings)."
|
56 |
+
msgstr "Bu opsiyonun çalışması için kayıt açık olmalı (Ayarlar > 'İsteyen herkes kayıt olabilsin')"
|
57 |
+
|
58 |
+
#: sidebar-login.php:77
|
59 |
+
msgid "Show Lost Password Link"
|
60 |
+
msgstr "Kayıp parola linkini göster"
|
61 |
+
|
62 |
+
#: sidebar-login.php:84
|
63 |
+
msgid "Logged in links"
|
64 |
+
msgstr "Giriş yapılınca gösterilecek linkler"
|
65 |
+
|
66 |
+
#: sidebar-login.php:85
|
67 |
+
msgid "One link per line. Note: Logout link will always show regardless. Tip: Add <code>|true</code> after a link to only show it to admin users. Default: <br/><a href=\""
|
68 |
+
msgstr "Her satıra bir link. Not: Çıkış linki her zaman gösterilir. İpucu: Linkten sonra <code>|true</code> eklerseniz linki sadece Adminler görebilir. Varsayılan: <br/><a href=\""
|
69 |
+
|
70 |
+
#: sidebar-login.php:89
|
71 |
+
msgid "Save Changes"
|
72 |
+
msgstr "Değişiklikleri kaydet"
|
73 |
+
|
74 |
+
#: sidebar-login.php:120
|
75 |
+
msgid "Login"
|
76 |
+
msgstr "Giriş yap"
|
77 |
+
|
78 |
+
#: sidebar-login.php:121
|
79 |
+
msgid "Welcome"
|
80 |
+
msgstr "Merhaba"
|
81 |
+
|
82 |
+
#: sidebar-login.php:122
|
83 |
+
msgid "Username:"
|
84 |
+
msgstr "Kullanıcı Adı:"
|
85 |
+
|
86 |
+
#: sidebar-login.php:123
|
87 |
+
msgid "Password:"
|
88 |
+
msgstr "Parola:"
|
89 |
+
|
90 |
+
#: sidebar-login.php:124
|
91 |
+
msgid "Remember me"
|
92 |
+
msgstr "Beni hatırla"
|
93 |
+
|
94 |
+
#: sidebar-login.php:125
|
95 |
+
msgid "Register"
|
96 |
+
msgstr "Kayıt ol"
|
97 |
+
|
98 |
+
#: sidebar-login.php:126
|
99 |
+
msgid "Password Lost and Found"
|
100 |
+
msgstr "Kayıp parola"
|
101 |
+
|
102 |
+
#: sidebar-login.php:127
|
103 |
+
msgid "Lost your password?"
|
104 |
+
msgstr "Parolanızı mı unuttunuz?"
|
105 |
+
|
106 |
+
#: sidebar-login.php:128
|
107 |
+
msgid "Logout"
|
108 |
+
msgstr "Çıkış"
|
109 |
+
|
110 |
+
#: sidebar-login.php:246
|
111 |
+
msgid "Dashboard"
|
112 |
+
msgstr "Başlangıç"
|
113 |
+
|
114 |
+
#: sidebar-login.php:246
|
115 |
+
msgid "Profile"
|
116 |
+
msgstr "Profil"
|
117 |
+
|
118 |
+
#: sidebar-login.php:292
|
119 |
+
msgid "<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."
|
120 |
+
msgstr "<strong>HATA</strong>: Cookieler tarayıcınız tarafından bloke ediliyor. Wordpress kullanabilmek için<a href=\"http://www.google.com/support/accounts/bin/answer.py?hl=es&answer=61416\">cookieleri</a> etkinleştirmelisiniz."
|
121 |
+
|
122 |
+
#: sidebar-login.php:300
|
123 |
+
msgid "<strong>ERROR</strong>: Please enter a username & password."
|
124 |
+
msgstr "<strong>HATA</strong>: Lütfen kullanıcı adı ve şifre giriniz."
|
125 |
+
|
readme.txt
CHANGED
@@ -1,69 +1,79 @@
|
|
1 |
-
=== Plugin Name ===
|
2 |
-
Contributors: jolley_small
|
3 |
-
Donate link: http://blue-anvil.com/archives/wordpress-sidebar-login-2-optimised-for-wordpress-26
|
4 |
-
Tags: login, sidebar, widget, sidebar login, meta, form, register
|
5 |
-
Requires at least: 2.5
|
6 |
-
Tested up to: 2.
|
7 |
-
Stable tag: 2.2.
|
8 |
-
|
9 |
-
Adds a sidebar widget to let users login.
|
10 |
-
|
11 |
-
== Description ==
|
12 |
-
|
13 |
-
Sidebar-Login has both a widget and a template tag to allow you to have a login form in the sidebar of your wordpress powered blog.
|
14 |
-
|
15 |
-
It lets users login, and then redirects them back to the page they logged in from rather than the backend, it also shows error messages.
|
16 |
-
|
17 |
-
You can configure the plugin in <code>Admin > Tools > Sidebar Login</code> after installing it.
|
18 |
-
|
19 |
-
= Localization Files =
|
20 |
-
|
21 |
-
Czech Translation - http://wordpress.blog.mantlik.cz/plugins/sblogin-cs/
|
22 |
-
Catalan Translation by Marc Vinyals
|
23 |
-
French Translation by Andy
|
24 |
-
Estonian Translation by Marko Punnar
|
25 |
-
Dutch Translation by Ruben Janssen
|
26 |
-
German Translation by GhostLyrics
|
27 |
-
Italian Translation by Alessandro Spadavecchia
|
28 |
-
Hungarian translation by Laszlo Dvornik
|
29 |
-
Hungarian (2) translation by Balint Vereskuti
|
30 |
-
Russian translation by Fat Cow (http://www.fatcow.com)
|
31 |
-
Romanian translation by Victor Osorhan
|
32 |
-
Spanish translation by Tribak (http://blog.tribak.org/sidebar-login-es_es/)
|
33 |
-
Spanish (2) translation by Ricardo Vilella (http://www.ifconfig.com.ar/general/traduccion-al-espanol-del-plugin-sidebar-login-para-wordpress/)
|
34 |
-
Danish translation by Per Bovbjerg
|
35 |
-
Portuguese translation by Alvaro Becker
|
36 |
-
Polish translation by merito
|
37 |
-
Polish (2) translation by Darek Wapinski
|
38 |
-
Icelandic translation by
|
39 |
-
Arabic translation by khalid
|
40 |
-
Persian(farsi) translation Amir Beitollahi
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
*
|
68 |
-
*
|
69 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: jolley_small
|
3 |
+
Donate link: http://blue-anvil.com/archives/wordpress-sidebar-login-2-optimised-for-wordpress-26
|
4 |
+
Tags: login, sidebar, widget, sidebar login, meta, form, register
|
5 |
+
Requires at least: 2.5
|
6 |
+
Tested up to: 2.9
|
7 |
+
Stable tag: 2.2.8
|
8 |
+
|
9 |
+
Adds a sidebar widget to let users login. Displayed links can be changed from the <a href="options-general.php?page=Sidebar%20Login">settings page</a>.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
Sidebar-Login has both a widget and a template tag to allow you to have a login form in the sidebar of your wordpress powered blog.
|
14 |
+
|
15 |
+
It lets users login, and then redirects them back to the page they logged in from rather than the backend, it also shows error messages.
|
16 |
+
|
17 |
+
You can configure the plugin in <code>Admin > Tools > Sidebar Login</code> after installing it.
|
18 |
+
|
19 |
+
= Localization Files =
|
20 |
+
|
21 |
+
Czech Translation - http://wordpress.blog.mantlik.cz/plugins/sblogin-cs/
|
22 |
+
Catalan Translation by Marc Vinyals
|
23 |
+
French Translation by Andy
|
24 |
+
Estonian Translation by Marko Punnar
|
25 |
+
Dutch Translation by Ruben Janssen
|
26 |
+
German Translation by GhostLyrics
|
27 |
+
Italian Translation by Alessandro Spadavecchia
|
28 |
+
Hungarian translation by Laszlo Dvornik
|
29 |
+
Hungarian (2) translation by Balint Vereskuti
|
30 |
+
Russian translation by Fat Cow (http://www.fatcow.com)
|
31 |
+
Romanian translation by Victor Osorhan
|
32 |
+
Spanish translation by Tribak (http://blog.tribak.org/sidebar-login-es_es/)
|
33 |
+
Spanish (2) translation by Ricardo Vilella (http://www.ifconfig.com.ar/general/traduccion-al-espanol-del-plugin-sidebar-login-para-wordpress/)
|
34 |
+
Danish translation by Per Bovbjerg
|
35 |
+
Portuguese translation by Alvaro Becker
|
36 |
+
Polish translation by merito
|
37 |
+
Polish (2) translation by Darek Wapinski
|
38 |
+
Icelandic translation by Hákon Ásgeirsson
|
39 |
+
Arabic translation by khalid
|
40 |
+
Persian(farsi) translation Amir Beitollahi
|
41 |
+
Turkish translation by Muzo B
|
42 |
+
Chinese translation by seven - http://www.anchuang.org
|
43 |
+
|
44 |
+
Note: Those with more than one translation are found in langs/alternate/. To use the alternatives move them from /alternate/ into /langs/.
|
45 |
+
|
46 |
+
== Installation ==
|
47 |
+
|
48 |
+
= First time installation instructions =
|
49 |
+
|
50 |
+
1. Unzip and upload the php file to your wordpress plugin directory
|
51 |
+
2. Activate the plugin
|
52 |
+
3. For a sidebar widget: Goto the design > widgets tab - Drag the widget into a sidebar and save!
|
53 |
+
4. To use the template tag: Add <?php sidebarlogin(); ?> to your template.
|
54 |
+
|
55 |
+
= Configuration =
|
56 |
+
|
57 |
+
You will find a config page in tools/settings > Sidebar Login. Here you can set links and redirects up.
|
58 |
+
|
59 |
+
== Screenshots ==
|
60 |
+
|
61 |
+
1. Login Form
|
62 |
+
2. After Login
|
63 |
+
|
64 |
+
== Changelog ==
|
65 |
+
|
66 |
+
= 2.2.8 =
|
67 |
+
* Min level setting for links. Add user level after |true when defining the logged in links.
|
68 |
+
* Moved 'settings' from tools to settings.
|
69 |
+
* Encoded ampersand for valid markup
|
70 |
+
* Moved Labels about
|
71 |
+
* Fixed SSL url
|
72 |
+
* Reusable widget
|
73 |
+
|
74 |
+
= 2.2.6 =
|
75 |
+
* Added changelog to readme.
|
76 |
+
* OpenID Plugin (http://wordpress.org/extend/plugins/openid/) Integration.
|
77 |
+
* %username% can be used in your custom links shown when logged in (gets replaced with username)
|
78 |
+
* WP-FacebookConnect (http://wordpress.org/extend/plugins/wp-facebookconnect/) integration (untested!)
|
79 |
+
* Minor fixes (worked through a big list of em!)
|
sidebar-login.php
CHANGED
@@ -1,468 +1,476 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Sidebar Login
|
4 |
-
Plugin URI: http://wordpress.org/extend/plugins/sidebar-login/
|
5 |
-
Description: Adds a sidebar widget to let users login
|
6 |
-
Version: 2.2.
|
7 |
-
Author: Mike Jolley
|
8 |
-
Author URI: http://blue-anvil.com
|
9 |
-
*/
|
10 |
-
|
11 |
-
// Pre 2.6 compatibility (BY Stephen Rider)
|
12 |
-
if ( ! defined( 'WP_CONTENT_URL' ) ) {
|
13 |
-
if ( defined( 'WP_SITEURL' ) ) define( 'WP_CONTENT_URL', WP_SITEURL . '/wp-content' );
|
14 |
-
else define( 'WP_CONTENT_URL', get_option( 'url' ) . '/wp-content' );
|
15 |
-
}
|
16 |
-
if ( ! defined( '
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
<
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
<
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
'
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
$
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
$wp_error
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
?>
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
if ( $redirect_to
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
$
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
?>
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Sidebar Login
|
4 |
+
Plugin URI: http://wordpress.org/extend/plugins/sidebar-login/
|
5 |
+
Description: Adds a sidebar widget to let users login
|
6 |
+
Version: 2.2.8
|
7 |
+
Author: Mike Jolley
|
8 |
+
Author URI: http://blue-anvil.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Pre 2.6 compatibility (BY Stephen Rider)
|
12 |
+
if ( ! defined( 'WP_CONTENT_URL' ) ) {
|
13 |
+
if ( defined( 'WP_SITEURL' ) ) define( 'WP_CONTENT_URL', WP_SITEURL . '/wp-content' );
|
14 |
+
else define( 'WP_CONTENT_URL', get_option( 'url' ) . '/wp-content' );
|
15 |
+
}
|
16 |
+
if ( ! defined( 'WP_PLUGIN_URL' ) ) define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
|
17 |
+
|
18 |
+
load_plugin_textdomain('sblogin', WP_PLUGIN_URL.'/sidebar-login/langs/', 'sidebar-login/langs/');
|
19 |
+
|
20 |
+
function wp_sidebarlogin_menu() {
|
21 |
+
add_submenu_page('options-general.php', __('Sidebar Login','sblogin'), __('Sidebar Login','sblogin'), 9,'Sidebar Login', 'wp_sidebarlogin_admin');
|
22 |
+
}
|
23 |
+
|
24 |
+
if (!function_exists('is_ssl')) :
|
25 |
+
function is_ssl() {
|
26 |
+
return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
|
27 |
+
}
|
28 |
+
endif;
|
29 |
+
|
30 |
+
function wp_sidebarlogin_admin(){
|
31 |
+
// Update options
|
32 |
+
if ($_POST) {
|
33 |
+
update_option('sidebarlogin_login_redirect', stripslashes($_POST['sidebarlogin_login_redirect']));
|
34 |
+
update_option('sidebarlogin_logout_redirect', stripslashes($_POST['sidebarlogin_logout_redirect']));
|
35 |
+
update_option('sidebarlogin_register_link', stripslashes($_POST['sidebarlogin_register_link']));
|
36 |
+
update_option('sidebarlogin_forgotton_link', stripslashes($_POST['sidebarlogin_forgotton_link']));
|
37 |
+
update_option('sidebarlogin_logged_in_links', stripslashes($_POST['sidebarlogin_logged_in_links']));
|
38 |
+
echo '<div id="message"class="updated fade">';
|
39 |
+
_e('<p>Changes saved</p>',"sblogin");
|
40 |
+
echo '</div>';
|
41 |
+
}
|
42 |
+
// Get options
|
43 |
+
$sidebarlogin_login_redirect = get_option('sidebarlogin_login_redirect');
|
44 |
+
$sidebarlogin_logout_redirect = get_option('sidebarlogin_logout_redirect');
|
45 |
+
$sidebarlogin_register_link = get_option('sidebarlogin_register_link');
|
46 |
+
$sidebarlogin_forgotton_link = get_option('sidebarlogin_forgotton_link');
|
47 |
+
$sidebarlogin_logged_in_links = get_option('sidebarlogin_logged_in_links');
|
48 |
+
?>
|
49 |
+
<div class="wrap alternate">
|
50 |
+
<h2><?php _e('Sidebar Login',"sblogin"); ?></h2>
|
51 |
+
<br class="a_break" style="clear: both;"/>
|
52 |
+
<form action="options-general.php?page=Sidebar%20Login" method="post">
|
53 |
+
<table class="niceblue form-table">
|
54 |
+
<tr>
|
55 |
+
<th scope="col"><?php _e('Login redirect URL',"sblogin"); ?>:</th>
|
56 |
+
<td><input type="text" name="sidebarlogin_login_redirect" value="<?php echo $sidebarlogin_login_redirect; ?>" /> <span class="setting-description"><?php _e('Url to redirect the user to after login. Leave blank to use their current page.','sblogin'); ?></span></td>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<th scope="col"><?php _e('Logout redirect URL',"sblogin"); ?>:</th>
|
60 |
+
<td><input type="text" name="sidebarlogin_logout_redirect" value="<?php echo $sidebarlogin_logout_redirect; ?>" /> <span class="setting-description"><?php _e('Url to redirect the user to after logout. Leave blank to use their current page.','sblogin'); ?></span></td>
|
61 |
+
</tr>
|
62 |
+
<tr>
|
63 |
+
<th scope="col"><?php _e('Show Register Link',"sblogin"); ?>:</th>
|
64 |
+
<td><select name="sidebarlogin_register_link">
|
65 |
+
<option <?php if ($sidebarlogin_register_link=='yes') echo 'selected="selected"'; ?> value="yes"><?php _e('Yes','sblogin'); ?></option>
|
66 |
+
<option <?php if ($sidebarlogin_register_link=='no') echo 'selected="selected"'; ?> value="no"><?php _e('No','sblogin'); ?></option>
|
67 |
+
</select> <span class="setting-description"><?php _e('User registrations must also be turned on for this to work (\'Anyone can register\' checkbox in settings).','sblogin'); ?></span></td>
|
68 |
+
</tr>
|
69 |
+
<tr>
|
70 |
+
<th scope="col"><?php _e('Show Lost Password Link',"sblogin"); ?>:</th>
|
71 |
+
<td><select name="sidebarlogin_forgotton_link">
|
72 |
+
<option <?php if ($sidebarlogin_forgotton_link=='yes') echo 'selected="selected"'; ?> value="yes"><?php _e('Yes','sblogin'); ?></option>
|
73 |
+
<option <?php if ($sidebarlogin_forgotton_link=='no') echo 'selected="selected"'; ?> value="no"><?php _e('No','sblogin'); ?></option>
|
74 |
+
</select></td>
|
75 |
+
</tr>
|
76 |
+
<tr>
|
77 |
+
<th scope="col"><?php _e('Logged in links',"sblogin"); ?>:</th>
|
78 |
+
<td><textarea name="sidebarlogin_logged_in_links" rows="3" cols="80" /><?php echo $sidebarlogin_logged_in_links; ?></textarea><br/><span class="setting-description"><?php _e("One link per line. Note: Logout link will always show regardless. Tip: Add <code>|true</code> after a link to only show it to admin users. If you add a further <code>|USER LEVEL</code> the link will only be shown to users with levels equal to or greater than those defined. See <a href='http://codex.wordpress.org/Roles_and_Capabilities' target='_blank'>http://codex.wordpress.org/Roles_and_Capabilities</a> for more info on roles and Capabilities.<br/> You can also type <code>%USERNAME%</code> which will be replaced by the user's username. Default:",'sblogin');
|
79 |
+
echo '<br/><a href="'.get_bloginfo('wpurl').'/wp-admin/">Dashboard</a><br/><a href="'.get_bloginfo('wpurl').'/wp-admin/profile.php">Profile</a>'; ?></span></td>
|
80 |
+
</tr>
|
81 |
+
</table>
|
82 |
+
<p class="submit"><input type="submit" value="<?php _e('Save Changes',"sblogin"); ?>" /></p>
|
83 |
+
</form>
|
84 |
+
</div>
|
85 |
+
<?php
|
86 |
+
}
|
87 |
+
|
88 |
+
/*
|
89 |
+
example of short call with text
|
90 |
+
|
91 |
+
sidebarlogin('before_title=<h5>&after_title='</h5>');
|
92 |
+
|
93 |
+
suggested by dev.xiligroup.com
|
94 |
+
*/
|
95 |
+
|
96 |
+
function sidebarlogin($myargs = '') {
|
97 |
+
if (is_array($myargs)) $args = &$myargs;
|
98 |
+
else parse_str($myargs, $args);
|
99 |
+
|
100 |
+
$defaults = array('before_widget'=>'','after_widget'=>'',
|
101 |
+
'before_title'=>'<h2>','after_title'=>'</h2>'
|
102 |
+
);
|
103 |
+
$args = array_merge($defaults, $args);
|
104 |
+
|
105 |
+
widget_wp_sidebarlogin($args);
|
106 |
+
}
|
107 |
+
|
108 |
+
function widget_wp_sidebarlogin($args) {
|
109 |
+
global $user_ID, $current_user;
|
110 |
+
|
111 |
+
/* To add more extend i.e when terms came from themes - suggested by dev.xiligroup.com */
|
112 |
+
$defaults = array(
|
113 |
+
'thelogin'=>__('Login','sblogin'),
|
114 |
+
'thewelcome'=>__("Welcome",'sblogin'),
|
115 |
+
'theusername'=>__('Username:','sblogin'),
|
116 |
+
'thepassword'=>__('Password:','sblogin'),
|
117 |
+
'theremember'=>__('Remember me','sblogin'),
|
118 |
+
'theregister'=>__('Register','sblogin'),
|
119 |
+
'thepasslostandfound'=>__('Password Lost and Found','sblogin'),
|
120 |
+
'thelostpass'=> __('Lost your password?','sblogin'),
|
121 |
+
'thelogout'=> __('Logout','sblogin')
|
122 |
+
);
|
123 |
+
|
124 |
+
$args = array_merge($defaults, $args);
|
125 |
+
extract($args);
|
126 |
+
|
127 |
+
get_currentuserinfo();
|
128 |
+
|
129 |
+
if ($user_ID != '') {
|
130 |
+
// User is logged in
|
131 |
+
|
132 |
+
global $current_user;
|
133 |
+
get_currentuserinfo();
|
134 |
+
|
135 |
+
echo $before_widget . $before_title .$thewelcome.' '.ucwords($current_user->display_name). $after_title;
|
136 |
+
|
137 |
+
echo '<div class="avatar_container">'.get_avatar($user_ID, $size = '38').'</div>';
|
138 |
+
|
139 |
+
echo '<ul class="pagenav">';
|
140 |
+
|
141 |
+
if(isset($current_user->user_level) && $current_user->user_level) $level = $current_user->user_level;
|
142 |
+
|
143 |
+
$links = do_shortcode(get_option('sidebarlogin_logged_in_links'));
|
144 |
+
|
145 |
+
$links = explode("\n", $links);
|
146 |
+
if (sizeof($links)>0)
|
147 |
+
foreach ($links as $l) {
|
148 |
+
$link = explode('|',$l);
|
149 |
+
if (isset($link[2]) && is_numeric(intval(trim($link[2]))) && intval(trim($link[2])) <= 10 ) { // Thanks to John from http://www.area-europa.es/
|
150 |
+
$req_level = intval(trim($link[2]));
|
151 |
+
} else {
|
152 |
+
$req_level=10;
|
153 |
+
}
|
154 |
+
if (isset($link[1]) && strtolower(trim($link[1]))=='true' && $level < $req_level) continue;
|
155 |
+
else {
|
156 |
+
// Parse %USERNAME%
|
157 |
+
$link[0] = str_replace('%USERNAME%',$current_user->user_login,$link[0]);
|
158 |
+
$link[0] = str_replace('%username%',$current_user->user_login,$link[0]);
|
159 |
+
echo '<li class="page_item">'.$link[0].'</li>';
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
$redir = trim(stripslashes(get_option('sidebarlogin_logout_redirect')));
|
164 |
+
if (!$redir || empty($redir)) $redir = wp_sidebarlogin_current_url('nologout');
|
165 |
+
|
166 |
+
echo '<li class="page_item"><a href="'.wp_logout_url($redir).'">'.$thelogout.'</a></li></ul>';
|
167 |
+
|
168 |
+
} else {
|
169 |
+
// User is NOT logged in!!!
|
170 |
+
echo $before_widget . $before_title .'<span>'. $thelogin .'</span>' . $after_title;
|
171 |
+
// Show any errors
|
172 |
+
global $myerrors;
|
173 |
+
|
174 |
+
$wp_error = new WP_Error();
|
175 |
+
|
176 |
+
if ( !empty($myerrors) && is_wp_error($myerrors) ) {
|
177 |
+
$wp_error = $myerrors;
|
178 |
+
}
|
179 |
+
|
180 |
+
/* Cookies not supported error handling */
|
181 |
+
if ( isset($_GET['_login']) && empty($_COOKIE[TEST_COOKIE]) ) $wp_error->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
|
182 |
+
|
183 |
+
if ( $wp_error->get_error_code() ) {
|
184 |
+
|
185 |
+
$errors = '';
|
186 |
+
$messages = '';
|
187 |
+
|
188 |
+
foreach ( $wp_error->get_error_codes() as $code ) {
|
189 |
+
$severity = $wp_error->get_error_data($code);
|
190 |
+
foreach ( $wp_error->get_error_messages($code) as $error ) {
|
191 |
+
if ( 'message' == $severity )
|
192 |
+
$messages .= ' ' . $error . "<br />\n";
|
193 |
+
else
|
194 |
+
$errors .= ' ' . $error . "<br />\n";
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
if ( !empty($errors) )
|
199 |
+
echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
|
200 |
+
if ( !empty($messages) )
|
201 |
+
echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
|
202 |
+
}
|
203 |
+
// login form
|
204 |
+
echo '<form method="post" action="'.wp_sidebarlogin_current_url().'">';
|
205 |
+
?>
|
206 |
+
<p><label for="user_login"><?php echo $theusername; ?></label><br/><input name="log" value="<?php echo attribute_escape(stripslashes($_POST['log'])); ?>" class="mid" id="user_login" type="text" /></p>
|
207 |
+
<p><label for="user_pass"><?php echo $thepassword; ?></label><br/><input name="pwd" class="mid" id="user_pass" type="password" /></p>
|
208 |
+
|
209 |
+
<?php
|
210 |
+
// OpenID Plugin (http://wordpress.org/extend/plugins/openid/) Integration
|
211 |
+
if (function_exists('openid_wp_login_form')) {
|
212 |
+
|
213 |
+
echo '<input type="hidden" name="redirect_to" value="'.wp_sidebarlogin_current_url().'" />';
|
214 |
+
|
215 |
+
//openid_wp_login_form();
|
216 |
+
echo '<hr id="openid_split" />';
|
217 |
+
|
218 |
+
echo '
|
219 |
+
<p>
|
220 |
+
<label for="openid_field">' . __('Or login using an <a href="http://openid.net/what/" title="Learn about OpenID">OpenID</a>', 'sblogin') . '</label>
|
221 |
+
<input type="text" name="openid_identifier" id="openid_field" class="input mid" value="" /></label>
|
222 |
+
</p>';
|
223 |
+
}
|
224 |
+
|
225 |
+
?>
|
226 |
+
|
227 |
+
<p class="rememberme"><input name="rememberme" class="checkbox" id="rememberme" value="forever" type="checkbox" /> <label for="rememberme"><?php echo $theremember; ?></label></p>
|
228 |
+
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" value="<?php echo $thelogin; ?> »" />
|
229 |
+
|
230 |
+
<input type="hidden" name="sidebarlogin_posted" value="1" />
|
231 |
+
<input type="hidden" name="testcookie" value="1" /></p>
|
232 |
+
|
233 |
+
<?php
|
234 |
+
// Facebook Plugin
|
235 |
+
if (function_exists('fbc_init_auth')) do_action('fbc_display_login_button');
|
236 |
+
?>
|
237 |
+
|
238 |
+
</form>
|
239 |
+
<?php
|
240 |
+
// Output other links
|
241 |
+
$isul = false; /* ms for w3c - suggested by dev.xiligroup.com */
|
242 |
+
if (get_option('users_can_register') && get_option('sidebarlogin_register_link')=='yes') {
|
243 |
+
// MU FIX
|
244 |
+
global $wpmu_version;
|
245 |
+
if (empty($wpmu_version)) {
|
246 |
+
echo '<ul class="sidebarlogin_otherlinks">';
|
247 |
+
$isul = true;
|
248 |
+
?>
|
249 |
+
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register" rel="nofollow"><?php echo $theregister; ?></a></li>
|
250 |
+
<?php
|
251 |
+
} else {
|
252 |
+
echo '<ul class="sidebarlogin_otherlinks">';
|
253 |
+
$isul = true;
|
254 |
+
?>
|
255 |
+
<li><a href="<?php bloginfo('wpurl'); ?>/wp-signup.php" rel="nofollow"><?php echo $theregister; ?></a></li>
|
256 |
+
<?php
|
257 |
+
}
|
258 |
+
}
|
259 |
+
if (get_option('sidebarlogin_forgotton_link')=='yes') :
|
260 |
+
if ($isul == false) {
|
261 |
+
echo '<ul class="sidebarlogin_otherlinks">';
|
262 |
+
$isul = true;
|
263 |
+
}
|
264 |
+
?>
|
265 |
+
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php echo $thepasslostfound; ?>" rel="nofollow"><?php echo $thelostpass; ?></a></li>
|
266 |
+
<?php
|
267 |
+
endif;
|
268 |
+
if ($isul) echo '</ul>';
|
269 |
+
}
|
270 |
+
|
271 |
+
// echo widget closing tag
|
272 |
+
echo $after_widget;
|
273 |
+
}
|
274 |
+
|
275 |
+
if (class_exists('WP_Widget')) {
|
276 |
+
|
277 |
+
function widget_wp_sidebarlogin_init() {
|
278 |
+
// New Style widgets
|
279 |
+
class SidebarLoginMultiWidget extends WP_Widget {
|
280 |
+
function SidebarLoginMultiWidget() {
|
281 |
+
$widget_ops = array('description' => __( 'Sidebar Login.','sblogin') );
|
282 |
+
$this->WP_Widget('wp_sidebarlogin', __('Sidebar Login','sblogin'), $widget_ops);
|
283 |
+
}
|
284 |
+
function widget($args, $instance) {
|
285 |
+
|
286 |
+
widget_wp_sidebarlogin($args);
|
287 |
+
|
288 |
+
}
|
289 |
+
}
|
290 |
+
register_widget('SidebarLoginMultiWidget');
|
291 |
+
}
|
292 |
+
add_action('init', 'widget_wp_sidebarlogin_init', 1);
|
293 |
+
|
294 |
+
} else {
|
295 |
+
// Legacy Widgets
|
296 |
+
function widget_wp_sidebarlogin_init() {
|
297 |
+
if ( !function_exists('register_sidebar_widget') ) return;
|
298 |
+
// Register widget for use
|
299 |
+
register_sidebar_widget(array('Sidebar Login', 'widgets'), 'widget_wp_sidebarlogin');
|
300 |
+
}
|
301 |
+
add_action('widgets_init', 'widget_wp_sidebarlogin_init');
|
302 |
+
}
|
303 |
+
|
304 |
+
function widget_wp_sidebarlogin_check() {
|
305 |
+
|
306 |
+
// Add options - they may not exist
|
307 |
+
add_option('sidebarlogin_login_redirect','','no');
|
308 |
+
add_option('sidebarlogin_logout_redirect','','no');
|
309 |
+
add_option('sidebarlogin_register_link','yes','no');
|
310 |
+
add_option('sidebarlogin_forgotton_link','yes','no');
|
311 |
+
add_option('sidebarlogin_logged_in_links', "<a href=\"".get_bloginfo('wpurl')."/wp-admin/\">".__('Dashboard','sblogin')."</a>\n<a href=\"".get_bloginfo('wpurl')."/wp-admin/profile.php\">".__('Profile','sblogin')."</a>",'no');
|
312 |
+
|
313 |
+
echo COOKIE_DOMAIN;
|
314 |
+
|
315 |
+
// Set a cookie now to see if they are supported by the browser.
|
316 |
+
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
|
317 |
+
if ( SITECOOKIEPATH != COOKIEPATH )
|
318 |
+
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
|
319 |
+
|
320 |
+
if (isset($_POST['sidebarlogin_posted'])) {
|
321 |
+
|
322 |
+
global $myerrors;
|
323 |
+
$myerrors = new WP_Error();
|
324 |
+
|
325 |
+
nocache_headers();
|
326 |
+
|
327 |
+
$secure_cookie = '';
|
328 |
+
|
329 |
+
$redir = trim(stripslashes(get_option('sidebarlogin_login_redirect')));
|
330 |
+
if ($redir && !empty($redir)) $redirect_to = $redir;
|
331 |
+
else $redirect_to = wp_sidebarlogin_current_url('nologout');
|
332 |
+
|
333 |
+
// If the user wants ssl but the session is not ssl, force a secure cookie.
|
334 |
+
if ( !empty($_POST['log']) && !force_ssl_admin() ) {
|
335 |
+
$user_name = sanitize_user(stripslashes($_POST['log']));
|
336 |
+
if ( $user = get_userdatabylogin($user_name) ) {
|
337 |
+
if ( get_user_option('use_ssl', $user->ID) ) {
|
338 |
+
$secure_cookie = true;
|
339 |
+
force_ssl_admin(true);
|
340 |
+
}
|
341 |
+
}
|
342 |
+
}
|
343 |
+
|
344 |
+
if ( $redirect_to ) {
|
345 |
+
// Redirect to https if user wants ssl
|
346 |
+
if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
|
347 |
+
$redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
|
348 |
+
}
|
349 |
+
|
350 |
+
if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) ) $secure_cookie = false;
|
351 |
+
|
352 |
+
$user = wp_signon('', $secure_cookie);
|
353 |
+
|
354 |
+
$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $redirect_to ) ? $redirect_to : '', $user);
|
355 |
+
|
356 |
+
if ( $user && !is_wp_error($user) ) {
|
357 |
+
wp_safe_redirect($redirect_to);
|
358 |
+
exit;
|
359 |
+
//}
|
360 |
+
} elseif ($user) {
|
361 |
+
$myerrors = $user;
|
362 |
+
if ( empty($_POST['log']) && empty($_POST['pwd']) ) {
|
363 |
+
$myerrors->add('empty_username', __('<strong>ERROR</strong>: Please enter a username & password.', 'sblogin'));
|
364 |
+
}
|
365 |
+
}
|
366 |
+
}
|
367 |
+
}
|
368 |
+
|
369 |
+
if ( !function_exists('wp_sidebarlogin_current_url') ) :
|
370 |
+
function wp_sidebarlogin_current_url($url = '') {
|
371 |
+
|
372 |
+
global $wpdb, $post, $cat, $tag, $author, $year, $monthnum, $day, $wp_query;
|
373 |
+
$pageURL = "";
|
374 |
+
|
375 |
+
if ( is_home() && $wp_query->is_posts_page==1)
|
376 |
+
{
|
377 |
+
$pageURL = get_permalink(get_option('page_for_posts'));
|
378 |
+
}
|
379 |
+
elseif (is_home() || is_front_page())
|
380 |
+
{
|
381 |
+
$pageURL = get_bloginfo('url');
|
382 |
+
}
|
383 |
+
elseif (is_single() || is_page())
|
384 |
+
{
|
385 |
+
$pageURL = get_permalink($wp_query->post->ID);
|
386 |
+
}
|
387 |
+
elseif (is_category())
|
388 |
+
{
|
389 |
+
$pageURL = get_category_link($cat);
|
390 |
+
}
|
391 |
+
elseif (is_tag())
|
392 |
+
{
|
393 |
+
$tag_id = $wpdb->get_var("SELECT ".$wpdb->terms.".term_id FROM $wpdb->term_taxonomy
|
394 |
+
LEFT JOIN $wpdb->terms
|
395 |
+
ON (".$wpdb->term_taxonomy.".term_id = ".$wpdb->terms.".term_id)
|
396 |
+
WHERE ".$wpdb->terms.".slug = '$tag'
|
397 |
+
AND ".$wpdb->term_taxonomy.".taxonomy = 'post_tag' LIMIT 1");
|
398 |
+
$pageURL = get_tag_link($tag_id);
|
399 |
+
}
|
400 |
+
elseif (is_author())
|
401 |
+
{
|
402 |
+
$pageURL = get_author_posts_url($author);
|
403 |
+
}
|
404 |
+
elseif (is_date())
|
405 |
+
{
|
406 |
+
|
407 |
+
if ($day)
|
408 |
+
{
|
409 |
+
$pageURL = get_day_link( $year, $month, $day);
|
410 |
+
}
|
411 |
+
elseif ($monthnum)
|
412 |
+
{
|
413 |
+
$pageURL = get_month_link( $year, $monthnum, $day);
|
414 |
+
}
|
415 |
+
elseif ($year)
|
416 |
+
{
|
417 |
+
$pageURL = get_year_link( $year, $monthnum, $day);
|
418 |
+
}
|
419 |
+
|
420 |
+
}
|
421 |
+
elseif (is_search())
|
422 |
+
{
|
423 |
+
$pageURL = get_bloginfo('wpurl');
|
424 |
+
if ("/" != substr($pageURL, -1)) $pageURL = $pageURL . "/";
|
425 |
+
$pageURL .= '?s='.stripslashes(strip_tags($_REQUEST['s'])).'';
|
426 |
+
}
|
427 |
+
|
428 |
+
if (!$pageURL || $pageURL=="" || !is_string($pageURL)) {
|
429 |
+
$pageURL = "";
|
430 |
+
$pageURL = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
|
431 |
+
|
432 |
+
if ($_SERVER["SERVER_PORT"] != "80") {
|
433 |
+
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
434 |
+
} else {
|
435 |
+
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
436 |
+
}
|
437 |
+
|
438 |
+
//————–added by mick
|
439 |
+
if (!strstr(get_bloginfo('url'),'www.')) $pageURL = str_replace('www.','', $pageURL );
|
440 |
+
//——————–
|
441 |
+
}
|
442 |
+
if ($pageURL && !is_search()) if ("/" != substr($pageURL, -1)) $pageURL = $pageURL . "/";
|
443 |
+
|
444 |
+
if ($url != "nologout") {
|
445 |
+
if (!strpos($pageURL,'_login=')) {
|
446 |
+
$rand_string = md5(uniqid(rand(), true));
|
447 |
+
$rand_string = substr($rand_string, 0, 10);
|
448 |
+
|
449 |
+
if (strpos($pageURL,'?'))
|
450 |
+
if (substr($pageURL,-1)=='/')
|
451 |
+
$pageURL = substr($pageURL,0,-1);
|
452 |
+
|
453 |
+
$rand = (!strpos($pageURL,'?')) ? '?_login='.$rand_string : '&_login='.$rand_string;
|
454 |
+
$pageURL .= $rand;
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
if ( force_ssl_login() || force_ssl_admin() ) {
|
459 |
+
$pageURL = str_replace( 'http://', 'https://', $pageURL );
|
460 |
+
}
|
461 |
+
|
462 |
+
return $pageURL;
|
463 |
+
}
|
464 |
+
endif;
|
465 |
+
|
466 |
+
function wp_sidebarlogin_css() {
|
467 |
+
$myStyleFile = WP_PLUGIN_URL . '/sidebar-login/style.css';
|
468 |
+
wp_register_style('wp_sidebarlogin_css_styles', $myStyleFile);
|
469 |
+
wp_enqueue_style( 'wp_sidebarlogin_css_styles');
|
470 |
+
}
|
471 |
+
|
472 |
+
// Run code and init
|
473 |
+
add_action('wp_print_styles', 'wp_sidebarlogin_css');
|
474 |
+
add_action('init', 'widget_wp_sidebarlogin_check',0);
|
475 |
+
add_action('admin_menu', 'wp_sidebarlogin_menu');
|
476 |
?>
|