Version Description
- Buddypress avatar bugfix
- Do not create users without email addresses when plugin set to request emails
- Support for WP_PROXY_HOST added
- Filter for callback uri added
- More pannel added
Download this release
Release Info
Developer | ClaudeSchlesser |
Plugin | Social Login |
Version | 5.2 |
Comparing to | |
See all releases |
Code changes from version 5.0 to 5.2
- assets/css/admin.css +97 -4
- assets/css/site.css +8 -3
- assets/img/loudvoice.png +0 -0
- assets/img/social_sharing.png +0 -0
- assets/js/admin.js +2 -2
- includes/admin.php +121 -36
- includes/communication.php +152 -105
- includes/toolbox.php +36 -0
- includes/user_interface.php +78 -39
- languages/oa_social_login-de_DE.po +1 -1
- languages/oa_social_login-fr_CA.po +1 -1
- languages/oa_social_login-fr_FR.po +1 -1
- oa-social-login.php +2 -2
- readme.txt +11 -4
assets/css/admin.css
CHANGED
@@ -1,12 +1,48 @@
|
|
1 |
/* ********************* Page Wrapper */
|
2 |
#oa_social_login_page {
|
3 |
-
width:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
}
|
5 |
|
6 |
/* ********************* Boxes */
|
7 |
.oa_social_login_box {
|
8 |
border: 1px solid #CCCCCC;
|
9 |
-
margin-bottom:
|
10 |
padding: 10px 15px;
|
11 |
}
|
12 |
|
@@ -17,6 +53,45 @@
|
|
17 |
padding-bottom: 5px;
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
#oa_social_login_box_status {
|
21 |
background-color: #E1EDFF;
|
22 |
}
|
@@ -83,16 +158,25 @@
|
|
83 |
text-decoration: none;
|
84 |
}
|
85 |
|
86 |
-
.oa_social_login_table tr.row_odd
|
|
|
87 |
color: #222;
|
88 |
background-color: #ddd;
|
89 |
border-bottom: 1px dotted #BBBBBB;
|
|
|
90 |
}
|
91 |
|
92 |
-
.oa_social_login_table tr.row_even
|
|
|
93 |
color: #333;
|
94 |
background-color: #fff;
|
95 |
border-bottom: 1px dotted #bbb;
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
.oa_social_login_table tr td.row_multi {
|
@@ -133,6 +217,15 @@
|
|
133 |
font-weight: bold;
|
134 |
}
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
/* ********************* Providers */
|
137 |
.oa_social_login_table tr.row_provider td {
|
138 |
line-height: 35px;
|
1 |
/* ********************* Page Wrapper */
|
2 |
#oa_social_login_page {
|
3 |
+
max-width: 900px;
|
4 |
+
}
|
5 |
+
|
6 |
+
#oa_social_login_page.oa_social_login_more{
|
7 |
+
width:774px;
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
/* ********************* Plugins */
|
12 |
+
.oa_social_login_plugin{
|
13 |
+
border: 1px solid #ccc;
|
14 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
15 |
+
margin: 10px 0 25px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.oa_social_login_plugin .oa_social_login_plugin_img img{
|
19 |
+
float: left;
|
20 |
+
height: 250px;
|
21 |
+
width: 772px;
|
22 |
+
}
|
23 |
+
|
24 |
+
.oa_social_login_plugin a.button-primary{
|
25 |
+
height: 21px;
|
26 |
+
line-height: 19px;
|
27 |
+
padding: 0 10px;
|
28 |
+
vertical-align: top;
|
29 |
+
}
|
30 |
+
|
31 |
+
.oa_social_login_plugin .oa_social_login_plugin_desc {
|
32 |
+
background: #eee none repeat scroll 0 0;
|
33 |
+
border-top: 1px solid #fcfcfc;
|
34 |
+
box-shadow: 0 0 42px 0 rgba(100, 100, 100, 0.1) inset;
|
35 |
+
font-size: 16px;
|
36 |
+
line-height: 24px;
|
37 |
+
overflow: hidden;
|
38 |
+
padding: 15px;
|
39 |
+
text-shadow: 0 1px 1px #fff;
|
40 |
}
|
41 |
|
42 |
/* ********************* Boxes */
|
43 |
.oa_social_login_box {
|
44 |
border: 1px solid #CCCCCC;
|
45 |
+
margin-bottom: 35px;
|
46 |
padding: 10px 15px;
|
47 |
}
|
48 |
|
53 |
padding-bottom: 5px;
|
54 |
}
|
55 |
|
56 |
+
.oa_social_login_box .oa_social_login_button_wrap{
|
57 |
+
text-align:center;
|
58 |
+
padding: 10px 0 20px;
|
59 |
+
}
|
60 |
+
|
61 |
+
.oa_social_login_box .oa_social_login_button_wrap a{
|
62 |
+
font-size: 14px;
|
63 |
+
height: 40px;
|
64 |
+
line-height: 40px;
|
65 |
+
padding: 0 33px;
|
66 |
+
margin:0 10px;
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
#oa_social_login_box_started{
|
72 |
+
background-color: #dff0d8;
|
73 |
+
border-color: #c4d7b4;
|
74 |
+
color: #3c763d;
|
75 |
+
}
|
76 |
+
|
77 |
+
#oa_social_login_box_started a {
|
78 |
+
color: #1a541b;
|
79 |
+
}
|
80 |
+
|
81 |
+
#oa_social_login_box_started a:hover{
|
82 |
+
text-decoration:none;
|
83 |
+
color: #111;
|
84 |
+
}
|
85 |
+
|
86 |
+
#oa_social_login_box_started a.button-secondary{
|
87 |
+
color: #555;
|
88 |
+
}
|
89 |
+
|
90 |
+
#oa_social_login_box_started h3{
|
91 |
+
text-align:center;
|
92 |
+
color: #4a844b;
|
93 |
+
}
|
94 |
+
|
95 |
#oa_social_login_box_status {
|
96 |
background-color: #E1EDFF;
|
97 |
}
|
158 |
text-decoration: none;
|
159 |
}
|
160 |
|
161 |
+
.oa_social_login_table tr.row_odd,
|
162 |
+
.oa_social_login_table tr.row_odd td {
|
163 |
color: #222;
|
164 |
background-color: #ddd;
|
165 |
border-bottom: 1px dotted #BBBBBB;
|
166 |
+
line-height: 23px
|
167 |
}
|
168 |
|
169 |
+
.oa_social_login_table tr.row_even,
|
170 |
+
.oa_social_login_table tr.row_even td {
|
171 |
color: #333;
|
172 |
background-color: #fff;
|
173 |
border-bottom: 1px dotted #bbb;
|
174 |
+
line-height: 23px
|
175 |
+
}
|
176 |
+
|
177 |
+
|
178 |
+
.oa_social_login_table td.col_unpadded{
|
179 |
+
padding:0;
|
180 |
}
|
181 |
|
182 |
.oa_social_login_table tr td.row_multi {
|
217 |
font-weight: bold;
|
218 |
}
|
219 |
|
220 |
+
|
221 |
+
.oa_social_login_table a.social-sharing{
|
222 |
+
background-image: url("../img/social_sharing.png");
|
223 |
+
background-repeat:no-repeat;
|
224 |
+
display: block;
|
225 |
+
height: 250px;
|
226 |
+
width:772px;
|
227 |
+
}
|
228 |
+
|
229 |
/* ********************* Providers */
|
230 |
.oa_social_login_table tr.row_provider td {
|
231 |
line-height: 35px;
|
assets/css/site.css
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
overflow: auto;
|
29 |
background-color: #eee;
|
30 |
z-index: 999998;
|
31 |
-
box-shadow: 10px 10px 12px -11px rgba(0,0,0,0.75);
|
32 |
}
|
33 |
|
34 |
.oa_social_login_modal_inner {
|
@@ -56,6 +56,11 @@
|
|
56 |
|
57 |
.oa_social_login_button {
|
58 |
font-size: 13px;
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
.oa_social_login_modal_notice {
|
@@ -75,8 +80,8 @@
|
|
75 |
}
|
76 |
|
77 |
.oa_social_login_modal_body fieldset {
|
78 |
-
border:0 none;
|
79 |
-
margin:0
|
80 |
padding: 0;
|
81 |
}
|
82 |
|
28 |
overflow: auto;
|
29 |
background-color: #eee;
|
30 |
z-index: 999998;
|
31 |
+
box-shadow: 10px 10px 12px -11px rgba(0, 0, 0, 0.75);
|
32 |
}
|
33 |
|
34 |
.oa_social_login_modal_inner {
|
56 |
|
57 |
.oa_social_login_button {
|
58 |
font-size: 13px;
|
59 |
+
padding: 0 20px;
|
60 |
+
}
|
61 |
+
|
62 |
+
.oa_social_login_button#oa_social_login_button_cancel {
|
63 |
+
color: #aaa;
|
64 |
}
|
65 |
|
66 |
.oa_social_login_modal_notice {
|
80 |
}
|
81 |
|
82 |
.oa_social_login_modal_body fieldset {
|
83 |
+
border: 0 none;
|
84 |
+
margin: 0;
|
85 |
padding: 0;
|
86 |
}
|
87 |
|
assets/img/loudvoice.png
ADDED
Binary file
|
assets/img/social_sharing.png
ADDED
Binary file
|
assets/js/admin.js
CHANGED
@@ -8,7 +8,7 @@ jQuery(document).ready(function($) {
|
|
8 |
|
9 |
var data = {
|
10 |
_ajax_nonce: objectL10n.oa_social_login_ajax_nonce,
|
11 |
-
action: '
|
12 |
};
|
13 |
|
14 |
message_container = jQuery('#oa_social_login_api_connection_handler_result');
|
@@ -112,7 +112,7 @@ jQuery(document).ready(function($) {
|
|
112 |
|
113 |
var data = {
|
114 |
_ajax_nonce: objectL10n.oa_social_login_ajax_nonce,
|
115 |
-
action: '
|
116 |
api_connection_handler: handler,
|
117 |
api_connection_use_https: use_https,
|
118 |
api_subdomain: subdomain,
|
8 |
|
9 |
var data = {
|
10 |
_ajax_nonce: objectL10n.oa_social_login_ajax_nonce,
|
11 |
+
action: 'oa_social_login_autodetect_api_connection_handler'
|
12 |
};
|
13 |
|
14 |
message_container = jQuery('#oa_social_login_api_connection_handler_result');
|
112 |
|
113 |
var data = {
|
114 |
_ajax_nonce: objectL10n.oa_social_login_ajax_nonce,
|
115 |
+
action: 'oa_social_login_check_api_settings',
|
116 |
api_connection_handler: handler,
|
117 |
api_connection_use_https: use_https,
|
118 |
api_subdomain: subdomain,
|
includes/admin.php
CHANGED
@@ -54,7 +54,7 @@ add_action ('manage_users_custom_column', 'oa_social_login_admin_user_colum_disp
|
|
54 |
* Add administration area links
|
55 |
**/
|
56 |
function oa_social_login_admin_menu ()
|
57 |
-
{
|
58 |
//Setup
|
59 |
$page = add_menu_page ('OneAll Social Login ' . __ ('Setup', 'oa_social_login'), 'Social Login', 'manage_options', 'oa_social_login_setup', 'oa_display_social_login_setup');
|
60 |
add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
|
@@ -63,6 +63,10 @@ function oa_social_login_admin_menu ()
|
|
63 |
$page = add_submenu_page ('oa_social_login_setup', 'OneAll Social Login ' . __ ('Settings'), __ ('Settings'), 'manage_options', 'oa_social_login_settings', 'oa_display_social_login_settings');
|
64 |
add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
|
65 |
|
|
|
|
|
|
|
|
|
66 |
//Fix Setup title
|
67 |
global $submenu;
|
68 |
if (is_array ($submenu) AND isset ($submenu ['oa_social_login_setup']))
|
@@ -174,7 +178,7 @@ function oa_social_login_admin_autodetect_api_connection_handler ()
|
|
174 |
echo 'error_autodetect_api_no_handler';
|
175 |
die ();
|
176 |
}
|
177 |
-
add_action ('
|
178 |
|
179 |
|
180 |
/**
|
@@ -196,7 +200,6 @@ function oa_social_login_admin_check_api_settings ()
|
|
196 |
$api_connection_handler = ((!empty ($_POST ['api_connection_handler']) AND $_POST ['api_connection_handler'] == 'fsockopen') ? 'fsockopen' : 'curl');
|
197 |
$api_connection_use_https = ((!isset ($_POST ['api_connection_use_https']) OR $_POST ['api_connection_use_https'] == '1') ? true : false);
|
198 |
|
199 |
-
|
200 |
//FSOCKOPEN
|
201 |
if ($api_connection_handler == 'fsockopen')
|
202 |
{
|
@@ -282,7 +285,7 @@ function oa_social_login_admin_check_api_settings ()
|
|
282 |
}
|
283 |
die ();
|
284 |
}
|
285 |
-
add_action ('
|
286 |
|
287 |
|
288 |
/**
|
@@ -472,9 +475,11 @@ function oa_social_login_settings_validate ($settings)
|
|
472 |
'plugin_display_in_login_form',
|
473 |
'plugin_login_form_redirect',
|
474 |
'plugin_login_form_redirect_custom_url',
|
|
|
475 |
'plugin_display_in_registration_form',
|
476 |
'plugin_registration_form_redirect',
|
477 |
'plugin_registration_form_redirect_custom_url',
|
|
|
478 |
'plugin_comment_show_if_members_only',
|
479 |
'plugin_comment_auto_approve',
|
480 |
'plugin_comment_show',
|
@@ -508,7 +513,10 @@ function oa_social_login_settings_validate ($settings)
|
|
508 |
$sanitzed_settings ['plugin_display_in_registration_form'] = ($sanitzed_settings ['plugin_display_in_registration_form'] == '0' ? 0 : 1);
|
509 |
$sanitzed_settings ['plugin_link_verified_accounts'] = ($sanitzed_settings ['plugin_link_verified_accounts'] == '0' ? 0 : 1);
|
510 |
$sanitzed_settings ['plugin_comment_auto_approve'] = ($sanitzed_settings ['plugin_comment_auto_approve'] == '1' ? 1 : 0);
|
511 |
-
|
|
|
|
|
|
|
512 |
//Multiple settings
|
513 |
$sanitzed_settings ['plugin_show_avatars_in_comments'] = (in_array ($sanitzed_settings ['plugin_show_avatars_in_comments'], array (0, 1, 2)) ? $sanitzed_settings ['plugin_show_avatars_in_comments'] : 0);
|
514 |
|
@@ -578,6 +586,62 @@ function oa_social_login_settings_validate ($settings)
|
|
578 |
}
|
579 |
|
580 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
/**
|
582 |
* Display Settings Page
|
583 |
**/
|
@@ -590,31 +654,32 @@ function oa_display_social_login_setup ()
|
|
590 |
<div id="oa_social_login_page" class="oa_social_login_setup">
|
591 |
<h2>OneAll Social Login <?php echo (defined ('OA_SOCIAL_LOGIN_VERSION') ? OA_SOCIAL_LOGIN_VERSION : ''); ?></h2>
|
592 |
<h2 class="nav-tab-wrapper">
|
593 |
-
|
594 |
-
|
595 |
-
|
|
|
596 |
<?php
|
597 |
if (get_option ('oa_social_login_api_settings_verified') !== '1')
|
598 |
{
|
599 |
?>
|
600 |
<p>
|
601 |
-
<?php _e ('Allow your visitors to comment, login and register with
|
602 |
<strong><?php _e ('Draw a larger audience and increase your user engagement in a few simple steps.', 'oa_social_login'); ?> </strong>
|
603 |
</p>
|
604 |
-
<div class="oa_social_login_box" id="
|
605 |
<div class="oa_social_login_box_title">
|
606 |
<?php _e ('Get Started!', 'oa_social_login'); ?>
|
607 |
</div>
|
608 |
<p>
|
609 |
<?php printf (__ ('To be able to use this plugin you first of all need to create a free account at %s and setup a Site.', 'oa_social_login'), '<a href="https://app.oneall.com/signup/wp" target="_blank">http://www.oneall.com</a>'); ?>
|
610 |
<?php _e ('After having created your account and setup your Site, please enter the Site settings in the form below.', 'oa_social_login'); ?>
|
611 |
-
<?php _e ("Don't worry the setup takes only a
|
612 |
</p>
|
613 |
-
<p>
|
614 |
<a class="button-secondary" href="https://app.oneall.com/signup/wp" target="_blank"><strong><?php _e ('Click here to setup your free account', 'oa_social_login'); ?></strong></a>
|
615 |
</p>
|
616 |
<h3>
|
617 |
-
<?php printf (__ ('You are in good company! This plugin is used on more than %s websites!', 'oa_social_login'), '
|
618 |
</h3>
|
619 |
</div>
|
620 |
<?php
|
@@ -628,29 +693,17 @@ function oa_display_social_login_setup ()
|
|
628 |
<?php _e ('Your API Account is setup correctly', 'oa_social_login'); ?>
|
629 |
</div>
|
630 |
<p>
|
631 |
-
<?php _e ('Login to your account to manage your
|
632 |
<?php _e ("Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement.", 'oa_social_login'); ?>
|
633 |
</p>
|
634 |
-
<p>
|
635 |
-
<a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong><?php _e ('
|
|
|
636 |
</p>
|
637 |
</div>
|
638 |
<?php
|
639 |
}
|
640 |
-
|
641 |
-
<div class="oa_social_login_box" id="oa_social_login_box_help">
|
642 |
-
<div class="oa_social_login_box_title">
|
643 |
-
<?php _e ('Help, Updates & Documentation', 'oa_social_login'); ?>
|
644 |
-
</div>
|
645 |
-
<ul>
|
646 |
-
<li><?php printf (__ ('<a target="_blank" href="%s">Follow us on Twitter</a> to stay informed about updates', 'oa_social_login'), 'http://www.twitter.com/oneall'); ?>;</li>
|
647 |
-
<li><?php printf (__ ('<a target="_blank" href="%s">Read the online documentation</a> for more information about this plugin', 'oa_social_login'), 'http://docs.oneall.com/plugins/guide/social-login-wordpress/'); ?>;</li>
|
648 |
-
<li><?php printf (__ ('<a target="_blank" href="%s">Contact us</a> if you have feedback or need assistance', 'oa_social_login'), 'http://www.oneall.com/company/contact-us/'); ?>.
|
649 |
-
<li><?php printf (__ ('We also have <a target="_blank" href="%s">turnkey plugins</a> for Drupal, PrestaShop, Joomla, phpBB andy many others ...', 'oa_social_login'), 'http://docs.oneall.com/plugins/'); ?>.
|
650 |
-
</li>
|
651 |
-
</ul>
|
652 |
-
</div>
|
653 |
-
<?php
|
654 |
if (!empty ($_REQUEST ['settings-updated']) AND strtolower ($_REQUEST ['settings-updated']) == 'true')
|
655 |
{
|
656 |
?>
|
@@ -863,9 +916,10 @@ function oa_display_social_login_settings ()
|
|
863 |
<div id="oa_social_login_page" class="oa_social_login_settings">
|
864 |
<h2>OneAll Social Login <?php echo (defined ('OA_SOCIAL_LOGIN_VERSION') ? OA_SOCIAL_LOGIN_VERSION : ''); ?></h2>
|
865 |
<h2 class="nav-tab-wrapper">
|
866 |
-
|
867 |
-
|
868 |
-
|
|
|
869 |
<p></p>
|
870 |
<form method="post" action="options.php">
|
871 |
<?php
|
@@ -937,7 +991,7 @@ function oa_display_social_login_settings ()
|
|
937 |
$plugin_add_column_user_list = ((isset ($settings ['plugin_add_column_user_list']) AND in_array ($settings ['plugin_add_column_user_list'], array (0, 1))) ? $settings ['plugin_add_column_user_list'] : 0);
|
938 |
?>
|
939 |
<input type="radio" name="oa_social_login_settings[plugin_add_column_user_list]" value="1" <?php echo ($plugin_add_column_user_list == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, add a new column to the user list and display the social network that the user connected with', 'oa_social_login'); ?> <br />
|
940 |
-
<input type="radio" name="oa_social_login_settings[plugin_add_column_user_list]" value="0" <?php echo ($plugin_add_column_user_list == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No,
|
941 |
</td>
|
942 |
</tr>
|
943 |
<tr class="row_odd">
|
@@ -973,7 +1027,7 @@ function oa_display_social_login_settings ()
|
|
973 |
?>
|
974 |
<input type="radio" name="oa_social_login_settings[plugin_require_email]" value="0" <?php echo ($plugin_require_email == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, simplify the registration by automatically creating a placeholder email', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
|
975 |
<input type="radio" name="oa_social_login_settings[plugin_require_email]" value="1" <?php echo ($plugin_require_email == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, require the user to enter his email address manually and display this message:', 'oa_social_login'); ?> <br />
|
976 |
-
<textarea name="oa_social_login_settings[plugin_require_email_text]" cols="
|
977 |
<span class="description"><?php _e ('HTML is allowed, the placeholder %s is replaced by the name of the social network used to connect.', 'oa_social_login'); ?></span>
|
978 |
</td>
|
979 |
</tr>
|
@@ -1119,6 +1173,23 @@ function oa_display_social_login_settings ()
|
|
1119 |
<input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_login_form_redirect_custom_url); ?>" />
|
1120 |
</td>
|
1121 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1122 |
</table>
|
1123 |
<table class="form-table oa_social_login_table">
|
1124 |
<tr class="row_head">
|
@@ -1158,6 +1229,20 @@ function oa_display_social_login_settings ()
|
|
1158 |
<input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_registration_form_redirect_custom_url); ?>" />
|
1159 |
</td>
|
1160 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1161 |
</table>
|
1162 |
<table class="form-table oa_social_login_table">
|
1163 |
<tr class="row_head">
|
@@ -1210,4 +1295,4 @@ function oa_display_social_login_settings ()
|
|
1210 |
</div>
|
1211 |
</div>
|
1212 |
<?php
|
1213 |
-
}
|
54 |
* Add administration area links
|
55 |
**/
|
56 |
function oa_social_login_admin_menu ()
|
57 |
+
{
|
58 |
//Setup
|
59 |
$page = add_menu_page ('OneAll Social Login ' . __ ('Setup', 'oa_social_login'), 'Social Login', 'manage_options', 'oa_social_login_setup', 'oa_display_social_login_setup');
|
60 |
add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
|
63 |
$page = add_submenu_page ('oa_social_login_setup', 'OneAll Social Login ' . __ ('Settings'), __ ('Settings'), 'manage_options', 'oa_social_login_settings', 'oa_display_social_login_settings');
|
64 |
add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
|
65 |
|
66 |
+
//Sharing
|
67 |
+
$page = add_submenu_page ('oa_social_login_setup', 'OneAll Social Login ' . __ ('+More'), __ ('+More'), 'manage_options', 'oa_social_login_more', 'oa_display_social_login_more');
|
68 |
+
add_action ('admin_print_styles-' . $page, 'oa_social_login_admin_css');
|
69 |
+
|
70 |
//Fix Setup title
|
71 |
global $submenu;
|
72 |
if (is_array ($submenu) AND isset ($submenu ['oa_social_login_setup']))
|
178 |
echo 'error_autodetect_api_no_handler';
|
179 |
die ();
|
180 |
}
|
181 |
+
add_action ('wp_ajax_oa_social_login_autodetect_api_connection_handler', 'oa_social_login_admin_autodetect_api_connection_handler');
|
182 |
|
183 |
|
184 |
/**
|
200 |
$api_connection_handler = ((!empty ($_POST ['api_connection_handler']) AND $_POST ['api_connection_handler'] == 'fsockopen') ? 'fsockopen' : 'curl');
|
201 |
$api_connection_use_https = ((!isset ($_POST ['api_connection_use_https']) OR $_POST ['api_connection_use_https'] == '1') ? true : false);
|
202 |
|
|
|
203 |
//FSOCKOPEN
|
204 |
if ($api_connection_handler == 'fsockopen')
|
205 |
{
|
285 |
}
|
286 |
die ();
|
287 |
}
|
288 |
+
add_action ('wp_ajax_oa_social_login_check_api_settings', 'oa_social_login_admin_check_api_settings');
|
289 |
|
290 |
|
291 |
/**
|
475 |
'plugin_display_in_login_form',
|
476 |
'plugin_login_form_redirect',
|
477 |
'plugin_login_form_redirect_custom_url',
|
478 |
+
'plugin_protect_login_redirect_url',
|
479 |
'plugin_display_in_registration_form',
|
480 |
'plugin_registration_form_redirect',
|
481 |
'plugin_registration_form_redirect_custom_url',
|
482 |
+
'plugin_protect_registration_redirect_url',
|
483 |
'plugin_comment_show_if_members_only',
|
484 |
'plugin_comment_auto_approve',
|
485 |
'plugin_comment_show',
|
513 |
$sanitzed_settings ['plugin_display_in_registration_form'] = ($sanitzed_settings ['plugin_display_in_registration_form'] == '0' ? 0 : 1);
|
514 |
$sanitzed_settings ['plugin_link_verified_accounts'] = ($sanitzed_settings ['plugin_link_verified_accounts'] == '0' ? 0 : 1);
|
515 |
$sanitzed_settings ['plugin_comment_auto_approve'] = ($sanitzed_settings ['plugin_comment_auto_approve'] == '1' ? 1 : 0);
|
516 |
+
$sanitzed_settings ['plugin_protect_registration_redirect_url'] = ($sanitzed_settings ['plugin_protect_registration_redirect_url'] == '1' ? 1 : 0);
|
517 |
+
$sanitzed_settings ['plugin_protect_login_redirect_url'] = ($sanitzed_settings ['plugin_protect_login_redirect_url'] == '1' ? 1 : 0);
|
518 |
+
|
519 |
+
|
520 |
//Multiple settings
|
521 |
$sanitzed_settings ['plugin_show_avatars_in_comments'] = (in_array ($sanitzed_settings ['plugin_show_avatars_in_comments'], array (0, 1, 2)) ? $sanitzed_settings ['plugin_show_avatars_in_comments'] : 0);
|
522 |
|
586 |
}
|
587 |
|
588 |
|
589 |
+
/**
|
590 |
+
* Display More Page
|
591 |
+
**/
|
592 |
+
function oa_display_social_login_more ()
|
593 |
+
{
|
594 |
+
// Plugin URLs
|
595 |
+
$more_url = admin_url('plugin-install.php?s=OneAll.com&tab=search&type=author');
|
596 |
+
|
597 |
+
?>
|
598 |
+
<div class="wrap">
|
599 |
+
<div id="oa_social_login_page" class="oa_social_login_more">
|
600 |
+
<h2>OneAll Social Login <?php echo (defined ('OA_SOCIAL_LOGIN_VERSION') ? OA_SOCIAL_LOGIN_VERSION : ''); ?></h2>
|
601 |
+
|
602 |
+
<h2 class="nav-tab-wrapper">
|
603 |
+
<a class="nav-tab" href="admin.php?page=oa_social_login_setup"><?php _e ('Setup', 'oa_social_login'); ?></a>
|
604 |
+
<a class="nav-tab" href="admin.php?page=oa_social_login_settings"><?php _e ('Settings', 'oa_social_login'); ?></a>
|
605 |
+
<a class="nav-tab nav-tab-active" href="admin.php?page=oa_social_login_more"><?php _e ('+More', 'oa_social_login'); ?></a>
|
606 |
+
</h2>
|
607 |
+
|
608 |
+
<p></p>
|
609 |
+
|
610 |
+
<div class="oa_social_login_box" id="oa_social_login_box_help">
|
611 |
+
<ul>
|
612 |
+
<li><?php printf (__ ('<a target="_blank" href="%s">Follow us on Twitter</a> to stay informed about updates', 'oa_social_login'), 'http://www.twitter.com/oneall'); ?>;</li>
|
613 |
+
<li><?php printf (__ ('<a target="_blank" href="%s">Read the online documentation</a> for more information about this plugin', 'oa_social_login'), 'http://docs.oneall.com/plugins/guide/social-login-wordpress/'); ?>;</li>
|
614 |
+
<li><?php printf (__ ('<a target="_blank" href="%s">Contact us</a> if you have feedback or need assistance', 'oa_social_login'), 'http://www.oneall.com/company/contact-us/'); ?>.
|
615 |
+
<li><?php printf (__ ('We also have <a target="_blank" href="%s">turnkey plugins</a> for Drupal, PrestaShop, Joomla, phpBB andy many others ...', 'oa_social_login'), 'http://docs.oneall.com/plugins/'); ?>.
|
616 |
+
</li>
|
617 |
+
</ul>
|
618 |
+
</div>
|
619 |
+
|
620 |
+
<h1><?php _e ('Discover our other plugins!', 'oa_social_login'); ?></h1>
|
621 |
+
<div class="oa_social_login_plugin">
|
622 |
+
<div class="oa_social_login_plugin_img">
|
623 |
+
<a href="<?php echo $more_url; ?>"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/social_sharing.png' ?>" alt="<?php _e ('Social Login', 'oa_social_login') ?>" /></a>
|
624 |
+
</div>
|
625 |
+
<div class="oa_social_login_plugin_desc">
|
626 |
+
<?php _e ('Allow your visitors to comment, login and register with 30+ social networks like for example Twitter, Facebook, Pinterest, Instagram, Paypal, LinkedIn, OpenID, VKontakte or Google+. Easy to use and 100% FREE.', 'oa_social_login'); ?>
|
627 |
+
<a href="<?php echo $more_url; ?>" class="button-primary"><?php _e ('More Info', 'oa_social_login'); ?></a>
|
628 |
+
</div>
|
629 |
+
</div>
|
630 |
+
<div class="oa_social_login_plugin">
|
631 |
+
<div class="oa_social_login_plugin_img">
|
632 |
+
<a href="<?php echo $more_url; ?>"><img src="<?php echo plugin_dir_url( __FILE__ ) . '../assets/img/loudvoice.png' ?>" alt="<?php _e ('LoudVoice Comment System', 'oa_social_login') ?>" /></a>
|
633 |
+
</div>
|
634 |
+
<div class="oa_social_login_plugin_desc">
|
635 |
+
<?php _e ('LoudVoice replaces the basic WordPress comments by a powerful comment system that includes logging in with 30+ social networks, spam filters and more. Easy to use and 100% FREE. Existing comments can be imported!', 'oa_social_login'); ?>
|
636 |
+
<a href="<?php echo $more_url; ?>" class="button-primary"><?php _e ('More Info', 'oa_social_login'); ?></a>
|
637 |
+
</div>
|
638 |
+
</div>
|
639 |
+
</div>
|
640 |
+
</div>
|
641 |
+
<?php
|
642 |
+
}
|
643 |
+
|
644 |
+
|
645 |
/**
|
646 |
* Display Settings Page
|
647 |
**/
|
654 |
<div id="oa_social_login_page" class="oa_social_login_setup">
|
655 |
<h2>OneAll Social Login <?php echo (defined ('OA_SOCIAL_LOGIN_VERSION') ? OA_SOCIAL_LOGIN_VERSION : ''); ?></h2>
|
656 |
<h2 class="nav-tab-wrapper">
|
657 |
+
<a class="nav-tab nav-tab-active" href="admin.php?page=oa_social_login_setup"><?php _e ('Setup', 'oa_social_login'); ?></a>
|
658 |
+
<a class="nav-tab" href="admin.php?page=oa_social_login_settings"><?php _e ('Settings', 'oa_social_login'); ?></a>
|
659 |
+
<a class="nav-tab" href="admin.php?page=oa_social_login_more"><?php _e ('+More', 'oa_social_login'); ?></a>
|
660 |
+
</h2>
|
661 |
<?php
|
662 |
if (get_option ('oa_social_login_api_settings_verified') !== '1')
|
663 |
{
|
664 |
?>
|
665 |
<p>
|
666 |
+
<?php _e ('Allow your visitors to comment, login and register with 30+ Social Networks like for example Twitter, Facebook, LinkedIn, Instagram, VKontakte, Google or Yahoo.', 'oa_social_login'); ?>
|
667 |
<strong><?php _e ('Draw a larger audience and increase your user engagement in a few simple steps.', 'oa_social_login'); ?> </strong>
|
668 |
</p>
|
669 |
+
<div class="oa_social_login_box" id="oa_social_login_box_started">
|
670 |
<div class="oa_social_login_box_title">
|
671 |
<?php _e ('Get Started!', 'oa_social_login'); ?>
|
672 |
</div>
|
673 |
<p>
|
674 |
<?php printf (__ ('To be able to use this plugin you first of all need to create a free account at %s and setup a Site.', 'oa_social_login'), '<a href="https://app.oneall.com/signup/wp" target="_blank">http://www.oneall.com</a>'); ?>
|
675 |
<?php _e ('After having created your account and setup your Site, please enter the Site settings in the form below.', 'oa_social_login'); ?>
|
676 |
+
<?php _e ("Don't worry the setup is free and takes only a few minutes!", 'oa_social_login'); ?>
|
677 |
</p>
|
678 |
+
<p class="oa_social_login_button_wrap">
|
679 |
<a class="button-secondary" href="https://app.oneall.com/signup/wp" target="_blank"><strong><?php _e ('Click here to setup your free account', 'oa_social_login'); ?></strong></a>
|
680 |
</p>
|
681 |
<h3>
|
682 |
+
<?php printf (__ ('You are in good company! This plugin is used on more than %s websites!', 'oa_social_login'), '300,000'); ?>
|
683 |
</h3>
|
684 |
</div>
|
685 |
<?php
|
693 |
<?php _e ('Your API Account is setup correctly', 'oa_social_login'); ?>
|
694 |
</div>
|
695 |
<p>
|
696 |
+
<?php _e ('Login to your OneAll account to manage your social networks and to access your User Insights.', 'oa_social_login'); ?>
|
697 |
<?php _e ("Determine which social networks are popular amongst your users and tailor your registration experience to increase your users' engagement.", 'oa_social_login'); ?>
|
698 |
</p>
|
699 |
+
<p class="oa_social_login_button_wrap">
|
700 |
+
<a class="button-secondary" href="https://app.oneall.com/signin/" target="_blank"><strong><?php _e ('Login to my OneAll account', 'oa_social_login'); ?></strong> </a>
|
701 |
+
<a class="button-secondary" href="https://app.oneall.com/insights/" target="_blank"><strong><?php _e ('Access my User Insights', 'oa_social_login'); ?></strong> </a>
|
702 |
</p>
|
703 |
</div>
|
704 |
<?php
|
705 |
}
|
706 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
if (!empty ($_REQUEST ['settings-updated']) AND strtolower ($_REQUEST ['settings-updated']) == 'true')
|
708 |
{
|
709 |
?>
|
916 |
<div id="oa_social_login_page" class="oa_social_login_settings">
|
917 |
<h2>OneAll Social Login <?php echo (defined ('OA_SOCIAL_LOGIN_VERSION') ? OA_SOCIAL_LOGIN_VERSION : ''); ?></h2>
|
918 |
<h2 class="nav-tab-wrapper">
|
919 |
+
<a class="nav-tab" href="admin.php?page=oa_social_login_setup"><?php _e ('Setup', 'oa_social_login'); ?></a>
|
920 |
+
<a class="nav-tab nav-tab-active" href="admin.php?page=oa_social_login_settings"><?php _e ('Settings', 'oa_social_login'); ?></a>
|
921 |
+
<a class="nav-tab" href="admin.php?page=oa_social_login_more"><?php _e ('+More', 'oa_social_login'); ?></a>
|
922 |
+
</h2>
|
923 |
<p></p>
|
924 |
<form method="post" action="options.php">
|
925 |
<?php
|
991 |
$plugin_add_column_user_list = ((isset ($settings ['plugin_add_column_user_list']) AND in_array ($settings ['plugin_add_column_user_list'], array (0, 1))) ? $settings ['plugin_add_column_user_list'] : 0);
|
992 |
?>
|
993 |
<input type="radio" name="oa_social_login_settings[plugin_add_column_user_list]" value="1" <?php echo ($plugin_add_column_user_list == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, add a new column to the user list and display the social network that the user connected with', 'oa_social_login'); ?> <br />
|
994 |
+
<input type="radio" name="oa_social_login_settings[plugin_add_column_user_list]" value="0" <?php echo ($plugin_add_column_user_list == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, do not display the social networks in the user list', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong>
|
995 |
</td>
|
996 |
</tr>
|
997 |
<tr class="row_odd">
|
1027 |
?>
|
1028 |
<input type="radio" name="oa_social_login_settings[plugin_require_email]" value="0" <?php echo ($plugin_require_email == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, simplify the registration by automatically creating a placeholder email', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
|
1029 |
<input type="radio" name="oa_social_login_settings[plugin_require_email]" value="1" <?php echo ($plugin_require_email == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, require the user to enter his email address manually and display this message:', 'oa_social_login'); ?> <br />
|
1030 |
+
<textarea name="oa_social_login_settings[plugin_require_email_text]" cols="100" rows="3"><?php echo (isset ($settings ['plugin_require_email_text']) ? htmlspecialchars ($settings ['plugin_require_email_text']) : _e ('<strong>We unfortunately could not retrieve your email address from %s.</strong> Please enter your email address in the form below in order to continue.', 'oa_social_login')); ?></textarea>
|
1031 |
<span class="description"><?php _e ('HTML is allowed, the placeholder %s is replaced by the name of the social network used to connect.', 'oa_social_login'); ?></span>
|
1032 |
</td>
|
1033 |
</tr>
|
1173 |
<input type="text" name="oa_social_login_settings[plugin_login_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_login_form_redirect_custom_url); ?>" />
|
1174 |
</td>
|
1175 |
</tr>
|
1176 |
+
<tr class="row_odd">
|
1177 |
+
<td>
|
1178 |
+
<strong><?php _e ('Allow other plugins to change the redirection url that you have chosen by using a hook/filter?', 'oa_social_login'); ?></strong>
|
1179 |
+
</td>
|
1180 |
+
</tr>
|
1181 |
+
<tr class="row_even">
|
1182 |
+
<td>
|
1183 |
+
<?php
|
1184 |
+
$plugin_protect_login_redirect_url = (empty ($settings ['plugin_protect_login_redirect_url']) ? 0 : 1);
|
1185 |
+
?>
|
1186 |
+
<input type="radio" name="oa_social_login_settings[plugin_protect_login_redirect_url]" value="0" <?php echo ($plugin_protect_login_redirect_url == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, allow plugins to change the redirection url', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
|
1187 |
+
<input type="radio" name="oa_social_login_settings[plugin_protect_login_redirect_url]" value="1" <?php echo ($plugin_protect_login_redirect_url == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, protect the redirection url (Use this option if the redirection does not work correctly)', 'oa_social_login'); ?>
|
1188 |
+
</td>
|
1189 |
+
</tr>
|
1190 |
+
|
1191 |
+
|
1192 |
+
|
1193 |
</table>
|
1194 |
<table class="form-table oa_social_login_table">
|
1195 |
<tr class="row_head">
|
1229 |
<input type="text" name="oa_social_login_settings[plugin_registration_form_redirect_custom_url]" size="90" value="<?php echo htmlspecialchars ($plugin_registration_form_redirect_custom_url); ?>" />
|
1230 |
</td>
|
1231 |
</tr>
|
1232 |
+
<tr class="row_odd">
|
1233 |
+
<td>
|
1234 |
+
<strong><?php _e ('Allow other plugins to change the redirection url that you have chosen by using a hook/filter?', 'oa_social_login'); ?></strong>
|
1235 |
+
</td>
|
1236 |
+
</tr>
|
1237 |
+
<tr class="row_even">
|
1238 |
+
<td>
|
1239 |
+
<?php
|
1240 |
+
$plugin_protect_registration_redirect_url = (empty ($settings ['plugin_protect_registration_redirect_url']) ? 0 : 1);
|
1241 |
+
?>
|
1242 |
+
<input type="radio" name="oa_social_login_settings[plugin_protect_registration_redirect_url]" value="0" <?php echo ($plugin_protect_registration_redirect_url == 0 ? 'checked="checked"' : ''); ?> /> <?php _e ('Yes, allow plugins to change the redirection url', 'oa_social_login'); ?> <strong>(<?php _e ('Default', 'oa_social_login') ?>)</strong><br />
|
1243 |
+
<input type="radio" name="oa_social_login_settings[plugin_protect_registration_redirect_url]" value="1" <?php echo ($plugin_protect_registration_redirect_url == 1 ? 'checked="checked"' : ''); ?> /> <?php _e ('No, protect the redirection url (Use this option if the redirection does not work correctly)', 'oa_social_login'); ?>
|
1244 |
+
</td>
|
1245 |
+
</tr>
|
1246 |
</table>
|
1247 |
<table class="form-table oa_social_login_table">
|
1248 |
<tr class="row_head">
|
1295 |
</div>
|
1296 |
</div>
|
1297 |
<?php
|
1298 |
+
}
|
includes/communication.php
CHANGED
@@ -27,12 +27,12 @@ function oa_social_login_callback ()
|
|
27 |
$api_resource_url = ($api_connection_use_https ? 'https' : 'http') . '://' . $api_subdomain . '.api.oneall.com/connections/' . $connection_token . '.json';
|
28 |
|
29 |
//API Credentials
|
30 |
-
$
|
31 |
-
$
|
32 |
-
$
|
33 |
-
|
34 |
//Retrieve connection details
|
35 |
-
$result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, $
|
36 |
|
37 |
//Check result
|
38 |
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200 AND property_exists ($result, 'http_data'))
|
@@ -40,7 +40,7 @@ function oa_social_login_callback ()
|
|
40 |
//Decode result
|
41 |
$decoded_result = @json_decode ($result->http_data);
|
42 |
if (is_object ($decoded_result) AND isset ($decoded_result->response->result->data->user))
|
43 |
-
{
|
44 |
//User data
|
45 |
$user_data = $decoded_result->response->result->data->user;
|
46 |
|
@@ -364,7 +364,7 @@ function oa_social_login_callback ()
|
|
364 |
|
365 |
//*************** Login ***************
|
366 |
case 'login':
|
367 |
-
|
368 |
$redirect_to = home_url ();
|
369 |
|
370 |
//Redirection in URL
|
@@ -476,8 +476,11 @@ function oa_social_login_callback ()
|
|
476 |
// New User (Registration)
|
477 |
if ($new_registration === true)
|
478 |
{
|
479 |
-
// Apply the WordPress filters
|
480 |
-
|
|
|
|
|
|
|
481 |
|
482 |
// Apply our filters
|
483 |
$redirect_to = apply_filters ('oa_social_login_filter_registration_redirect_url', $redirect_to, $user_data);
|
@@ -486,7 +489,10 @@ function oa_social_login_callback ()
|
|
486 |
else
|
487 |
{
|
488 |
// Apply the WordPress filters
|
489 |
-
|
|
|
|
|
|
|
490 |
|
491 |
// Apply our filters
|
492 |
$redirect_to = apply_filters ('oa_social_login_filter_login_redirect_url', $redirect_to, $user_data);
|
@@ -516,17 +522,26 @@ function oa_social_login_callback ()
|
|
516 |
/**
|
517 |
* Send an API request by using the given handler
|
518 |
*/
|
519 |
-
function oa_social_login_do_api_request ($handler, $url, $
|
520 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
521 |
//FSOCKOPEN
|
522 |
if ($handler == 'fsockopen')
|
523 |
{
|
524 |
-
return oa_social_login_fsockopen_request ($url, $
|
525 |
}
|
526 |
//CURL
|
527 |
else
|
528 |
{
|
529 |
-
return oa_social_login_curl_request ($url, $
|
530 |
}
|
531 |
}
|
532 |
|
@@ -566,7 +581,7 @@ function oa_social_login_check_fsockopen ($secure = true)
|
|
566 |
{
|
567 |
if (oa_social_login_check_fsockopen_available ())
|
568 |
{
|
569 |
-
$result =
|
570 |
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200)
|
571 |
{
|
572 |
if (property_exists ($result, 'http_data'))
|
@@ -590,95 +605,109 @@ function oa_social_login_fsockopen_request ($url, $options = array (), $timeout
|
|
590 |
//Store the result
|
591 |
$result = new stdClass ();
|
592 |
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
}
|
683 |
|
684 |
/**
|
@@ -717,7 +746,7 @@ function oa_social_login_check_curl ($secure = true)
|
|
717 |
{
|
718 |
if (oa_social_login_check_curl_available ())
|
719 |
{
|
720 |
-
$result =
|
721 |
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200)
|
722 |
{
|
723 |
if (property_exists ($result, 'http_data'))
|
@@ -751,12 +780,30 @@ function oa_social_login_curl_request ($url, $options = array (), $timeout = 15)
|
|
751 |
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
752 |
curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
|
753 |
curl_setopt ($curl, CURLOPT_USERAGENT, 'SocialLogin ' . OA_SOCIAL_LOGIN_VERSION . 'WP (+http://www.oneall.com/)');
|
754 |
-
|
755 |
// BASIC AUTH?
|
756 |
if (isset ($options ['api_key']) AND isset ($options ['api_secret']))
|
757 |
{
|
758 |
curl_setopt ($curl, CURLOPT_USERPWD, $options ['api_key'] . ":" . $options ['api_secret']);
|
759 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
760 |
|
761 |
//Make request
|
762 |
if (($http_data = curl_exec ($curl)) !== false)
|
27 |
$api_resource_url = ($api_connection_use_https ? 'https' : 'http') . '://' . $api_subdomain . '.api.oneall.com/connections/' . $connection_token . '.json';
|
28 |
|
29 |
//API Credentials
|
30 |
+
$api_opts = array ();
|
31 |
+
$api_opts['api_key'] = (!empty ($settings ['api_key']) ? $settings ['api_key'] : '');
|
32 |
+
$api_opts['api_secret'] = (!empty ($settings ['api_secret']) ? $settings ['api_secret'] : '');
|
33 |
+
|
34 |
//Retrieve connection details
|
35 |
+
$result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, $api_opts);
|
36 |
|
37 |
//Check result
|
38 |
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200 AND property_exists ($result, 'http_data'))
|
40 |
//Decode result
|
41 |
$decoded_result = @json_decode ($result->http_data);
|
42 |
if (is_object ($decoded_result) AND isset ($decoded_result->response->result->data->user))
|
43 |
+
{
|
44 |
//User data
|
45 |
$user_data = $decoded_result->response->result->data->user;
|
46 |
|
364 |
|
365 |
//*************** Login ***************
|
366 |
case 'login':
|
367 |
+
//Default redirection
|
368 |
$redirect_to = home_url ();
|
369 |
|
370 |
//Redirection in URL
|
476 |
// New User (Registration)
|
477 |
if ($new_registration === true)
|
478 |
{
|
479 |
+
// Apply the WordPress filters
|
480 |
+
if (empty ($settings['plugin_protect_registration_redirect_url']))
|
481 |
+
{
|
482 |
+
$redirect_to = apply_filters ('registration_redirect', $redirect_to);
|
483 |
+
}
|
484 |
|
485 |
// Apply our filters
|
486 |
$redirect_to = apply_filters ('oa_social_login_filter_registration_redirect_url', $redirect_to, $user_data);
|
489 |
else
|
490 |
{
|
491 |
// Apply the WordPress filters
|
492 |
+
if (empty ($settings['plugin_protect_login_redirect_url']))
|
493 |
+
{
|
494 |
+
$redirect_to = apply_filters ('login_redirect', $redirect_to, (! empty ($_GET ['redirect_to']) ? $_GET ['redirect_to'] : ''), $user_data);
|
495 |
+
}
|
496 |
|
497 |
// Apply our filters
|
498 |
$redirect_to = apply_filters ('oa_social_login_filter_login_redirect_url', $redirect_to, $user_data);
|
522 |
/**
|
523 |
* Send an API request by using the given handler
|
524 |
*/
|
525 |
+
function oa_social_login_do_api_request ($handler, $url, $opts = array (), $timeout = 25)
|
526 |
{
|
527 |
+
// Proxy Settings
|
528 |
+
if (defined('WP_PROXY_HOST') && defined ('WP_PROXY_PORT'))
|
529 |
+
{
|
530 |
+
$opts['proxy_url'] = (defined('WP_PROXY_HOST') ? WP_PROXY_HOST : '');
|
531 |
+
$opts['proxy_port'] = (defined('WP_PROXY_PORT') ? WP_PROXY_PORT : '');
|
532 |
+
$opts['proxy_username'] = (defined('WP_PROXY_USERNAME') ? WP_PROXY_USERNAME : '');
|
533 |
+
$opts['proxy_password'] = (defined('WP_PROXY_PASSWORD') ? WP_PROXY_PASSWORD : '');
|
534 |
+
}
|
535 |
+
|
536 |
//FSOCKOPEN
|
537 |
if ($handler == 'fsockopen')
|
538 |
{
|
539 |
+
return oa_social_login_fsockopen_request ($url, $opts, $timeout);
|
540 |
}
|
541 |
//CURL
|
542 |
else
|
543 |
{
|
544 |
+
return oa_social_login_curl_request ($url, $opts, $timeout);
|
545 |
}
|
546 |
}
|
547 |
|
581 |
{
|
582 |
if (oa_social_login_check_fsockopen_available ())
|
583 |
{
|
584 |
+
$result = oa_social_login_do_api_request ('fsockopen', ($secure ? 'https' : 'http') . '://www.oneall.com/ping.html');
|
585 |
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200)
|
586 |
{
|
587 |
if (property_exists ($result, 'http_data'))
|
605 |
//Store the result
|
606 |
$result = new stdClass ();
|
607 |
|
608 |
+
//Make sure that this is a valid URL
|
609 |
+
if (($uri = parse_url ($url)) === false)
|
610 |
+
{
|
611 |
+
$result->http_error = 'invalid_uri';
|
612 |
+
return $result;
|
613 |
+
}
|
614 |
+
|
615 |
+
//Check the scheme
|
616 |
+
if ($uri ['scheme'] == 'https')
|
617 |
+
{
|
618 |
+
$port = (isset ($uri ['port']) ? $uri ['port'] : 443);
|
619 |
+
$url = ($uri ['host'] . ($port != 443 ? ':' . $port : ''));
|
620 |
+
$url_protocol = 'https://';
|
621 |
+
$url_prefix = 'ssl://';
|
622 |
+
}
|
623 |
+
else
|
624 |
+
{
|
625 |
+
$port = (isset ($uri ['port']) ? $uri ['port'] : 80);
|
626 |
+
$url = ($uri ['host'] . ($port != 80 ? ':' . $port : ''));
|
627 |
+
$url_protocol = 'http://';
|
628 |
+
$url_prefix = '';
|
629 |
+
}
|
630 |
+
|
631 |
+
//Construct the path to act on
|
632 |
+
$path = (isset ($uri ['path']) ? $uri ['path'] : '/').( ! empty ($uri ['query']) ? ('?'.$uri ['query']) : '');
|
633 |
+
|
634 |
+
//HTTP Headers
|
635 |
+
$headers = array();
|
636 |
+
|
637 |
+
// We are using a proxy
|
638 |
+
if (! empty ($options ['proxy_url']) && ! empty ($options ['proxy_port']))
|
639 |
+
{
|
640 |
+
// Open Socket
|
641 |
+
$fp = @fsockopen ($options ['proxy_url'], $options ['proxy_port'], $errno, $errstr, $timeout);
|
642 |
+
|
643 |
+
//Make sure that the socket has been opened properly
|
644 |
+
if (!$fp)
|
645 |
+
{
|
646 |
+
$result->http_error = trim ($errstr);
|
647 |
+
return $result;
|
648 |
+
}
|
649 |
+
|
650 |
+
// HTTP Headers
|
651 |
+
$headers[] = "GET " . $url_protocol . $url . $path . " HTTP/1.0";
|
652 |
+
$headers[] = "Host: " . $url . ":" . $port;
|
653 |
+
|
654 |
+
// Proxy Authentication
|
655 |
+
if ( ! empty ($options ['proxy_username']) && ! empty ($options ['proxy_password']))
|
656 |
+
{
|
657 |
+
$headers [] = 'Proxy-Authorization: Basic ' . base64_encode ($options ['proxy_username'] . ":" . $options ['proxy_password']);
|
658 |
+
}
|
659 |
+
|
660 |
+
}
|
661 |
+
// We are not using a proxy
|
662 |
+
else
|
663 |
+
{
|
664 |
+
// Open Socket
|
665 |
+
$fp = @fsockopen ($url_prefix . $url, $port, $errno, $errstr, $timeout);
|
666 |
+
|
667 |
+
//Make sure that the socket has been opened properly
|
668 |
+
if (!$fp)
|
669 |
+
{
|
670 |
+
$result->http_error = trim ($errstr);
|
671 |
+
return $result;
|
672 |
+
}
|
673 |
+
|
674 |
+
// HTTP Headers
|
675 |
+
$headers[] = "GET " . $path." HTTP/1.0";
|
676 |
+
$headers[] = "Host: " . $url;
|
677 |
+
}
|
678 |
+
|
679 |
+
//Enable basic authentication
|
680 |
+
if (isset ($options ['api_key']) AND isset ($options ['api_secret']))
|
681 |
+
{
|
682 |
+
$headers [] = 'Authorization: Basic ' . base64_encode ($options ['api_key'] . ":" . $options ['api_secret']);
|
683 |
+
}
|
684 |
+
|
685 |
+
//Build and send request
|
686 |
+
fwrite ($fp, (implode ("\r\n", $headers). "\r\n\r\n"));
|
687 |
+
|
688 |
+
//Fetch response
|
689 |
+
$response = '';
|
690 |
+
while (!feof ($fp))
|
691 |
+
{
|
692 |
+
$response .= fread ($fp, 1024);
|
693 |
+
}
|
694 |
+
|
695 |
+
//Close connection
|
696 |
+
fclose ($fp);
|
697 |
+
|
698 |
+
//Parse response
|
699 |
+
list($response_header, $response_body) = explode ("\r\n\r\n", $response, 2);
|
700 |
+
|
701 |
+
//Parse header
|
702 |
+
$response_header = preg_split ("/\r\n|\n|\r/", $response_header);
|
703 |
+
list($header_protocol, $header_code, $header_status_message) = explode (' ', trim (array_shift ($response_header)), 3);
|
704 |
+
|
705 |
+
//Build result
|
706 |
+
$result->http_code = $header_code;
|
707 |
+
$result->http_data = $response_body;
|
708 |
+
|
709 |
+
//Done
|
710 |
+
return $result;
|
711 |
}
|
712 |
|
713 |
/**
|
746 |
{
|
747 |
if (oa_social_login_check_curl_available ())
|
748 |
{
|
749 |
+
$result = oa_social_login_do_api_request ('curl', ($secure ? 'https' : 'http') . '://www.oneall.com/ping.html');
|
750 |
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200)
|
751 |
{
|
752 |
if (property_exists ($result, 'http_data'))
|
780 |
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
781 |
curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
|
782 |
curl_setopt ($curl, CURLOPT_USERAGENT, 'SocialLogin ' . OA_SOCIAL_LOGIN_VERSION . 'WP (+http://www.oneall.com/)');
|
783 |
+
|
784 |
// BASIC AUTH?
|
785 |
if (isset ($options ['api_key']) AND isset ($options ['api_secret']))
|
786 |
{
|
787 |
curl_setopt ($curl, CURLOPT_USERPWD, $options ['api_key'] . ":" . $options ['api_secret']);
|
788 |
}
|
789 |
+
|
790 |
+
// Proxy Settings
|
791 |
+
if ( ! empty ($options ['proxy_url']) && ! empty ($options ['proxy_port']))
|
792 |
+
{
|
793 |
+
// Proxy Location
|
794 |
+
curl_setopt ($curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
|
795 |
+
curl_setopt ($curl, CURLOPT_PROXY, $options ['proxy_url']);
|
796 |
+
|
797 |
+
// Proxy Port
|
798 |
+
curl_setopt ($curl, CURLOPT_PROXYPORT, $options ['proxy_port']);
|
799 |
+
|
800 |
+
// Proxy Authentication
|
801 |
+
if ( ! empty ($options ['proxy_username']) && ! empty ($options ['proxy_password']))
|
802 |
+
{
|
803 |
+
curl_setopt ($curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
|
804 |
+
curl_setopt ($curl, CURLOPT_PROXYUSERPWD, $options ['proxy_username'] . ':' . $options ['proxy_password']);
|
805 |
+
}
|
806 |
+
}
|
807 |
|
808 |
//Make request
|
809 |
if (($http_data = curl_exec ($curl)) !== false)
|
includes/toolbox.php
CHANGED
@@ -247,3 +247,39 @@ function oa_social_login_create_rand_email ()
|
|
247 |
//Done
|
248 |
return $email;
|
249 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
//Done
|
248 |
return $email;
|
249 |
}
|
250 |
+
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Check if a BuddyPress user has uploaded an avatar
|
254 |
+
*/
|
255 |
+
function oa_social_login_has_bp_user_uploaded_avatar ($user_id)
|
256 |
+
{
|
257 |
+
$has_bp_user_uploaded_avatar = false;
|
258 |
+
|
259 |
+
// Use build-in function
|
260 |
+
if (function_exists ('bp_get_user_has_avatar'))
|
261 |
+
{
|
262 |
+
$has_bp_user_uploaded_avatar = bp_get_user_has_avatar ($user_id);
|
263 |
+
}
|
264 |
+
// Do custom processing
|
265 |
+
else
|
266 |
+
{
|
267 |
+
// Make sure we can actually do this
|
268 |
+
if (function_exists ('bp_core_fetch_avatar') && function_exists ('bp_core_avatar_default'))
|
269 |
+
{
|
270 |
+
// Fetch the custom BuddyPress avatar for this user
|
271 |
+
$bp_user_avatar = strtolower (trim (strval (bp_core_fetch_avatar (array ('item_id' => $user_id, 'no_grav' => true, 'html' => false, 'type' => 'full')))));
|
272 |
+
|
273 |
+
// Fetch the default BuddyPress avatar
|
274 |
+
$bp_default_avatar = strtolower (trim (strval (bp_core_avatar_default ('local'))));
|
275 |
+
|
276 |
+
// Custom Avatar?
|
277 |
+
$has_bp_user_uploaded_avatar = (($bp_user_avatar == $bp_default_avatar) ? false : true);
|
278 |
+
|
279 |
+
// Done
|
280 |
+
$has_bp_user_uploaded_avatar = apply_filters('bp_get_user_has_avatar', $has_bp_user_uploaded_avatar, $user_id);
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
return $has_bp_user_uploaded_avatar;
|
285 |
+
}
|
includes/user_interface.php
CHANGED
@@ -513,14 +513,8 @@ function oa_social_login_bp_custom_fetch_avatar ($text, $args)
|
|
513 |
//Retrieve user
|
514 |
if (($user_data = get_userdata ($args ['item_id'])) !== false)
|
515 |
{
|
516 |
-
//Fetch the BuddyPress avatar for this user
|
517 |
-
$bp_user_avatar = strtolower (trim (strval (bp_core_fetch_avatar (array ('item_id' => $args ['item_id'], 'no_grav' => true, 'html' => false)))));
|
518 |
-
|
519 |
-
//Fetch the default BuddyPress avatar
|
520 |
-
$bp_default_avatar = strtolower (trim (strval (bp_core_avatar_default ('local'))));
|
521 |
-
|
522 |
//Only replace if the user has the default avatar (this will keep uploaded avatars)
|
523 |
-
if (
|
524 |
{
|
525 |
//Read the avatar
|
526 |
$user_meta_thumbnail = get_user_meta ($args ['item_id'], 'oa_social_login_user_thumbnail', true);
|
@@ -603,22 +597,15 @@ function oa_social_login_custom_avatar ($avatar, $mixed, $size, $default, $alt =
|
|
603 |
{
|
604 |
//Override current avatar ?
|
605 |
$override_avatar = true;
|
606 |
-
|
607 |
//BuddyPress (Thumbnails in the default WordPress toolbar)
|
608 |
-
if (
|
609 |
{
|
610 |
-
//
|
611 |
-
$
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
{
|
616 |
-
//User has probably upladed an avatar
|
617 |
-
$override_avatar = false;
|
618 |
-
}
|
619 |
-
}
|
620 |
-
|
621 |
-
//Show avatar?
|
622 |
if ($override_avatar)
|
623 |
{
|
624 |
//Read the avatar
|
@@ -958,6 +945,9 @@ function oa_social_login_render_login_form ($source, $args = array ())
|
|
958 |
{
|
959 |
$callback_uri = "(window.location.href + ((window.location.href.split('?')[1] ? '&': '?') + \"oa_social_login_source=" . $source . "\"))";
|
960 |
}
|
|
|
|
|
|
|
961 |
|
962 |
//No providers selected
|
963 |
if (count ($providers) == 0)
|
@@ -1074,7 +1064,7 @@ function oa_social_login_request_email ()
|
|
1074 |
}
|
1075 |
elseif (email_exists ($user_email))
|
1076 |
{
|
1077 |
-
|
1078 |
$message = __ ('This email is already used by another account', 'oa_social_login');
|
1079 |
}
|
1080 |
else
|
@@ -1085,17 +1075,17 @@ function oa_social_login_request_email ()
|
|
1085 |
{
|
1086 |
//Store old email
|
1087 |
$old_user_email = $user_data->user_email;
|
1088 |
-
|
1089 |
//Update user
|
1090 |
wp_update_user (array ('ID' => $user_data->ID, 'user_email' => $user_email));
|
1091 |
delete_user_meta ($user_data->ID, 'oa_social_login_request_email');
|
1092 |
-
|
1093 |
//Set new email for hook
|
1094 |
$user_data->user_email = $user_email;
|
1095 |
-
|
1096 |
//Hook after having updated the email
|
1097 |
do_action ('oa_social_login_action_on_user_enter_email', $user_id, $user_data, $old_user_email);
|
1098 |
-
|
1099 |
//No longer needed
|
1100 |
$display_modal = false;
|
1101 |
}
|
@@ -1103,7 +1093,7 @@ function oa_social_login_request_email ()
|
|
1103 |
}
|
1104 |
}
|
1105 |
}
|
1106 |
-
|
1107 |
//Display modal dialog?
|
1108 |
if ($display_modal === true)
|
1109 |
{
|
@@ -1116,28 +1106,35 @@ function oa_social_login_request_email ()
|
|
1116 |
//Caption
|
1117 |
$caption = (isset ($oa_social_login_settings ['plugin_require_email_text']) ? $oa_social_login_settings ['plugin_require_email_text'] : __ ('<strong>We unfortunately could not retrieve your email address from %s.</strong> Please enter your email address in the form below in order to continue.', 'oa_social_login'));
|
1118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1119 |
//Add CSS
|
1120 |
oa_social_login_add_site_css ();
|
1121 |
|
1122 |
//Show email request form
|
1123 |
-
?>
|
1124 |
<div id="oa_social_login_overlay"></div>
|
1125 |
<div id="oa_social_login_modal">
|
1126 |
<div class="oa_social_login_modal_outer">
|
1127 |
<div class="oa_social_login_modal_inner">
|
1128 |
<div class="oa_social_login_modal_title">
|
1129 |
<?php
|
1130 |
-
|
1131 |
?>
|
1132 |
</div>
|
1133 |
<?php
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
<div class="oa_social_login_modal_body">
|
1142 |
<div class="oa_social_login_modal_subtitle">
|
1143 |
<?php _e ('Please enter your email address', 'oa_social_login'); ?>:
|
@@ -1152,8 +1149,8 @@ function oa_social_login_request_email ()
|
|
1152 |
<?php echo $message; ?>
|
1153 |
</div>
|
1154 |
<div class="oa_social_login_buttons">
|
1155 |
-
<input class="oa_social_login_button" id="oa_social_login_button_confirm" type="submit" value="<?php _e ('Confirm', 'oa_social_login'); ?>" />
|
1156 |
-
<
|
1157 |
</div>
|
1158 |
</fieldset>
|
1159 |
</form>
|
@@ -1167,4 +1164,46 @@ function oa_social_login_request_email ()
|
|
1167 |
}
|
1168 |
}
|
1169 |
add_action ('wp_footer', 'oa_social_login_request_email');
|
1170 |
-
add_action ('admin_footer', 'oa_social_login_request_email');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
//Retrieve user
|
514 |
if (($user_data = get_userdata ($args ['item_id'])) !== false)
|
515 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
516 |
//Only replace if the user has the default avatar (this will keep uploaded avatars)
|
517 |
+
if (oa_social_login_has_bp_user_uploaded_avatar ($args ['item_id']) == false)
|
518 |
{
|
519 |
//Read the avatar
|
520 |
$user_meta_thumbnail = get_user_meta ($args ['item_id'], 'oa_social_login_user_thumbnail', true);
|
597 |
{
|
598 |
//Override current avatar ?
|
599 |
$override_avatar = true;
|
600 |
+
|
601 |
//BuddyPress (Thumbnails in the default WordPress toolbar)
|
602 |
+
if (oa_social_login_has_bp_user_uploaded_avatar ($user_id) === true)
|
603 |
{
|
604 |
+
// Keep avatar is user has uploaded one
|
605 |
+
$override_avatar = false;
|
606 |
+
}
|
607 |
+
|
608 |
+
//Override if no avatar, from Buddypress:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
if ($override_avatar)
|
610 |
{
|
611 |
//Read the avatar
|
945 |
{
|
946 |
$callback_uri = "(window.location.href + ((window.location.href.split('?')[1] ? '&': '?') + \"oa_social_login_source=" . $source . "\"))";
|
947 |
}
|
948 |
+
|
949 |
+
// Filter for callback uri
|
950 |
+
$callback_uri = apply_filters ('oa_social_login_filter_callback_uri', $callback_uri, $source);
|
951 |
|
952 |
//No providers selected
|
953 |
if (count ($providers) == 0)
|
1064 |
}
|
1065 |
elseif (email_exists ($user_email))
|
1066 |
{
|
1067 |
+
|
1068 |
$message = __ ('This email is already used by another account', 'oa_social_login');
|
1069 |
}
|
1070 |
else
|
1075 |
{
|
1076 |
//Store old email
|
1077 |
$old_user_email = $user_data->user_email;
|
1078 |
+
|
1079 |
//Update user
|
1080 |
wp_update_user (array ('ID' => $user_data->ID, 'user_email' => $user_email));
|
1081 |
delete_user_meta ($user_data->ID, 'oa_social_login_request_email');
|
1082 |
+
|
1083 |
//Set new email for hook
|
1084 |
$user_data->user_email = $user_email;
|
1085 |
+
|
1086 |
//Hook after having updated the email
|
1087 |
do_action ('oa_social_login_action_on_user_enter_email', $user_id, $user_data, $old_user_email);
|
1088 |
+
|
1089 |
//No longer needed
|
1090 |
$display_modal = false;
|
1091 |
}
|
1093 |
}
|
1094 |
}
|
1095 |
}
|
1096 |
+
|
1097 |
//Display modal dialog?
|
1098 |
if ($display_modal === true)
|
1099 |
{
|
1106 |
//Caption
|
1107 |
$caption = (isset ($oa_social_login_settings ['plugin_require_email_text']) ? $oa_social_login_settings ['plugin_require_email_text'] : __ ('<strong>We unfortunately could not retrieve your email address from %s.</strong> Please enter your email address in the form below in order to continue.', 'oa_social_login'));
|
1108 |
|
1109 |
+
// Create Nonce
|
1110 |
+
$oa_nonce = wp_create_nonce ('request_email_cancel-'.$user_id);
|
1111 |
+
|
1112 |
+
// Compute logout url
|
1113 |
+
$logout_url = wp_logout_url (oa_social_login_get_current_url ());
|
1114 |
+
$logout_url .= ((parse_url ($logout_url, PHP_URL_QUERY) ? '&' : '?') . 'oa_action=request_email_cancel&oa_nonce='.$oa_nonce);
|
1115 |
+
|
1116 |
//Add CSS
|
1117 |
oa_social_login_add_site_css ();
|
1118 |
|
1119 |
//Show email request form
|
1120 |
+
?>
|
1121 |
<div id="oa_social_login_overlay"></div>
|
1122 |
<div id="oa_social_login_modal">
|
1123 |
<div class="oa_social_login_modal_outer">
|
1124 |
<div class="oa_social_login_modal_inner">
|
1125 |
<div class="oa_social_login_modal_title">
|
1126 |
<?php
|
1127 |
+
printf (__ ('You have successfully connected with %s!', 'oa_social_login'), '<strong>' . $oa_social_login_identity_provider . '</strong>');
|
1128 |
?>
|
1129 |
</div>
|
1130 |
<?php
|
1131 |
+
if (strlen (trim ($caption)) > 0)
|
1132 |
+
{
|
1133 |
+
?>
|
1134 |
+
<div class="oa_social_login_modal_notice"><?php echo str_replace ('%s', $oa_social_login_identity_provider, $caption); ?></div>
|
1135 |
+
<?php
|
1136 |
+
}
|
1137 |
+
?>
|
1138 |
<div class="oa_social_login_modal_body">
|
1139 |
<div class="oa_social_login_modal_subtitle">
|
1140 |
<?php _e ('Please enter your email address', 'oa_social_login'); ?>:
|
1149 |
<?php echo $message; ?>
|
1150 |
</div>
|
1151 |
<div class="oa_social_login_buttons">
|
1152 |
+
<input class="oa_social_login_button" id="oa_social_login_button_confirm" name="oa_social_login_confirm_btn" type="submit" value="<?php _e ('Confirm', 'oa_social_login'); ?>" />
|
1153 |
+
<a href="<?php echo esc_url ($logout_url); ?>" class="oa_social_login_button" id="oa_social_login_button_cancel"><?php _e ('Cancel', 'oa_social_login'); ?></a>
|
1154 |
</div>
|
1155 |
</fieldset>
|
1156 |
</form>
|
1164 |
}
|
1165 |
}
|
1166 |
add_action ('wp_footer', 'oa_social_login_request_email');
|
1167 |
+
add_action ('admin_footer', 'oa_social_login_request_email');
|
1168 |
+
|
1169 |
+
|
1170 |
+
/**
|
1171 |
+
* Delete user if he cancels the email entry.
|
1172 |
+
*/
|
1173 |
+
function oa_social_login_request_email_cancel ()
|
1174 |
+
{
|
1175 |
+
// Email Request Cancelled
|
1176 |
+
if (isset ($_GET) && !empty ($_GET ['oa_action']) && $_GET ['oa_action'] == 'request_email_cancel' && !empty ($_GET ['oa_nonce']))
|
1177 |
+
{
|
1178 |
+
require_once(ABSPATH.'wp-admin/includes/user.php' );
|
1179 |
+
|
1180 |
+
// Works only for logged in users
|
1181 |
+
if (is_user_logged_in())
|
1182 |
+
{
|
1183 |
+
//Get the current user
|
1184 |
+
$current_user = wp_get_current_user ();
|
1185 |
+
|
1186 |
+
// Check Nonce
|
1187 |
+
if (wp_verify_nonce ($_GET ['oa_nonce'], 'request_email_cancel-'.$current_user->ID))
|
1188 |
+
{
|
1189 |
+
// Check if email was requested
|
1190 |
+
$oa_social_login_request_email = get_user_meta ($current_user->ID, 'oa_social_login_request_email', true);
|
1191 |
+
|
1192 |
+
// Yes, email was requested
|
1193 |
+
if (!empty ($oa_social_login_request_email))
|
1194 |
+
{
|
1195 |
+
// Make sure it was our placeholder email
|
1196 |
+
if (preg_match ('/example\.com$/i', $current_user->user_email))
|
1197 |
+
{
|
1198 |
+
wp_delete_user ($current_user->ID);
|
1199 |
+
}
|
1200 |
+
else
|
1201 |
+
{
|
1202 |
+
delete_user_meta ($current_user->ID, 'oa_social_login_request_email');
|
1203 |
+
}
|
1204 |
+
}
|
1205 |
+
}
|
1206 |
+
}
|
1207 |
+
}
|
1208 |
+
}
|
1209 |
+
add_action ('wp_loaded', 'oa_social_login_request_email_cancel');
|
languages/oa_social_login-de_DE.po
CHANGED
@@ -368,7 +368,7 @@ msgid "Yes, add a new column to the user list and display the social network tha
|
|
368 |
msgstr "Ja, eine weitere Spalte in der Benutzerliste anzeigen"
|
369 |
|
370 |
#: includes/admin.php:940
|
371 |
-
msgid "No,
|
372 |
msgstr "Nein, soziale Netzwerke nicht anzeigen"
|
373 |
|
374 |
#: includes/admin.php:945
|
368 |
msgstr "Ja, eine weitere Spalte in der Benutzerliste anzeigen"
|
369 |
|
370 |
#: includes/admin.php:940
|
371 |
+
msgid "No, do not display the social networks in the user list"
|
372 |
msgstr "Nein, soziale Netzwerke nicht anzeigen"
|
373 |
|
374 |
#: includes/admin.php:945
|
languages/oa_social_login-fr_CA.po
CHANGED
@@ -444,7 +444,7 @@ msgstr "Oui, ajouter une nouvelle colonne à la liste des utilisateurs et affich
|
|
444 |
|
445 |
# @ oa_social_login
|
446 |
#: includes/admin.php:940
|
447 |
-
msgid "No,
|
448 |
msgstr "Non, ne pas afficher les réseaux sociaux dans la liste des utilisateurs"
|
449 |
|
450 |
# @ oa_social_login
|
444 |
|
445 |
# @ oa_social_login
|
446 |
#: includes/admin.php:940
|
447 |
+
msgid "No, do not display the social networks in the user list"
|
448 |
msgstr "Non, ne pas afficher les réseaux sociaux dans la liste des utilisateurs"
|
449 |
|
450 |
# @ oa_social_login
|
languages/oa_social_login-fr_FR.po
CHANGED
@@ -444,7 +444,7 @@ msgstr "Oui, ajouter une nouvelle colonne à la liste des utilisateurs et affich
|
|
444 |
|
445 |
# @ oa_social_login
|
446 |
#: includes/admin.php:940
|
447 |
-
msgid "No,
|
448 |
msgstr "Non, ne pas afficher les réseaux sociaux dans la liste des utilisateurs"
|
449 |
|
450 |
# @ oa_social_login
|
444 |
|
445 |
# @ oa_social_login
|
446 |
#: includes/admin.php:940
|
447 |
+
msgid "No, do not display the social networks in the user list"
|
448 |
msgstr "Non, ne pas afficher les réseaux sociaux dans la liste des utilisateurs"
|
449 |
|
450 |
# @ oa_social_login
|
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 25+ social networks</strong> like Twitter, Facebook, LinkedIn, Instagram, Вконтакте, Google or Yahoo.
|
6 |
-
Version: 5.
|
7 |
Author: Claude Schlesser
|
8 |
Author URI: http://www.oneall.com/
|
9 |
License: GPL2
|
@@ -11,7 +11,7 @@ License: GPL2
|
|
11 |
|
12 |
define ('OA_SOCIAL_LOGIN_PLUGIN_URL', plugins_url () . '/' . basename (dirname (__FILE__)));
|
13 |
define ('OA_SOCIAL_LOGIN_BASE_PATH', dirname (plugin_basename (__FILE__)));
|
14 |
-
define ('OA_SOCIAL_LOGIN_VERSION', '5.
|
15 |
|
16 |
/**
|
17 |
* Check technical requirements before activating the plugin (Wordpress 3.0 or newer required)
|
3 |
Plugin Name: Social Login
|
4 |
Plugin URI: http://www.oneall.com/
|
5 |
Description: Allow your visitors to <strong>comment, login and register with 25+ social networks</strong> like Twitter, Facebook, LinkedIn, Instagram, Вконтакте, Google or Yahoo.
|
6 |
+
Version: 5.2
|
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 |
define ('OA_SOCIAL_LOGIN_BASE_PATH', dirname (plugin_basename (__FILE__)));
|
14 |
+
define ('OA_SOCIAL_LOGIN_VERSION', '5.2');
|
15 |
|
16 |
/**
|
17 |
* Check technical requirements before activating the plugin (Wordpress 3.0 or newer required)
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Social Login ===
|
2 |
-
Contributors: ClaudeSchlesser
|
3 |
Tags: social login, social connect, facebook, linkedin, livejournal, google, yahoo, twitter, openid, pinterest, paypal, google, instagram, widget, plugin, social network login, comments
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 5.
|
7 |
|
8 |
Allow your visitors to comment and login with social networks like Twitter, Facebook, Paypal, LinkedIn, Instagram, OpenID, VKontakte, Google, Pinterest
|
9 |
|
@@ -137,6 +137,13 @@ http://docs.oneall.com/plugins/guide/social-login-wordpress/
|
|
137 |
|
138 |
== Changelog ==
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
= 5.0 =
|
141 |
* Social Network "Battle.net" added
|
142 |
* Social Link Hooks/Nonce added
|
@@ -385,4 +392,4 @@ for putting together such a great product that so many users can implement with
|
|
385 |
<strong>Herman G.</strong>
|
386 |
|
387 |
<em>Very user friendly, there are guides and screenshot on how to set things up. Thank you so much for this awesome plugin!</em>
|
388 |
-
<strong>Cebututs</strong>
|
1 |
=== Social Login ===
|
2 |
+
Contributors: ClaudeSchlesser, OneAll.com
|
3 |
Tags: social login, social connect, facebook, linkedin, livejournal, google, yahoo, twitter, openid, pinterest, paypal, google, instagram, widget, plugin, social network login, comments
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 4.7.2
|
6 |
+
Stable tag: 5.2
|
7 |
|
8 |
Allow your visitors to comment and login with social networks like Twitter, Facebook, Paypal, LinkedIn, Instagram, OpenID, VKontakte, Google, Pinterest
|
9 |
|
137 |
|
138 |
== Changelog ==
|
139 |
|
140 |
+
= 5.2 =
|
141 |
+
* Buddypress avatar bugfix
|
142 |
+
* Do not create users without email addresses when plugin set to request emails
|
143 |
+
* Support for WP_PROXY_HOST added
|
144 |
+
* Filter for callback uri added
|
145 |
+
* More pannel added
|
146 |
+
|
147 |
= 5.0 =
|
148 |
* Social Network "Battle.net" added
|
149 |
* Social Link Hooks/Nonce added
|
392 |
<strong>Herman G.</strong>
|
393 |
|
394 |
<em>Very user friendly, there are guides and screenshot on how to set things up. Thank you so much for this awesome plugin!</em>
|
395 |
+
<strong>Cebututs</strong>
|