Version Description
Download this release
Release Info
Developer | ClaudeSchlesser |
Plugin | Social Login |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5 to 1.6
- assets/css/admin.css +19 -15
- assets/img/provider_sprite_35_35.png +0 -0
- assets/js/admin.js +5 -1
- includes/admin.php +114 -111
- includes/settings.php +45 -9
- oa-social-login.php +27 -5
- readme.txt +19 -12
assets/css/admin.css
CHANGED
@@ -119,47 +119,51 @@
|
|
119 |
}
|
120 |
|
121 |
.oa_provider.oa_provider_foursquare {
|
122 |
-
background-position:
|
123 |
}
|
124 |
|
125 |
.oa_provider.oa_provider_google {
|
126 |
-
background-position:
|
127 |
}
|
128 |
|
129 |
.oa_provider.oa_provider_hyves {
|
130 |
-
background-position:
|
131 |
}
|
132 |
|
133 |
.oa_provider.oa_provider_linkedin {
|
134 |
-
background-position:
|
135 |
}
|
136 |
|
137 |
.oa_provider.oa_provider_livejournal {
|
138 |
-
background-position:
|
139 |
}
|
140 |
|
141 |
.oa_provider.oa_provider_myspace {
|
142 |
-
background-position:
|
143 |
}
|
144 |
|
145 |
-
.oa_provider.
|
146 |
-
background-position:
|
147 |
}
|
148 |
|
149 |
-
.oa_provider.
|
150 |
-
background-position:
|
151 |
}
|
152 |
|
153 |
-
.oa_provider.
|
154 |
-
background-position:
|
155 |
}
|
156 |
|
157 |
.oa_provider.oa_provider_wordpress {
|
158 |
-
background-position:
|
159 |
}
|
160 |
|
161 |
-
.oa_provider.
|
162 |
-
background-position:
|
|
|
|
|
|
|
|
|
163 |
}
|
164 |
|
165 |
.oa_form_table_settings tr.row_odd,.oa_form_table_settings tr.row_odd td {
|
119 |
}
|
120 |
|
121 |
.oa_provider.oa_provider_foursquare {
|
122 |
+
background-position: -113px -1px;
|
123 |
}
|
124 |
|
125 |
.oa_provider.oa_provider_google {
|
126 |
+
background-position: -150px -1px;
|
127 |
}
|
128 |
|
129 |
.oa_provider.oa_provider_hyves {
|
130 |
+
background-position: -187px -1px;
|
131 |
}
|
132 |
|
133 |
.oa_provider.oa_provider_linkedin {
|
134 |
+
background-position: -224px -1px;
|
135 |
}
|
136 |
|
137 |
.oa_provider.oa_provider_livejournal {
|
138 |
+
background-position: -298px -1px;
|
139 |
}
|
140 |
|
141 |
.oa_provider.oa_provider_myspace {
|
142 |
+
background-position: -372px -1px;
|
143 |
}
|
144 |
|
145 |
+
.oa_provider.oa_provider_openid {
|
146 |
+
background-position: -409px -1px;
|
147 |
}
|
148 |
|
149 |
+
.oa_provider.oa_provider_twitter {
|
150 |
+
background-position: -520px -1px;
|
151 |
}
|
152 |
|
153 |
+
.oa_provider.oa_provider_vkontakte {
|
154 |
+
background-position: -631px -1px;
|
155 |
}
|
156 |
|
157 |
.oa_provider.oa_provider_wordpress {
|
158 |
+
background-position: -668px -1px;
|
159 |
}
|
160 |
|
161 |
+
.oa_provider.oa_provider_yahoo {
|
162 |
+
background-position: -705px -1px;
|
163 |
+
}
|
164 |
+
|
165 |
+
.oa_provider.oa_provider_paypal {
|
166 |
+
background-position: -742px -1px;
|
167 |
}
|
168 |
|
169 |
.oa_form_table_settings tr.row_odd,.oa_form_table_settings tr.row_odd td {
|
assets/img/provider_sprite_35_35.png
CHANGED
Binary file
|
assets/js/admin.js
CHANGED
@@ -26,10 +26,14 @@ jQuery(document).ready(function($) {
|
|
26 |
success = false;
|
27 |
message = 'The subdomain does not exist. Have you filled it out correctly?'
|
28 |
}
|
29 |
-
else if (response == 'error_subdomain_wrong_syntax'
|
30 |
success = false;
|
31 |
message = 'The subdomain has a wrong syntax!'
|
32 |
}
|
|
|
|
|
|
|
|
|
33 |
else if (response == 'error_authentication_credentials_wrong'){
|
34 |
success = false;
|
35 |
message = 'The API credentials are wrong';
|
26 |
success = false;
|
27 |
message = 'The subdomain does not exist. Have you filled it out correctly?'
|
28 |
}
|
29 |
+
else if (response == 'error_subdomain_wrong_syntax'){
|
30 |
success = false;
|
31 |
message = 'The subdomain has a wrong syntax!'
|
32 |
}
|
33 |
+
else if (response == 'error_communication'){
|
34 |
+
success = false;
|
35 |
+
message = 'Could not contact API. Are outoing CURL requests allowed?'
|
36 |
+
}
|
37 |
else if (response == 'error_authentication_credentials_wrong'){
|
38 |
success = false;
|
39 |
message = 'The API credentials are wrong';
|
includes/admin.php
CHANGED
@@ -19,7 +19,7 @@ add_action ('admin_menu', 'oa_social_login_admin_menu');
|
|
19 |
*/
|
20 |
function oa_social_login_admin_message ()
|
21 |
{
|
22 |
-
if (get_option('oa_social_login_activation_message') !== '1')
|
23 |
{
|
24 |
echo '<div class="updated"><p><strong>Thank you for using the Social Login Plugin!</strong> Please go to the <strong>Settings\Social Login</strong> page to setup the plugin.</p></div>';
|
25 |
update_option ('oa_social_login_activation_message', '1');
|
@@ -30,89 +30,89 @@ function oa_social_login_admin_message ()
|
|
30 |
/**
|
31 |
* Check API Settings trough an Ajax Call
|
32 |
*/
|
33 |
-
function oa_social_login_check_api_settings()
|
34 |
{
|
35 |
-
check_ajax_referer('oa_social_login_ajax_nonce');
|
36 |
|
37 |
-
//Check if all fields filled out
|
38 |
-
if (
|
39 |
{
|
40 |
echo 'error_not_all_fields_filled_out';
|
41 |
delete_option ('oa_social_login_api_settings_verified');
|
42 |
-
die();
|
43 |
}
|
44 |
|
45 |
//Subdomain
|
46 |
-
$api_subdomain = trim(strtolower($_POST['api_subdomain']));
|
47 |
|
48 |
//Full domain entered
|
49 |
if (preg_match ("/([a-z0-9\-]+)\.api\.oneall\.com/i", $api_subdomain, $matches))
|
50 |
{
|
51 |
-
$api_subdomain = $matches[1];
|
52 |
}
|
53 |
|
54 |
//Check subdomain format
|
55 |
-
if (
|
56 |
{
|
57 |
echo 'error_subdomain_wrong_syntax';
|
58 |
delete_option ('oa_social_login_api_settings_verified');
|
59 |
-
die();
|
60 |
}
|
61 |
|
62 |
//Domain
|
63 |
-
$api_domain = $api_subdomain.'.api.oneall.com';
|
64 |
|
65 |
//Key
|
66 |
-
$api_key = $_POST['api_key'];
|
67 |
|
68 |
//Secret
|
69 |
-
$api_secret = $_POST['api_secret'];
|
70 |
|
71 |
//Ping
|
72 |
-
$curl = curl_init();
|
73 |
-
curl_setopt($curl, CURLOPT_URL, 'https://'
|
74 |
-
curl_setopt($curl, CURLOPT_HEADER, 0);
|
75 |
-
curl_setopt($curl, CURLOPT_USERPWD, $api_key . ":" . $api_secret);
|
76 |
-
curl_setopt($curl, CURLOPT_TIMEOUT, 15);
|
77 |
-
curl_setopt($curl, CURLOPT_VERBOSE, 0);
|
78 |
-
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
79 |
-
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
80 |
-
curl_setopt($curl, CURLOPT_FAILONERROR, 0);
|
81 |
-
|
82 |
-
if (
|
83 |
{
|
84 |
-
curl_close($curl);
|
85 |
|
86 |
echo 'error_communication';
|
87 |
delete_option ('oa_social_login_api_settings_verified');
|
88 |
-
die();
|
89 |
}
|
90 |
|
91 |
//Success
|
92 |
-
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
93 |
-
curl_close($curl);
|
94 |
|
95 |
//Authentication Error
|
96 |
if ($http_code == 401)
|
97 |
{
|
98 |
echo 'error_authentication_credentials_wrong';
|
99 |
delete_option ('oa_social_login_api_settings_verified');
|
100 |
-
die();
|
101 |
}
|
102 |
elseif ($http_code == 404)
|
103 |
{
|
104 |
echo 'error_subdomain_wrong';
|
105 |
delete_option ('oa_social_login_api_settings_verified');
|
106 |
-
die();
|
107 |
}
|
108 |
elseif ($http_code == 200)
|
109 |
{
|
110 |
echo 'success';
|
111 |
update_option ('oa_social_login_api_settings_verified', '1');
|
112 |
-
die();
|
113 |
}
|
114 |
}
|
115 |
-
add_action('wp_ajax_check_api_settings', 'oa_social_login_check_api_settings');
|
116 |
|
117 |
|
118 |
/**
|
@@ -124,14 +124,16 @@ function oa_social_login_admin_js ($hook)
|
|
124 |
{
|
125 |
if (!wp_script_is ('oa_social_login_admin_js', 'registered'))
|
126 |
{
|
127 |
-
wp_register_script('oa_social_login_admin_js', OA_SOCIAL_LOGIN_PLUGIN_URL . "/assets/js/admin.js");
|
128 |
}
|
129 |
|
130 |
wp_enqueue_script ('oa_social_login_admin_js');
|
131 |
wp_enqueue_script ('jquery');
|
132 |
|
133 |
-
$oa_social_login_ajax_nonce = wp_create_nonce
|
134 |
-
wp_localize_script('oa_social_login_admin_js', 'oa_social_login_ajax_nonce', array (
|
|
|
|
|
135 |
}
|
136 |
}
|
137 |
|
@@ -182,14 +184,11 @@ function oa_social_login_settings_validate ($settings)
|
|
182 |
'api_key',
|
183 |
'api_secret',
|
184 |
'plugin_caption',
|
185 |
-
|
186 |
'plugin_link_verified_accounts',
|
187 |
'plugin_show_avatars_in_comments',
|
188 |
-
|
189 |
'plugin_display_in_login_form',
|
190 |
'plugin_login_form_redirect',
|
191 |
'plugin_login_form_redirect_custom_url',
|
192 |
-
|
193 |
'plugin_display_in_registration_form',
|
194 |
'plugin_registration_form_redirect',
|
195 |
'plugin_registration_form_redirect_custom_url'
|
@@ -202,17 +201,17 @@ function oa_social_login_settings_validate ($settings)
|
|
202 |
}
|
203 |
|
204 |
//Subdomain is always lowercase
|
205 |
-
if (isset ($sanitzed_settings['api_subdomain']))
|
206 |
{
|
207 |
-
$api_subdomain = strtolower($sanitzed_settings['api_subdomain']);
|
208 |
|
209 |
//Full domain entered
|
210 |
if (preg_match ("/([a-z0-9\-]+)\.api\.oneall\.com/i", $api_subdomain, $matches))
|
211 |
{
|
212 |
-
$api_subdomain = $matches[1];
|
213 |
}
|
214 |
|
215 |
-
$sanitzed_settings['api_subdomain'] = $api_subdomain;
|
216 |
}
|
217 |
|
218 |
|
@@ -230,37 +229,37 @@ function oa_social_login_settings_validate ($settings)
|
|
230 |
|
231 |
|
232 |
//Flag settings
|
233 |
-
$sanitzed_settings['plugin_show_avatars_in_comments'] == ((isset ($sanitzed_settings['plugin_show_avatars_in_comments']) AND $sanitzed_settings['plugin_show_avatars_in_comments'] == '1') ? 1 : 0);
|
234 |
-
$sanitzed_settings['plugin_link_verified_accounts'] == ((isset ($sanitzed_settings['plugin_link_verified_accounts']) AND $sanitzed_settings['plugin_link_verified_accounts'] == '0') ? 0 : 1);
|
235 |
-
$sanitzed_settings['plugin_login_form_redirect'] = ((isset ($sanitzed_settings ['plugin_login_form_redirect']) AND in_array ($sanitzed_settings ['plugin_login_form_redirect'], array ('dashboard', 'homepage', 'custom'))) ? $sanitzed_settings ['plugin_login_form_redirect'] : 'homepage');
|
236 |
-
$sanitzed_settings['plugin_registration_form_redirect'] = ((isset ($sanitzed_settings ['plugin_registration_form_redirect']) AND in_array ($sanitzed_settings ['plugin_registration_form_redirect'], array ('dashboard', 'homepage', 'custom'))) ? $sanitzed_settings ['plugin_registration_form_redirect'] : 'dashboard');
|
237 |
-
$sanitzed_settings['plugin_display_in_login_form'] == ((isset ($sanitzed_settings['plugin_display_in_login_form']) AND $sanitzed_settings['plugin_display_in_login_form'] == '0') ? 0 : 1);
|
238 |
|
239 |
//Check Login Redirection Settings
|
240 |
-
if ($sanitzed_settings['plugin_login_form_redirect'] == 'custom')
|
241 |
{
|
242 |
-
if (empty ($sanitzed_settings['plugin_login_form_redirect_custom_url']))
|
243 |
{
|
244 |
-
$sanitzed_settings['plugin_login_form_redirect'] = 'homepage';
|
245 |
}
|
246 |
}
|
247 |
else
|
248 |
{
|
249 |
-
$sanitzed_settings['plugin_login_form_redirect_custom_url'] = '';
|
250 |
}
|
251 |
|
252 |
|
253 |
//Check Registration Redirection Settings
|
254 |
-
if ($sanitzed_settings['plugin_registration_form_redirect'] == 'custom')
|
255 |
{
|
256 |
-
if (empty ($sanitzed_settings['plugin_registration_form_redirect_custom_url']))
|
257 |
{
|
258 |
-
$sanitzed_settings['plugin_registration_form_redirect'] = 'dashboard';
|
259 |
}
|
260 |
}
|
261 |
else
|
262 |
{
|
263 |
-
$sanitzed_settings['plugin_registration_form_redirect_custom_url'] = '';
|
264 |
}
|
265 |
|
266 |
//Done
|
@@ -279,7 +278,7 @@ function oa_display_social_login_settings ()
|
|
279 |
<div class="wrap">
|
280 |
<h2><?php _e ('Social Login Settings', 'oa_social_login'); ?></h2>
|
281 |
<?php
|
282 |
-
if (get_option('oa_social_login_api_settings_verified') !== '1')
|
283 |
{
|
284 |
?>
|
285 |
<div class="oa_container oa_container_welcome">
|
@@ -292,12 +291,12 @@ function oa_display_social_login_settings ()
|
|
292 |
<strong>Draw a larger audience and increase user engagement in a few simple steps.</strong>
|
293 |
</p>
|
294 |
<p>
|
295 |
-
To be able to use this plugin you first of all need to create a free account at
|
296 |
and setup a Site. After having created your account and setup your Site, please enter the Site settings in the form below.
|
297 |
</p>
|
298 |
-
<h3>
|
299 |
<p>
|
300 |
-
<a class="button-secondary" href="https://app.oneall.com/signup/" target="_blank"><strong>
|
301 |
</p>
|
302 |
</div>
|
303 |
</div>
|
@@ -308,7 +307,7 @@ function oa_display_social_login_settings ()
|
|
308 |
?>
|
309 |
<div class="oa_container oa_container_welcome">
|
310 |
<h3>
|
311 |
-
<?php _e('Your API Account is setup correctly'); ?>
|
312 |
</h3>
|
313 |
<div class="oa_container_body">
|
314 |
<p>
|
@@ -316,7 +315,7 @@ function oa_display_social_login_settings ()
|
|
316 |
Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement.
|
317 |
</p>
|
318 |
<p>
|
319 |
-
<a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong>Signin to
|
320 |
</p>
|
321 |
</div>
|
322 |
</div>
|
@@ -325,7 +324,7 @@ function oa_display_social_login_settings ()
|
|
325 |
?>
|
326 |
<div class="oa_container oa_container_links">
|
327 |
<h3>
|
328 |
-
<?php _e('Help, Updates & Documentation'); ?>
|
329 |
</h3>
|
330 |
<ul>
|
331 |
<li><a target="_blank" href="http://www.twitter.com/oneall">Follow us on Twitter</a> to stay informed about updates;</li>
|
@@ -341,7 +340,7 @@ function oa_display_social_login_settings ()
|
|
341 |
<table class="form-table oa_form_table">
|
342 |
<tr>
|
343 |
<th class="head">
|
344 |
-
<?php _e('API Settings', 'oa_social_login'); ?>
|
345 |
</th>
|
346 |
<th class="head">
|
347 |
<a href="https://app.oneall.com/applications/" target="_blank">Click here to create and view your API Credentials</a>
|
@@ -349,7 +348,7 @@ function oa_display_social_login_settings ()
|
|
349 |
</tr>
|
350 |
<tr>
|
351 |
<th scope="row">
|
352 |
-
<label for="oneall_api_subdomain"><?php _e('API Subdomain', 'oa_social_login'); ?>:</label>
|
353 |
</th>
|
354 |
<td>
|
355 |
<input type="text" id="oa_social_login_settings_api_subdomain" name="oa_social_login_settings[api_subdomain]" size="60" value="<?php echo (isset ($settings ['api_subdomain']) ? htmlspecialchars ($settings ['api_subdomain']) : ''); ?>" />
|
@@ -357,7 +356,7 @@ function oa_display_social_login_settings ()
|
|
357 |
</tr>
|
358 |
<tr>
|
359 |
<th scope="row">
|
360 |
-
<label for="oneall_api_public_key"><?php _e('API Public Key', 'oa_social_login'); ?>:</label>
|
361 |
</th>
|
362 |
<td>
|
363 |
<input type="text" id="oa_social_login_settings_api_key" name="oa_social_login_settings[api_key]" size="60" value="<?php echo (isset ($settings ['api_key']) ? htmlspecialchars ($settings ['api_key']) : ''); ?>" />
|
@@ -365,7 +364,7 @@ function oa_display_social_login_settings ()
|
|
365 |
</tr>
|
366 |
<tr>
|
367 |
<th scope="row">
|
368 |
-
<label for="oneall_api_private_key"><?php _e('API Private Key', 'oa_social_login'); ?>:</label>
|
369 |
</th>
|
370 |
<td>
|
371 |
<input type="text" id="oa_social_login_settings_api_secret" name="oa_social_login_settings[api_secret]" size="60" value="<?php echo (isset ($settings ['api_secret']) ? htmlspecialchars ($settings ['api_secret']) : ''); ?>" />
|
@@ -373,58 +372,55 @@ function oa_display_social_login_settings ()
|
|
373 |
</tr>
|
374 |
<tr class="foot">
|
375 |
<td>
|
376 |
-
<a class="button-secondary" id="oa_social_login_test_api_settings" href="#"><?php _e('Verify API Settings', 'oa_social_login'); ?></a>
|
377 |
</td>
|
378 |
<td>
|
379 |
<div id="oa_social_login_api_test_result"></div>
|
380 |
</td>
|
381 |
</tr>
|
382 |
</table>
|
383 |
-
|
384 |
<table class="form-table oa_form_table">
|
385 |
<tr>
|
386 |
<th class="head" colspan="2">
|
387 |
-
Enable the providers of your choice
|
388 |
</th>
|
389 |
</tr>
|
390 |
<?php
|
391 |
$i = 0;
|
392 |
-
foreach ($oa_social_login_providers AS $key => $
|
393 |
{
|
394 |
-
|
395 |
<tr class="<?php echo ((($i++) % 2) == 0) ? 'row_even' : 'row_odd' ?> row_provider">
|
396 |
<td class="row">
|
397 |
-
<label for="oneall_social_login_provider_<?php echo $key; ?>"><span class="oa_provider oa_provider_<?php echo $key; ?>" title="<?php echo htmlspecialchars ($name); ?>"><?php echo htmlspecialchars ($name); ?></span></label>
|
398 |
<input type="checkbox" id="oneall_social_login_provider_<?php echo $key; ?>" name="oa_social_login_settings[providers][<?php echo $key; ?>]" value="1" <?php checked ('1', $settings ['providers'] [$key]); ?> />
|
399 |
-
<label for="oneall_social_login_provider_<?php echo $key; ?>"><?php echo htmlspecialchars ($name); ?></label>
|
|
|
400 |
</td>
|
401 |
</tr>
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
</table>
|
406 |
-
|
407 |
<table class="form-table oa_form_table oa_form_table_settings">
|
408 |
<tr>
|
409 |
<th class="head">
|
410 |
-
<?php _e('Basic Settings', 'oa_social_login'); ?>
|
411 |
</th>
|
412 |
</tr>
|
413 |
-
|
414 |
<tr class="row_odd">
|
415 |
<td>
|
416 |
-
<?php _e('Enter the caption to be displayed above the social network login buttons:', 'oa_social_login'); ?>
|
417 |
</td>
|
418 |
</tr>
|
419 |
<tr class="row_even">
|
420 |
<td>
|
421 |
-
<input type="text" name="oa_social_login_settings[plugin_caption]" size="118" value="<?php echo (isset ($settings ['plugin_caption']) ? htmlspecialchars ($settings ['plugin_caption']) : _e('Connect with:')); ?>" />
|
422 |
</td>
|
423 |
</tr>
|
424 |
-
|
425 |
<tr class="row_odd">
|
426 |
<td>
|
427 |
-
<?php _e("If the user's social network profile has an avatar thumbnail, should we show it beside his comments?"
|
428 |
</td>
|
429 |
</tr>
|
430 |
<tr class="row_even">
|
@@ -432,45 +428,48 @@ function oa_display_social_login_settings ()
|
|
432 |
<?php
|
433 |
$plugin_show_avatars_in_comments = (isset ($settings ['plugin_show_avatars_in_comments']) AND $settings ['plugin_show_avatars_in_comments'] == '1');
|
434 |
?>
|
435 |
-
<input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="1" <?php echo ($plugin_show_avatars_in_comments ? 'checked="checked"' : '')
|
436 |
-
<input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="0" <?php echo (
|
437 |
</td>
|
438 |
</tr>
|
439 |
</table>
|
440 |
<table class="form-table oa_form_table oa_form_table_settings">
|
441 |
<tr>
|
442 |
<th class="head">
|
443 |
-
<?php _e('Login Settings', 'oa_social_login'); ?>
|
444 |
</th>
|
445 |
</tr>
|
446 |
<tr class="row_odd">
|
447 |
<td>
|
448 |
-
<?php _e('Do you want to display the social network login buttons below the login form of your blog?', 'oa_social_login'); ?>
|
449 |
</td>
|
450 |
</tr>
|
451 |
<tr class="row_even">
|
452 |
<td>
|
453 |
<?php
|
454 |
-
$plugin_display_in_login_form = (
|
455 |
?>
|
456 |
-
<input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="1" <?php echo ($plugin_display_in_login_form ? 'checked="checked"' : '')
|
457 |
-
<input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="0" <?php echo (
|
458 |
</td>
|
459 |
</tr>
|
460 |
-
|
461 |
<tr class="row_odd">
|
462 |
<td>
|
463 |
-
<?php _e('Where should existent users be redirected to after having logged in with their social network account?', 'oa_social_login'); ?>
|
464 |
</td>
|
465 |
</tr>
|
466 |
<tr class="row_even">
|
467 |
<td>
|
468 |
<?php
|
469 |
-
$plugin_login_form_redirect = ((!
|
|
|
|
|
|
|
|
|
470 |
?>
|
471 |
-
<input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="homepage" <?php echo ($plugin_login_form_redirect == 'homepage' ? 'checked="checked"' : '')
|
472 |
-
<input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="dashboard" <?php echo ($plugin_login_form_redirect == 'dashboard' ? 'checked="checked"' : '')
|
473 |
-
<input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="custom" <?php echo ($plugin_login_form_redirect == 'custom' ? 'checked="checked"' : '')
|
474 |
<input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_login_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_login_form_redirect_custom_url']) : ''); ?>" />
|
475 |
</td>
|
476 |
</tr>
|
@@ -478,51 +477,55 @@ function oa_display_social_login_settings ()
|
|
478 |
<table class="form-table oa_form_table oa_form_table_settings">
|
479 |
<tr>
|
480 |
<th class="head">
|
481 |
-
<?php _e('Registration Settings', 'oa_social_login'); ?>
|
482 |
</th>
|
483 |
</tr>
|
484 |
<tr class="row_odd">
|
485 |
<td>
|
486 |
-
<?php _e('If the email address of the social network profile is verified, should we try to link it to an existing account?', 'oa_social_login'); ?>
|
487 |
</td>
|
488 |
</tr>
|
489 |
<tr class="row_even">
|
490 |
<td>
|
491 |
<?php
|
492 |
-
$plugin_link_verified_accounts = (
|
493 |
?>
|
494 |
-
<input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="1" <?php echo ($plugin_link_verified_accounts ? 'checked="checked"' : '')
|
495 |
-
<input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="0" <?php echo (
|
496 |
</td>
|
497 |
</tr>
|
498 |
<tr class="row_odd">
|
499 |
<td>
|
500 |
-
<?php _e('Do you want to display the social network login buttons below the registration form of your blog?', 'oa_social_login'); ?>
|
501 |
</td>
|
502 |
</tr>
|
503 |
<tr class="row_even">
|
504 |
<td>
|
505 |
<?php
|
506 |
-
$plugin_display_in_registration_form = (
|
507 |
?>
|
508 |
-
<input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="1" <?php echo ($plugin_display_in_registration_form ? 'checked="checked"' : '')
|
509 |
-
<input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="0" <?php echo (
|
510 |
</td>
|
511 |
</tr>
|
512 |
|
513 |
<tr class="row_odd">
|
514 |
<td>
|
515 |
-
<?php _e('Where should new users be redirected to after having registered with their social network account?', 'oa_social_login'); ?>
|
516 |
</td>
|
517 |
</tr>
|
518 |
<tr class="row_even">
|
519 |
<td>
|
520 |
<?php
|
521 |
-
$plugin_registration_form_redirect = ((!
|
|
|
|
|
|
|
|
|
522 |
?>
|
523 |
-
<input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="homepage" <?php echo ($plugin_registration_form_redirect == 'homepage' ? 'checked="checked"' : '')
|
524 |
-
<input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="dashboard" <?php echo ($plugin_registration_form_redirect == 'dashboard' ? 'checked="checked"' : '')
|
525 |
-
<input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="custom" <?php echo ($plugin_registration_form_redirect == 'custom' ? 'checked="checked"' : '')
|
526 |
<input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_registration_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_registration_form_redirect_custom_url']) : ''); ?>" />
|
527 |
</td>
|
528 |
</tr>
|
@@ -533,4 +536,4 @@ function oa_display_social_login_settings ()
|
|
533 |
</form>
|
534 |
</div>
|
535 |
<?php
|
536 |
-
}
|
19 |
*/
|
20 |
function oa_social_login_admin_message ()
|
21 |
{
|
22 |
+
if (get_option ('oa_social_login_activation_message') !== '1')
|
23 |
{
|
24 |
echo '<div class="updated"><p><strong>Thank you for using the Social Login Plugin!</strong> Please go to the <strong>Settings\Social Login</strong> page to setup the plugin.</p></div>';
|
25 |
update_option ('oa_social_login_activation_message', '1');
|
30 |
/**
|
31 |
* Check API Settings trough an Ajax Call
|
32 |
*/
|
33 |
+
function oa_social_login_check_api_settings ()
|
34 |
{
|
35 |
+
check_ajax_referer ('oa_social_login_ajax_nonce');
|
36 |
|
37 |
+
//Check if all fields have been filled out
|
38 |
+
if (empty ($_POST ['api_subdomain']) OR empty ($_POST ['api_key']) OR empty ($_POST ['api_secret']))
|
39 |
{
|
40 |
echo 'error_not_all_fields_filled_out';
|
41 |
delete_option ('oa_social_login_api_settings_verified');
|
42 |
+
die ();
|
43 |
}
|
44 |
|
45 |
//Subdomain
|
46 |
+
$api_subdomain = trim (strtolower ($_POST ['api_subdomain']));
|
47 |
|
48 |
//Full domain entered
|
49 |
if (preg_match ("/([a-z0-9\-]+)\.api\.oneall\.com/i", $api_subdomain, $matches))
|
50 |
{
|
51 |
+
$api_subdomain = $matches [1];
|
52 |
}
|
53 |
|
54 |
//Check subdomain format
|
55 |
+
if (!preg_match ("/^[a-z0-9\-]+$/i", $api_subdomain))
|
56 |
{
|
57 |
echo 'error_subdomain_wrong_syntax';
|
58 |
delete_option ('oa_social_login_api_settings_verified');
|
59 |
+
die ();
|
60 |
}
|
61 |
|
62 |
//Domain
|
63 |
+
$api_domain = $api_subdomain . '.api.oneall.com';
|
64 |
|
65 |
//Key
|
66 |
+
$api_key = $_POST ['api_key'];
|
67 |
|
68 |
//Secret
|
69 |
+
$api_secret = $_POST ['api_secret'];
|
70 |
|
71 |
//Ping
|
72 |
+
$curl = curl_init ();
|
73 |
+
curl_setopt ($curl, CURLOPT_URL, 'https://' . $api_domain . '/tools/ping.json');
|
74 |
+
curl_setopt ($curl, CURLOPT_HEADER, 0);
|
75 |
+
curl_setopt ($curl, CURLOPT_USERPWD, $api_key . ":" . $api_secret);
|
76 |
+
curl_setopt ($curl, CURLOPT_TIMEOUT, 15);
|
77 |
+
curl_setopt ($curl, CURLOPT_VERBOSE, 0);
|
78 |
+
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
|
79 |
+
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
80 |
+
curl_setopt ($curl, CURLOPT_FAILONERROR, 0);
|
81 |
+
|
82 |
+
if (($json = curl_exec ($curl)) === false)
|
83 |
{
|
84 |
+
curl_close ($curl);
|
85 |
|
86 |
echo 'error_communication';
|
87 |
delete_option ('oa_social_login_api_settings_verified');
|
88 |
+
die ();
|
89 |
}
|
90 |
|
91 |
//Success
|
92 |
+
$http_code = curl_getinfo ($curl, CURLINFO_HTTP_CODE);
|
93 |
+
curl_close ($curl);
|
94 |
|
95 |
//Authentication Error
|
96 |
if ($http_code == 401)
|
97 |
{
|
98 |
echo 'error_authentication_credentials_wrong';
|
99 |
delete_option ('oa_social_login_api_settings_verified');
|
100 |
+
die ();
|
101 |
}
|
102 |
elseif ($http_code == 404)
|
103 |
{
|
104 |
echo 'error_subdomain_wrong';
|
105 |
delete_option ('oa_social_login_api_settings_verified');
|
106 |
+
die ();
|
107 |
}
|
108 |
elseif ($http_code == 200)
|
109 |
{
|
110 |
echo 'success';
|
111 |
update_option ('oa_social_login_api_settings_verified', '1');
|
112 |
+
die ();
|
113 |
}
|
114 |
}
|
115 |
+
add_action ('wp_ajax_check_api_settings', 'oa_social_login_check_api_settings');
|
116 |
|
117 |
|
118 |
/**
|
124 |
{
|
125 |
if (!wp_script_is ('oa_social_login_admin_js', 'registered'))
|
126 |
{
|
127 |
+
wp_register_script ('oa_social_login_admin_js', OA_SOCIAL_LOGIN_PLUGIN_URL . "/assets/js/admin.js");
|
128 |
}
|
129 |
|
130 |
wp_enqueue_script ('oa_social_login_admin_js');
|
131 |
wp_enqueue_script ('jquery');
|
132 |
|
133 |
+
$oa_social_login_ajax_nonce = wp_create_nonce ('oa_social_login_ajax_nonce');
|
134 |
+
wp_localize_script ('oa_social_login_admin_js', 'oa_social_login_ajax_nonce', array (
|
135 |
+
'value' => $oa_social_login_ajax_nonce
|
136 |
+
));
|
137 |
}
|
138 |
}
|
139 |
|
184 |
'api_key',
|
185 |
'api_secret',
|
186 |
'plugin_caption',
|
|
|
187 |
'plugin_link_verified_accounts',
|
188 |
'plugin_show_avatars_in_comments',
|
|
|
189 |
'plugin_display_in_login_form',
|
190 |
'plugin_login_form_redirect',
|
191 |
'plugin_login_form_redirect_custom_url',
|
|
|
192 |
'plugin_display_in_registration_form',
|
193 |
'plugin_registration_form_redirect',
|
194 |
'plugin_registration_form_redirect_custom_url'
|
201 |
}
|
202 |
|
203 |
//Subdomain is always lowercase
|
204 |
+
if (isset ($sanitzed_settings ['api_subdomain']))
|
205 |
{
|
206 |
+
$api_subdomain = strtolower ($sanitzed_settings ['api_subdomain']);
|
207 |
|
208 |
//Full domain entered
|
209 |
if (preg_match ("/([a-z0-9\-]+)\.api\.oneall\.com/i", $api_subdomain, $matches))
|
210 |
{
|
211 |
+
$api_subdomain = $matches [1];
|
212 |
}
|
213 |
|
214 |
+
$sanitzed_settings ['api_subdomain'] = $api_subdomain;
|
215 |
}
|
216 |
|
217 |
|
229 |
|
230 |
|
231 |
//Flag settings
|
232 |
+
$sanitzed_settings ['plugin_show_avatars_in_comments'] == ((isset ($sanitzed_settings ['plugin_show_avatars_in_comments']) AND $sanitzed_settings ['plugin_show_avatars_in_comments'] == '1') ? 1 : 0);
|
233 |
+
$sanitzed_settings ['plugin_link_verified_accounts'] == ((isset ($sanitzed_settings ['plugin_link_verified_accounts']) AND $sanitzed_settings ['plugin_link_verified_accounts'] == '0') ? 0 : 1);
|
234 |
+
$sanitzed_settings ['plugin_login_form_redirect'] = ((isset ($sanitzed_settings ['plugin_login_form_redirect']) AND in_array ($sanitzed_settings ['plugin_login_form_redirect'], array ('dashboard', 'homepage', 'custom'))) ? $sanitzed_settings ['plugin_login_form_redirect'] : 'homepage');
|
235 |
+
$sanitzed_settings ['plugin_registration_form_redirect'] = ((isset ($sanitzed_settings ['plugin_registration_form_redirect']) AND in_array ($sanitzed_settings ['plugin_registration_form_redirect'], array ('dashboard', 'homepage', 'custom'))) ? $sanitzed_settings ['plugin_registration_form_redirect'] : 'dashboard');
|
236 |
+
$sanitzed_settings ['plugin_display_in_login_form'] == ((isset ($sanitzed_settings ['plugin_display_in_login_form']) AND $sanitzed_settings ['plugin_display_in_login_form'] == '0') ? 0 : 1);
|
237 |
|
238 |
//Check Login Redirection Settings
|
239 |
+
if ($sanitzed_settings ['plugin_login_form_redirect'] == 'custom')
|
240 |
{
|
241 |
+
if (empty ($sanitzed_settings ['plugin_login_form_redirect_custom_url']))
|
242 |
{
|
243 |
+
$sanitzed_settings ['plugin_login_form_redirect'] = 'homepage';
|
244 |
}
|
245 |
}
|
246 |
else
|
247 |
{
|
248 |
+
$sanitzed_settings ['plugin_login_form_redirect_custom_url'] = '';
|
249 |
}
|
250 |
|
251 |
|
252 |
//Check Registration Redirection Settings
|
253 |
+
if ($sanitzed_settings ['plugin_registration_form_redirect'] == 'custom')
|
254 |
{
|
255 |
+
if (empty ($sanitzed_settings ['plugin_registration_form_redirect_custom_url']))
|
256 |
{
|
257 |
+
$sanitzed_settings ['plugin_registration_form_redirect'] = 'dashboard';
|
258 |
}
|
259 |
}
|
260 |
else
|
261 |
{
|
262 |
+
$sanitzed_settings ['plugin_registration_form_redirect_custom_url'] = '';
|
263 |
}
|
264 |
|
265 |
//Done
|
278 |
<div class="wrap">
|
279 |
<h2><?php _e ('Social Login Settings', 'oa_social_login'); ?></h2>
|
280 |
<?php
|
281 |
+
if (get_option ('oa_social_login_api_settings_verified') !== '1')
|
282 |
{
|
283 |
?>
|
284 |
<div class="oa_container oa_container_welcome">
|
291 |
<strong>Draw a larger audience and increase user engagement in a few simple steps.</strong>
|
292 |
</p>
|
293 |
<p>
|
294 |
+
To be able to use this plugin you first of all need to create a free account at <a href="https://app.oneall.com/signup/" target="_blank">http://www.oneall.com</a>
|
295 |
and setup a Site. After having created your account and setup your Site, please enter the Site settings in the form below.
|
296 |
</p>
|
297 |
+
<h3>You are in good company, 10000+ websites already trust us!</h3>
|
298 |
<p>
|
299 |
+
<a class="button-secondary" href="https://app.oneall.com/signup/" target="_blank"><strong>Create your free account now!</strong></a>
|
300 |
</p>
|
301 |
</div>
|
302 |
</div>
|
307 |
?>
|
308 |
<div class="oa_container oa_container_welcome">
|
309 |
<h3>
|
310 |
+
<?php _e ('Your API Account is setup correctly'); ?>
|
311 |
</h3>
|
312 |
<div class="oa_container_body">
|
313 |
<p>
|
315 |
Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement.
|
316 |
</p>
|
317 |
<p>
|
318 |
+
<a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong>Signin to your account</strong></a>
|
319 |
</p>
|
320 |
</div>
|
321 |
</div>
|
324 |
?>
|
325 |
<div class="oa_container oa_container_links">
|
326 |
<h3>
|
327 |
+
<?php _e ('Help, Updates & Documentation'); ?>
|
328 |
</h3>
|
329 |
<ul>
|
330 |
<li><a target="_blank" href="http://www.twitter.com/oneall">Follow us on Twitter</a> to stay informed about updates;</li>
|
340 |
<table class="form-table oa_form_table">
|
341 |
<tr>
|
342 |
<th class="head">
|
343 |
+
<?php _e ('API Settings', 'oa_social_login'); ?>
|
344 |
</th>
|
345 |
<th class="head">
|
346 |
<a href="https://app.oneall.com/applications/" target="_blank">Click here to create and view your API Credentials</a>
|
348 |
</tr>
|
349 |
<tr>
|
350 |
<th scope="row">
|
351 |
+
<label for="oneall_api_subdomain"><?php _e ('API Subdomain', 'oa_social_login'); ?>:</label>
|
352 |
</th>
|
353 |
<td>
|
354 |
<input type="text" id="oa_social_login_settings_api_subdomain" name="oa_social_login_settings[api_subdomain]" size="60" value="<?php echo (isset ($settings ['api_subdomain']) ? htmlspecialchars ($settings ['api_subdomain']) : ''); ?>" />
|
356 |
</tr>
|
357 |
<tr>
|
358 |
<th scope="row">
|
359 |
+
<label for="oneall_api_public_key"><?php _e ('API Public Key', 'oa_social_login'); ?>:</label>
|
360 |
</th>
|
361 |
<td>
|
362 |
<input type="text" id="oa_social_login_settings_api_key" name="oa_social_login_settings[api_key]" size="60" value="<?php echo (isset ($settings ['api_key']) ? htmlspecialchars ($settings ['api_key']) : ''); ?>" />
|
364 |
</tr>
|
365 |
<tr>
|
366 |
<th scope="row">
|
367 |
+
<label for="oneall_api_private_key"><?php _e ('API Private Key', 'oa_social_login'); ?>:</label>
|
368 |
</th>
|
369 |
<td>
|
370 |
<input type="text" id="oa_social_login_settings_api_secret" name="oa_social_login_settings[api_secret]" size="60" value="<?php echo (isset ($settings ['api_secret']) ? htmlspecialchars ($settings ['api_secret']) : ''); ?>" />
|
372 |
</tr>
|
373 |
<tr class="foot">
|
374 |
<td>
|
375 |
+
<a class="button-secondary" id="oa_social_login_test_api_settings" href="#"><?php _e ('Verify API Settings', 'oa_social_login'); ?></a>
|
376 |
</td>
|
377 |
<td>
|
378 |
<div id="oa_social_login_api_test_result"></div>
|
379 |
</td>
|
380 |
</tr>
|
381 |
</table>
|
|
|
382 |
<table class="form-table oa_form_table">
|
383 |
<tr>
|
384 |
<th class="head" colspan="2">
|
385 |
+
<?php _e ('Enable the social networks/identity providers of your choice');?>
|
386 |
</th>
|
387 |
</tr>
|
388 |
<?php
|
389 |
$i = 0;
|
390 |
+
foreach ($oa_social_login_providers AS $key => $provider_data)
|
391 |
{
|
392 |
+
?>
|
393 |
<tr class="<?php echo ((($i++) % 2) == 0) ? 'row_even' : 'row_odd' ?> row_provider">
|
394 |
<td class="row">
|
395 |
+
<label for="oneall_social_login_provider_<?php echo $key; ?>"><span class="oa_provider oa_provider_<?php echo $key; ?>" title="<?php echo htmlspecialchars ($provider_data['name']); ?>"><?php echo htmlspecialchars ($provider_data['name']); ?></span></label>
|
396 |
<input type="checkbox" id="oneall_social_login_provider_<?php echo $key; ?>" name="oa_social_login_settings[providers][<?php echo $key; ?>]" value="1" <?php checked ('1', $settings ['providers'] [$key]); ?> />
|
397 |
+
<label for="oneall_social_login_provider_<?php echo $key; ?>"><?php echo htmlspecialchars ($provider_data['name']); ?></label>
|
398 |
+
<?php echo (isset($provider_data['note']) ? (' ('.$provider_data['note'].')') : ''); ?>
|
399 |
</td>
|
400 |
</tr>
|
401 |
+
<?php
|
402 |
+
}
|
403 |
+
?>
|
404 |
</table>
|
|
|
405 |
<table class="form-table oa_form_table oa_form_table_settings">
|
406 |
<tr>
|
407 |
<th class="head">
|
408 |
+
<?php _e ('Basic Settings', 'oa_social_login'); ?>
|
409 |
</th>
|
410 |
</tr>
|
|
|
411 |
<tr class="row_odd">
|
412 |
<td>
|
413 |
+
<?php _e ('Enter the caption to be displayed above the social network login buttons:', 'oa_social_login'); ?>
|
414 |
</td>
|
415 |
</tr>
|
416 |
<tr class="row_even">
|
417 |
<td>
|
418 |
+
<input type="text" name="oa_social_login_settings[plugin_caption]" size="118" value="<?php echo (isset ($settings ['plugin_caption']) ? htmlspecialchars ($settings ['plugin_caption']) : _e ('Connect with:')); ?>" />
|
419 |
</td>
|
420 |
</tr>
|
|
|
421 |
<tr class="row_odd">
|
422 |
<td>
|
423 |
+
<?php _e ("If the user's social network profile has an avatar thumbnail, should we show it beside his comments?", 'oa_social_login'); ?>
|
424 |
</td>
|
425 |
</tr>
|
426 |
<tr class="row_even">
|
428 |
<?php
|
429 |
$plugin_show_avatars_in_comments = (isset ($settings ['plugin_show_avatars_in_comments']) AND $settings ['plugin_show_avatars_in_comments'] == '1');
|
430 |
?>
|
431 |
+
<input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="1" <?php echo ($plugin_show_avatars_in_comments ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, show user avatars from social networks if available'); ?><br />
|
432 |
+
<input type="radio" name="oa_social_login_settings[plugin_show_avatars_in_comments]" value="0" <?php echo (!$plugin_show_avatars_in_comments ? 'checked="checked"' : ''); ?> /> <?php _e ('No, display the default avatars'); ?> <strong>(<?php _e ('Default') ?>)</strong>
|
433 |
</td>
|
434 |
</tr>
|
435 |
</table>
|
436 |
<table class="form-table oa_form_table oa_form_table_settings">
|
437 |
<tr>
|
438 |
<th class="head">
|
439 |
+
<?php _e ('Login Settings', 'oa_social_login'); ?>
|
440 |
</th>
|
441 |
</tr>
|
442 |
<tr class="row_odd">
|
443 |
<td>
|
444 |
+
<?php _e ('Do you want to display the social network login buttons below the login form of your blog?', 'oa_social_login'); ?>
|
445 |
</td>
|
446 |
</tr>
|
447 |
<tr class="row_even">
|
448 |
<td>
|
449 |
<?php
|
450 |
+
$plugin_display_in_login_form = (!isset ($settings ['plugin_display_in_login_form']) OR $settings ['plugin_display_in_login_form'] == '1');
|
451 |
?>
|
452 |
+
<input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="1" <?php echo ($plugin_display_in_login_form ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, display the social network buttons below the login form'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
|
453 |
+
<input type="radio" name="oa_social_login_settings[plugin_display_in_login_form]" value="0" <?php echo (!$plugin_display_in_login_form ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the login form'); ?>
|
454 |
</td>
|
455 |
</tr>
|
|
|
456 |
<tr class="row_odd">
|
457 |
<td>
|
458 |
+
<?php _e ('Where should existent users be redirected to after having logged in with their social network account?', 'oa_social_login'); ?>
|
459 |
</td>
|
460 |
</tr>
|
461 |
<tr class="row_even">
|
462 |
<td>
|
463 |
<?php
|
464 |
+
$plugin_login_form_redirect = ((!isset ($settings ['plugin_login_form_redirect']) OR !in_array ($settings ['plugin_login_form_redirect'], array (
|
465 |
+
'dashboard',
|
466 |
+
'homepage',
|
467 |
+
'custom'
|
468 |
+
))) ? 'homepage' : $settings ['plugin_login_form_redirect']);
|
469 |
?>
|
470 |
+
<input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="homepage" <?php echo ($plugin_login_form_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the homepage of my blog'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
|
471 |
+
<input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="dashboard" <?php echo ($plugin_login_form_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to their account dashboard'); ?><br />
|
472 |
+
<input type="radio" name="oa_social_login_settings[plugin_login_form_redirect]" value="custom" <?php echo ($plugin_login_form_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the following url:'); ?><br />
|
473 |
<input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_login_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_login_form_redirect_custom_url']) : ''); ?>" />
|
474 |
</td>
|
475 |
</tr>
|
477 |
<table class="form-table oa_form_table oa_form_table_settings">
|
478 |
<tr>
|
479 |
<th class="head">
|
480 |
+
<?php _e ('Registration Settings', 'oa_social_login'); ?>
|
481 |
</th>
|
482 |
</tr>
|
483 |
<tr class="row_odd">
|
484 |
<td>
|
485 |
+
<?php _e ('If the email address of the social network profile is verified, should we try to link it to an existing account?', 'oa_social_login'); ?>
|
486 |
</td>
|
487 |
</tr>
|
488 |
<tr class="row_even">
|
489 |
<td>
|
490 |
<?php
|
491 |
+
$plugin_link_verified_accounts = (!isset ($settings ['plugin_link_verified_accounts']) OR $settings ['plugin_link_verified_accounts'] == '1');
|
492 |
?>
|
493 |
+
<input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="1" <?php echo ($plugin_link_verified_accounts ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, try to link verified social network profiles to existing blog accounts'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
|
494 |
+
<input type="radio" name="oa_social_login_settings[plugin_link_verified_accounts]" value="0" <?php echo (!$plugin_link_verified_accounts ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable account linking'); ?>
|
495 |
</td>
|
496 |
</tr>
|
497 |
<tr class="row_odd">
|
498 |
<td>
|
499 |
+
<?php _e ('Do you want to display the social network login buttons below the registration form of your blog?', 'oa_social_login'); ?>
|
500 |
</td>
|
501 |
</tr>
|
502 |
<tr class="row_even">
|
503 |
<td>
|
504 |
<?php
|
505 |
+
$plugin_display_in_registration_form = (!isset ($settings ['plugin_display_in_registration_form']) OR $settings ['plugin_display_in_registration_form'] == '1');
|
506 |
?>
|
507 |
+
<input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="1" <?php echo ($plugin_display_in_registration_form ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, display the social network buttons below the registration form'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
|
508 |
+
<input type="radio" name="oa_social_login_settings[plugin_display_in_registration_form]" value="0" <?php echo (!$plugin_display_in_registration_form ? 'checked="checked"' : ''); ?> /> <?php _e ('No, disable social network buttons in the registration form'); ?>
|
509 |
</td>
|
510 |
</tr>
|
511 |
|
512 |
<tr class="row_odd">
|
513 |
<td>
|
514 |
+
<?php _e ('Where should new users be redirected to after having registered with their social network account?', 'oa_social_login'); ?>
|
515 |
</td>
|
516 |
</tr>
|
517 |
<tr class="row_even">
|
518 |
<td>
|
519 |
<?php
|
520 |
+
$plugin_registration_form_redirect = ((!isset ($settings ['plugin_registration_form_redirect']) OR !in_array ($settings ['plugin_registration_form_redirect'], array (
|
521 |
+
'dashboard',
|
522 |
+
'homepage',
|
523 |
+
'custom'
|
524 |
+
))) ? 'dashboard' : $settings ['plugin_registration_form_redirect']);
|
525 |
?>
|
526 |
+
<input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="homepage" <?php echo ($plugin_registration_form_redirect == 'homepage' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the homepage of my blog'); ?><br />
|
527 |
+
<input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="dashboard" <?php echo ($plugin_registration_form_redirect == 'dashboard' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to their account dashboard'); ?> <strong>(<?php _e ('Default') ?>)</strong><br />
|
528 |
+
<input type="radio" name="oa_social_login_settings[plugin_registration_form_redirect]" value="custom" <?php echo ($plugin_registration_form_redirect == 'custom' ? 'checked="checked"' : ''); ?> /> <?php _e ('Redirect users to the following url:'); ?><br />
|
529 |
<input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="118" value="<?php echo (isset ($settings ['plugin_registration_form_redirect_custom_url']) ? htmlspecialchars ($settings ['plugin_registration_form_redirect_custom_url']) : ''); ?>" />
|
530 |
</td>
|
531 |
</tr>
|
536 |
</form>
|
537 |
</div>
|
538 |
<?php
|
539 |
+
}
|
includes/settings.php
CHANGED
@@ -3,14 +3,50 @@
|
|
3 |
* Providers that are currently enabled
|
4 |
*/
|
5 |
$oa_social_login_providers = array (
|
6 |
-
'facebook' =>
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
'
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
);
|
16 |
|
3 |
* Providers that are currently enabled
|
4 |
*/
|
5 |
$oa_social_login_providers = array (
|
6 |
+
'facebook' => array (
|
7 |
+
'name' => 'Facebook',
|
8 |
+
'default_enabled' => true
|
9 |
+
),
|
10 |
+
'twitter' => array (
|
11 |
+
'name' => 'Twitter',
|
12 |
+
'default_enabled' => true
|
13 |
+
),
|
14 |
+
'google' => array (
|
15 |
+
'name' => 'Google',
|
16 |
+
'default_enabled' => true
|
17 |
+
),
|
18 |
+
'linkedin' => array (
|
19 |
+
'name' => 'LinkedIn',
|
20 |
+
'default_enabled' => true
|
21 |
+
),
|
22 |
+
'yahoo' => array (
|
23 |
+
'name' => 'Yahoo',
|
24 |
+
'default_enabled' => true
|
25 |
+
),
|
26 |
+
'openid' => array (
|
27 |
+
'name' => 'OpenID',
|
28 |
+
'default_enabled' => true
|
29 |
+
),
|
30 |
+
'wordpress' => array (
|
31 |
+
'name' => 'Wordpress.com',
|
32 |
+
'default_enabled' => true
|
33 |
+
),
|
34 |
+
'hyves' => array (
|
35 |
+
'name' => 'Hyves',
|
36 |
+
'default_enabled' => false
|
37 |
+
),
|
38 |
+
'paypal' => array (
|
39 |
+
'name' => 'PayPal',
|
40 |
+
'default_enabled' => false
|
41 |
+
),
|
42 |
+
'livejournal' => array (
|
43 |
+
'name' => 'LiveJournal',
|
44 |
+
'default_enabled' => false
|
45 |
+
),
|
46 |
+
'vkontakte' => array (
|
47 |
+
'name' => 'VKontakte (Вконтакте)',
|
48 |
+
'default_enabled' => false,
|
49 |
+
'note' => 'To enable cyrillic characters, you might need <a target="_blank" href="http://wordpress.org/extend/plugins/wordpress-special-characters-in-usernames/">this plugin</a>'
|
50 |
+
)
|
51 |
);
|
52 |
|
oa-social-login.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Social Login
|
4 |
Plugin URI: http://www.oneall.com/
|
5 |
Description: Allow your visitors to <strong>comment, login and register with 20+ social networks</strong> like Twitter, Facebook, LinkedIn, Hyves, Вконтакте, Google or Yahoo.
|
6 |
-
Version: 1.
|
7 |
Author: Claude Schlesser
|
8 |
Author URI: http://www.oneall.com/
|
9 |
License: GPL2
|
@@ -11,13 +11,14 @@ License: GPL2
|
|
11 |
|
12 |
define ('OA_SOCIAL_LOGIN_PLUGIN_URL', plugins_url () . '/' . basename (dirname (__FILE__)));
|
13 |
|
14 |
-
|
15 |
/**
|
16 |
-
* Check technical requirements before activating the plugin
|
17 |
-
* Wordpress
|
|
|
18 |
*/
|
19 |
function oa_social_login_activate ()
|
20 |
{
|
|
|
21 |
if (!function_exists ('register_post_status'))
|
22 |
{
|
23 |
deactivate_plugins (basename (dirname (__FILE__)) . '/' . basename (__FILE__));
|
@@ -35,6 +36,28 @@ function oa_social_login_activate ()
|
|
35 |
register_activation_hook (__FILE__, 'oa_social_login_activate');
|
36 |
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
/**
|
39 |
* This file only has to be included for versions before 3.1.
|
40 |
* Deprecated since version 3.1, the functions are included by default
|
@@ -44,7 +67,6 @@ if (!function_exists ('email_exists'))
|
|
44 |
require_once(ABSPATH . WPINC . '/registration.php');
|
45 |
}
|
46 |
|
47 |
-
|
48 |
/**
|
49 |
* Include required files
|
50 |
*/
|
3 |
Plugin Name: Social Login
|
4 |
Plugin URI: http://www.oneall.com/
|
5 |
Description: Allow your visitors to <strong>comment, login and register with 20+ social networks</strong> like Twitter, Facebook, LinkedIn, Hyves, Вконтакте, Google or Yahoo.
|
6 |
+
Version: 1.6
|
7 |
Author: Claude Schlesser
|
8 |
Author URI: http://www.oneall.com/
|
9 |
License: GPL2
|
11 |
|
12 |
define ('OA_SOCIAL_LOGIN_PLUGIN_URL', plugins_url () . '/' . basename (dirname (__FILE__)));
|
13 |
|
|
|
14 |
/**
|
15 |
+
* Check technical requirements before activating the plugin.
|
16 |
+
* Wordpress 3.0 or newer required
|
17 |
+
* CURL Required
|
18 |
*/
|
19 |
function oa_social_login_activate ()
|
20 |
{
|
21 |
+
//Wordpress 3.0 or newer required
|
22 |
if (!function_exists ('register_post_status'))
|
23 |
{
|
24 |
deactivate_plugins (basename (dirname (__FILE__)) . '/' . basename (__FILE__));
|
36 |
register_activation_hook (__FILE__, 'oa_social_login_activate');
|
37 |
|
38 |
|
39 |
+
/**
|
40 |
+
* Add Settings Link
|
41 |
+
**/
|
42 |
+
function add_settings_link ($links, $file)
|
43 |
+
{
|
44 |
+
static $oa_social_login_plugin = null;
|
45 |
+
|
46 |
+
if (is_null ($oa_social_login_plugin))
|
47 |
+
{
|
48 |
+
$oa_social_login_plugin = plugin_basename (__FILE__);
|
49 |
+
}
|
50 |
+
|
51 |
+
if ($file == $oa_social_login_plugin)
|
52 |
+
{
|
53 |
+
$settings_link = '<a href="options-general.php?page=oa_social_login">' . __ ("Settings", "oa_social_login") . '</a>';
|
54 |
+
array_unshift ($links, $settings_link);
|
55 |
+
}
|
56 |
+
return $links;
|
57 |
+
}
|
58 |
+
add_filter ('plugin_action_links', 'add_settings_link', 10, 2);
|
59 |
+
|
60 |
+
|
61 |
/**
|
62 |
* This file only has to be included for versions before 3.1.
|
63 |
* Deprecated since version 3.1, the functions are included by default
|
67 |
require_once(ABSPATH . WPINC . '/registration.php');
|
68 |
}
|
69 |
|
|
|
70 |
/**
|
71 |
* Include required files
|
72 |
*/
|
readme.txt
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
=== Social Login ===
|
2 |
Contributors: ClaudeSchlesser
|
3 |
-
Tags: social login, social connect, facebook login, linkedin, google, yahoo, twitter login, openid, paypal, vkontakte, hyves, widget, plugin, social network login, comments
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.3
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
-
Allow your visitors to comment and login with social networks like Twitter, Facebook, Paypal, LinkedIn,
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
The Social Login Plugin is a professional though free Wordpress plugin that allows your visitors to comment,
|
13 |
-
login and register with social networks like Twitter, Facebook, LinkedIn, Paypal, Hyves, Вконтакте, Google or Yahoo. <br />
|
14 |
|
15 |
<strong>Choose where to add the Social Login Plugin:</strong>
|
16 |
<ul>
|
@@ -34,6 +34,7 @@ login and register with social networks like Twitter, Facebook, LinkedIn, Paypal
|
|
34 |
<li>Paypal</li>
|
35 |
<li>Yahoo</li>
|
36 |
<li>OpenID</li>
|
|
|
37 |
<li>Wordpress.com</li>
|
38 |
<li>Hyves</li>
|
39 |
<li>VKontakte (Вконтакте)</li>
|
@@ -60,7 +61,7 @@ You should not have to change your templates.
|
|
60 |
The Social Login seamlessly integrates into your blog by using predefined hooks.
|
61 |
|
62 |
|
63 |
-
= I have a custom template and the plugin is not displayed
|
64 |
|
65 |
The plugin uses predefined hooks. If your theme does not support these hooks,
|
66 |
you can add the Social Login form manually to your theme by inserting the following code
|
@@ -70,28 +71,27 @@ in your template (at the location where it should be displayed, i.e. above the c
|
|
70 |
|
71 |
Do not hesitate to contact us if you need further assistance.
|
72 |
|
73 |
-
=
|
74 |
|
75 |
Per default WordPress does not allow to use special characters in usernames.
|
76 |
If you encounter any problems with users having cyrillic characters in their
|
77 |
usernames, please consider installing the following plugin to fix the problem:
|
78 |
<a href="http://wordpress.org/extend/plugins/wordpress-special-characters-in-usernames/">Wordpress Special Characters In Usernames</a>
|
79 |
|
80 |
-
= Do I have to change my
|
81 |
|
82 |
The plugins does not rely on mod_rewrite and does not need any additional rules.
|
83 |
It should work out of the box.
|
84 |
|
85 |
|
86 |
-
= Where can I report bugs, leave
|
87 |
|
88 |
-
Our team answers your questions at
|
89 |
http://www.oneall.com/company/contact-us/
|
90 |
|
91 |
-
The plugin documentation is available at
|
92 |
http://docs.oneall.com/plugins/guide/social-login-wordpress/
|
93 |
|
94 |
-
|
95 |
== Screenshots ==
|
96 |
|
97 |
1. **Comment** - Comment formular (Social Network Buttons are included)
|
@@ -133,4 +133,11 @@ http://docs.oneall.com/plugins/guide/social-login-wordpress/
|
|
133 |
= 1.5 =
|
134 |
* Social Network Avatars fixed
|
135 |
* Social Buttons no longer displayed for customs hooks if logged in
|
136 |
-
* KISS for API Settings Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
=== Social Login ===
|
2 |
Contributors: ClaudeSchlesser
|
3 |
+
Tags: social login, social connect, facebook login, linkedin, livejournal, google, yahoo, twitter login, openid, paypal, vkontakte, hyves, widget, plugin, social network login, comments
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.3
|
6 |
+
Stable tag: 1.6
|
7 |
|
8 |
+
Allow your visitors to comment and login with social networks like Twitter, Facebook, Paypal, LinkedIn, LiveJournal, OpenID, VKontakte, Google, Yahoo
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
The Social Login Plugin is a professional though free Wordpress plugin that allows your visitors to comment,
|
13 |
+
login and register with social networks like Twitter, Facebook, LinkedIn, Paypal, LiveJournal, Hyves, Вконтакте, Google or Yahoo. <br />
|
14 |
|
15 |
<strong>Choose where to add the Social Login Plugin:</strong>
|
16 |
<ul>
|
34 |
<li>Paypal</li>
|
35 |
<li>Yahoo</li>
|
36 |
<li>OpenID</li>
|
37 |
+
<li>LiveJournal</li>
|
38 |
<li>Wordpress.com</li>
|
39 |
<li>Hyves</li>
|
40 |
<li>VKontakte (Вконтакте)</li>
|
61 |
The Social Login seamlessly integrates into your blog by using predefined hooks.
|
62 |
|
63 |
|
64 |
+
= I have a custom template and the plugin is not displayed correctly =
|
65 |
|
66 |
The plugin uses predefined hooks. If your theme does not support these hooks,
|
67 |
you can add the Social Login form manually to your theme by inserting the following code
|
71 |
|
72 |
Do not hesitate to contact us if you need further assistance.
|
73 |
|
74 |
+
= My users cannot login or leave comment with VKontakte (Вконтакте) =
|
75 |
|
76 |
Per default WordPress does not allow to use special characters in usernames.
|
77 |
If you encounter any problems with users having cyrillic characters in their
|
78 |
usernames, please consider installing the following plugin to fix the problem:
|
79 |
<a href="http://wordpress.org/extend/plugins/wordpress-special-characters-in-usernames/">Wordpress Special Characters In Usernames</a>
|
80 |
|
81 |
+
= Do I have to change my Rewrite Settings? =
|
82 |
|
83 |
The plugins does not rely on mod_rewrite and does not need any additional rules.
|
84 |
It should work out of the box.
|
85 |
|
86 |
|
87 |
+
= Where can I report bugs, leave my feedbak and get support? =
|
88 |
|
89 |
+
Our team answers your questions at:
|
90 |
http://www.oneall.com/company/contact-us/
|
91 |
|
92 |
+
The plugin documentation is available at:
|
93 |
http://docs.oneall.com/plugins/guide/social-login-wordpress/
|
94 |
|
|
|
95 |
== Screenshots ==
|
96 |
|
97 |
1. **Comment** - Comment formular (Social Network Buttons are included)
|
133 |
= 1.5 =
|
134 |
* Social Network Avatars fixed
|
135 |
* Social Buttons no longer displayed for customs hooks if logged in
|
136 |
+
* KISS for API Settings Setup
|
137 |
+
|
138 |
+
= 1.6 =
|
139 |
+
* LiveJournal added
|
140 |
+
* PayPal added
|
141 |
+
* Settings link added
|
142 |
+
* API Communication Check added
|
143 |
+
* Cyrillic character support
|