Version Description
- Social Network "Xing" added
Download this release
Release Info
Developer | ClaudeSchlesser |
Plugin | Social Login |
Version | 4.4 |
Comparing to | |
See all releases |
Code changes from version 4.3 to 4.4
- assets/css/admin.css +17 -9
- assets/img/provider_sprite_35_35.png +0 -0
- includes/communication.php +57 -47
- includes/settings.php +3 -0
- includes/toolbox.php +11 -0
- oa-social-login.php +2 -2
- readme.txt +18 -5
assets/css/admin.css
CHANGED
@@ -31,9 +31,9 @@
|
|
31 |
margin-bottom: 35px;
|
32 |
}
|
33 |
|
34 |
-
#oa_social_login_box_help ul{
|
35 |
-
padding-left:20px;
|
36 |
-
list-style-type: disc;
|
37 |
}
|
38 |
|
39 |
#oa_social_login_box_help .oa_social_login_box_title {
|
@@ -71,6 +71,7 @@
|
|
71 |
background-color: #3E687B;
|
72 |
color: #fff;
|
73 |
text-shadow: 0 1px 0 #333;
|
|
|
74 |
}
|
75 |
|
76 |
.oa_social_login_table tr.row_head th a {
|
@@ -137,14 +138,13 @@
|
|
137 |
line-height: 35px;
|
138 |
}
|
139 |
|
140 |
-
.oa_social_login_table tr.row_provider td.cell_provider_icon{
|
141 |
-
width:50px;
|
142 |
-
text-align:center !important;
|
143 |
}
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
text-align:left !important;
|
148 |
}
|
149 |
|
150 |
.oa_social_login_provider {
|
@@ -249,4 +249,12 @@
|
|
249 |
|
250 |
.oa_social_login_provider_odnoklassniki {
|
251 |
background-position: -1038px -1px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
}
|
31 |
margin-bottom: 35px;
|
32 |
}
|
33 |
|
34 |
+
#oa_social_login_box_help ul {
|
35 |
+
padding-left: 20px;
|
36 |
+
list-style-type: disc;
|
37 |
}
|
38 |
|
39 |
#oa_social_login_box_help .oa_social_login_box_title {
|
71 |
background-color: #3E687B;
|
72 |
color: #fff;
|
73 |
text-shadow: 0 1px 0 #333;
|
74 |
+
padding-left: 10px;
|
75 |
}
|
76 |
|
77 |
.oa_social_login_table tr.row_head th a {
|
138 |
line-height: 35px;
|
139 |
}
|
140 |
|
141 |
+
.oa_social_login_table tr.row_provider td.cell_provider_icon {
|
142 |
+
width: 50px;
|
143 |
+
text-align: center !important;
|
144 |
}
|
145 |
|
146 |
+
.oa_social_login_table tr.row_provider td.cell_provider_label {
|
147 |
+
text-align: left !important;
|
|
|
148 |
}
|
149 |
|
150 |
.oa_social_login_provider {
|
249 |
|
250 |
.oa_social_login_provider_odnoklassniki {
|
251 |
background-position: -1038px -1px;
|
252 |
+
}
|
253 |
+
|
254 |
+
.oa_social_login_provider_deviantart {
|
255 |
+
background-position: -1075px -1px;
|
256 |
+
}
|
257 |
+
|
258 |
+
.oa_social_login_provider_twitch {
|
259 |
+
background-position: -1112px -1px;
|
260 |
}
|
assets/img/provider_sprite_35_35.png
CHANGED
Binary file
|
includes/communication.php
CHANGED
@@ -9,45 +9,54 @@ function oa_social_login_callback ()
|
|
9 |
//Callback Handler
|
10 |
if (isset ($_POST) AND !empty ($_POST ['oa_action']) AND $_POST ['oa_action'] == 'social_login' AND !empty ($_POST ['connection_token']))
|
11 |
{
|
|
|
|
|
|
|
12 |
//Read settings
|
13 |
$settings = get_option ('oa_social_login_settings');
|
14 |
|
15 |
//API Settings
|
16 |
$api_connection_handler = ((!empty ($settings ['api_connection_handler']) AND $settings ['api_connection_handler'] == 'fsockopen') ? 'fsockopen' : 'curl');
|
17 |
$api_connection_use_https = ((!isset ($settings ['api_connection_use_https']) OR $settings ['api_connection_use_https'] == '1') ? true : false);
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
$api_secret = (!empty ($settings ['api_secret']) ? $settings ['api_secret'] : '');
|
22 |
-
|
23 |
-
$api_resource_url = ($api_connection_use_https ? 'https' : 'http') . '://' . $api_subdomain . '.api.oneall.com/connections/' . $_POST ['connection_token'] . '.json';
|
24 |
-
|
25 |
-
//Get connection details
|
26 |
-
$result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, array ('api_key' => $api_key, 'api_secret' => $api_secret));
|
27 |
-
|
28 |
-
//Parse result
|
29 |
-
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200)
|
30 |
{
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
{
|
33 |
-
//Decode
|
34 |
-
$
|
35 |
-
|
36 |
-
//User Data
|
37 |
-
if (is_object ($social_data))
|
38 |
{
|
39 |
-
|
40 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
//Identity
|
43 |
-
$user_identity_id = $identity->id;
|
44 |
$user_identity_provider = $identity->source->name;
|
45 |
|
46 |
-
//Thumbnail
|
47 |
-
$user_thumbnail = (!empty ($identity->thumbnailUrl)? trim ($identity->thumbnailUrl) : '');
|
48 |
|
49 |
-
//Picture
|
50 |
-
$user_picture = (!empty ($identity->pictureUrl) ? trim ($identity->pictureUrl): '');
|
51 |
|
52 |
//Firstname
|
53 |
$user_first_name = (!empty ($identity->name->givenName) ? $identity->name->givenName : '');
|
@@ -69,16 +78,16 @@ function oa_social_login_callback ()
|
|
69 |
$user_full_name = trim ($user_first_name . ' ' . $user_last_name);
|
70 |
}
|
71 |
|
72 |
-
// Email Address.
|
73 |
-
$user_email = '';
|
74 |
-
if (property_exists ($identity, 'emails') AND is_array ($identity->emails))
|
75 |
-
{
|
76 |
-
$user_email_is_verified = false;
|
77 |
-
while ($user_email_is_verified !== true AND (list
|
78 |
-
{
|
79 |
-
$user_email = $email->value;
|
80 |
-
$user_email_is_verified = ($email->is_verified == '1');
|
81 |
-
}
|
82 |
}
|
83 |
|
84 |
//User Website
|
@@ -113,7 +122,7 @@ function oa_social_login_callback ()
|
|
113 |
$new_registration = false;
|
114 |
|
115 |
//Sanitize Login
|
116 |
-
$user_login = str_replace('.','-', $user_login);
|
117 |
$user_login = sanitize_user ($user_login, true);
|
118 |
|
119 |
// Get user by token
|
@@ -237,10 +246,10 @@ function oa_social_login_callback ()
|
|
237 |
$user_data = get_userdata ($user_id);
|
238 |
if ($user_data !== false)
|
239 |
{
|
240 |
-
//Update user thumbnail
|
241 |
-
if (!empty ($user_thumbnail))
|
242 |
-
{
|
243 |
-
update_user_meta ($user_id, 'oa_social_login_user_thumbnail', $user_thumbnail);
|
244 |
}
|
245 |
|
246 |
//Update user picture
|
@@ -268,13 +277,13 @@ function oa_social_login_callback ()
|
|
268 |
//Default redirection
|
269 |
$redirect_to = admin_url ();
|
270 |
|
271 |
-
//Redirection in URL
|
272 |
-
if (!empty ($_GET ['redirect_to']))
|
273 |
-
{
|
274 |
-
$redirect_to = $_GET ['redirect_to'];
|
275 |
-
$redirect_to_safe = true;
|
276 |
-
}
|
277 |
-
else
|
278 |
{
|
279 |
//Redirection customized
|
280 |
if (isset ($settings ['plugin_registration_form_redirect']))
|
@@ -421,6 +430,7 @@ function oa_social_login_callback ()
|
|
421 |
exit ();
|
422 |
}
|
423 |
}
|
|
|
424 |
}
|
425 |
}
|
426 |
}
|
9 |
//Callback Handler
|
10 |
if (isset ($_POST) AND !empty ($_POST ['oa_action']) AND $_POST ['oa_action'] == 'social_login' AND !empty ($_POST ['connection_token']))
|
11 |
{
|
12 |
+
//OneAll Connection token
|
13 |
+
$connection_token = trim ($_POST ['connection_token']);
|
14 |
+
|
15 |
//Read settings
|
16 |
$settings = get_option ('oa_social_login_settings');
|
17 |
|
18 |
//API Settings
|
19 |
$api_connection_handler = ((!empty ($settings ['api_connection_handler']) AND $settings ['api_connection_handler'] == 'fsockopen') ? 'fsockopen' : 'curl');
|
20 |
$api_connection_use_https = ((!isset ($settings ['api_connection_use_https']) OR $settings ['api_connection_use_https'] == '1') ? true : false);
|
21 |
+
$api_subdomain = (!empty ($settings ['api_subdomain']) ? trim ($settings ['api_subdomain']) : '');
|
22 |
|
23 |
+
//We cannot make a connection without a subdomain
|
24 |
+
if (!empty ($api_subdomain))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
{
|
26 |
+
//See: http://docs.oneall.com/api/resources/connections/read-connection-details/
|
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_credentials = array (
|
31 |
+
'api_key' => (!empty ($settings ['api_key']) ? $settings ['api_key'] : ''),
|
32 |
+
'api_secret' => (!empty ($settings ['api_secret']) ? $settings ['api_secret'] : '')
|
33 |
+
);
|
34 |
+
|
35 |
+
//Get connection details
|
36 |
+
$result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, $api_credentials);
|
37 |
+
if (is_object ($result) AND property_exists ($result, 'http_code') AND $result->http_code == 200 AND property_exists ($result, 'http_data'))
|
38 |
{
|
39 |
+
//Decode result
|
40 |
+
$decoded_result = @json_decode ($result->http_data);
|
41 |
+
if (is_object ($decoded_result) AND isset ($decoded_result->response->result->data->user))
|
|
|
|
|
42 |
{
|
43 |
+
//User data
|
44 |
+
$user_data = $decoded_result->response->result->data->user;
|
45 |
+
|
46 |
+
//Social network profile data
|
47 |
+
$identity = $user_data->identity;
|
48 |
+
|
49 |
+
//Unique user token provided by OneAll
|
50 |
+
$user_token = $user_data->user_token;
|
51 |
|
52 |
+
//Identity Provider
|
|
|
53 |
$user_identity_provider = $identity->source->name;
|
54 |
|
55 |
+
//Thumbnail
|
56 |
+
$user_thumbnail = (!empty ($identity->thumbnailUrl) ? trim ($identity->thumbnailUrl) : '');
|
57 |
|
58 |
+
//Picture
|
59 |
+
$user_picture = (!empty ($identity->pictureUrl) ? trim ($identity->pictureUrl) : '');
|
60 |
|
61 |
//Firstname
|
62 |
$user_first_name = (!empty ($identity->name->givenName) ? $identity->name->givenName : '');
|
78 |
$user_full_name = trim ($user_first_name . ' ' . $user_last_name);
|
79 |
}
|
80 |
|
81 |
+
// Email Address.
|
82 |
+
$user_email = '';
|
83 |
+
if (property_exists ($identity, 'emails') AND is_array ($identity->emails))
|
84 |
+
{
|
85 |
+
$user_email_is_verified = false;
|
86 |
+
while ($user_email_is_verified !== true AND (list(, $email) = each ($identity->emails)))
|
87 |
+
{
|
88 |
+
$user_email = $email->value;
|
89 |
+
$user_email_is_verified = ($email->is_verified == '1');
|
90 |
+
}
|
91 |
}
|
92 |
|
93 |
//User Website
|
122 |
$new_registration = false;
|
123 |
|
124 |
//Sanitize Login
|
125 |
+
$user_login = str_replace ('.', '-', $user_login);
|
126 |
$user_login = sanitize_user ($user_login, true);
|
127 |
|
128 |
// Get user by token
|
246 |
$user_data = get_userdata ($user_id);
|
247 |
if ($user_data !== false)
|
248 |
{
|
249 |
+
//Update user thumbnail
|
250 |
+
if (!empty ($user_thumbnail))
|
251 |
+
{
|
252 |
+
update_user_meta ($user_id, 'oa_social_login_user_thumbnail', $user_thumbnail);
|
253 |
}
|
254 |
|
255 |
//Update user picture
|
277 |
//Default redirection
|
278 |
$redirect_to = admin_url ();
|
279 |
|
280 |
+
//Redirection in URL
|
281 |
+
if (!empty ($_GET ['redirect_to']))
|
282 |
+
{
|
283 |
+
$redirect_to = $_GET ['redirect_to'];
|
284 |
+
$redirect_to_safe = true;
|
285 |
+
}
|
286 |
+
else
|
287 |
{
|
288 |
//Redirection customized
|
289 |
if (isset ($settings ['plugin_registration_form_redirect']))
|
430 |
exit ();
|
431 |
}
|
432 |
}
|
433 |
+
|
434 |
}
|
435 |
}
|
436 |
}
|
includes/settings.php
CHANGED
@@ -49,6 +49,9 @@ $oa_social_login_providers = array (
|
|
49 |
'steam' => array (
|
50 |
'name' => 'Steam Community'
|
51 |
),
|
|
|
|
|
|
|
52 |
'windowslive' => array (
|
53 |
'name' => 'Windows Live'
|
54 |
),
|
49 |
'steam' => array (
|
50 |
'name' => 'Steam Community'
|
51 |
),
|
52 |
+
'twitch' => array (
|
53 |
+
'name' => 'Twitch.tv'
|
54 |
+
),
|
55 |
'windowslive' => array (
|
56 |
'name' => 'Windows Live'
|
57 |
),
|
includes/toolbox.php
CHANGED
@@ -149,6 +149,17 @@ function oa_social_login_esc_attr ($string)
|
|
149 |
function oa_social_login_get_userid_by_token ($token)
|
150 |
{
|
151 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
$sql = "SELECT u.ID FROM " . $wpdb->usermeta . " AS um INNER JOIN " . $wpdb->users . " AS u ON (um.user_id=u.ID) WHERE um.meta_key = 'oa_social_login_user_token' AND um.meta_value=%s";
|
153 |
return $wpdb->get_var ($wpdb->prepare ($sql, $token));
|
154 |
}
|
149 |
function oa_social_login_get_userid_by_token ($token)
|
150 |
{
|
151 |
global $wpdb;
|
152 |
+
|
153 |
+
// Sanitize token.
|
154 |
+
$token = trim (strval ($token));
|
155 |
+
|
156 |
+
// The token is required.
|
157 |
+
if (strlen ($token) == 0)
|
158 |
+
{
|
159 |
+
return false;
|
160 |
+
}
|
161 |
+
|
162 |
+
// Read user for this token.
|
163 |
$sql = "SELECT u.ID FROM " . $wpdb->usermeta . " AS um INNER JOIN " . $wpdb->users . " AS u ON (um.user_id=u.ID) WHERE um.meta_key = 'oa_social_login_user_token' AND um.meta_value=%s";
|
164 |
return $wpdb->get_var ($wpdb->prepare ($sql, $token));
|
165 |
}
|
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: 4.
|
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', '4.
|
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 20+ social networks</strong> like Twitter, Facebook, LinkedIn, Hyves, Вконтакте, Google or Yahoo.
|
6 |
+
Version: 4.4
|
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', '4.4');
|
15 |
|
16 |
/**
|
17 |
* Check technical requirements before activating the plugin (Wordpress 3.0 or newer required)
|
readme.txt
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
=== Social Login ===
|
2 |
Contributors: ClaudeSchlesser
|
3 |
-
Tags: social login, social connect, facebook
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 4.
|
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 |
Social Login is a professionally developed and free Wordpress (BuddyPress compatible) plugin that allows your visitors to comment,
|
13 |
-
login and register with 20+ Social Networks like for example Facebook, Twitter, Google, LinkedIn,
|
14 |
<strong>Make your blog social!</strong><br />
|
15 |
|
16 |
<strong>Choose where to add the Social Login Plugin:</strong>
|
@@ -33,7 +33,7 @@ login and register with 20+ Social Networks like for example Facebook, Twitter,
|
|
33 |
<li>Twitter</li>
|
34 |
<li>Google</li>
|
35 |
<li>LinkedIn</li>
|
36 |
-
<li>
|
37 |
<li>Yahoo</li>
|
38 |
<li>Github.com</li>
|
39 |
<li>Foursquare</li>
|
@@ -63,10 +63,20 @@ Google, Yahoo!, LinkedIn, Paypal, Hyves amongst others.
|
|
63 |
|
64 |
== Installation ==
|
65 |
|
|
|
66 |
1. Upload the plugin folder to the "/wp-content/plugins/" directory of your WordPress site,
|
67 |
2. Activate the plugin through the 'Plugins' menu in WordPress,
|
68 |
3. Visit the "Settings\Social Login" administration page to setup the plugin.
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
== Frequently Asked Questions ==
|
71 |
|
72 |
= Do I have to add template tags to my theme? =
|
@@ -121,6 +131,9 @@ http://docs.oneall.com/plugins/guide/social-login-wordpress/
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
|
|
|
|
|
|
124 |
= 4.3 =
|
125 |
* Social Network Avatars improved
|
126 |
* Social Link shortcode/hook/action added
|
1 |
=== Social Login ===
|
2 |
Contributors: ClaudeSchlesser
|
3 |
+
Tags: social login, social connect, facebook, linkedin, livejournal, google, yahoo, twitter, openid, paypal, google, hyves, widget, plugin, social network login, comments
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 3.9
|
6 |
+
Stable tag: 4.4
|
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 |
Social Login is a professionally developed and free Wordpress (BuddyPress compatible) plugin that allows your visitors to comment,
|
13 |
+
login and register with 20+ Social Networks like for example Facebook, Twitter, Google, LinkedIn, PayPal, LiveJournal, Hyves, Вконтакте and Yahoo.<br /><br />
|
14 |
<strong>Make your blog social!</strong><br />
|
15 |
|
16 |
<strong>Choose where to add the Social Login Plugin:</strong>
|
33 |
<li>Twitter</li>
|
34 |
<li>Google</li>
|
35 |
<li>LinkedIn</li>
|
36 |
+
<li>PayPal</li>
|
37 |
<li>Yahoo</li>
|
38 |
<li>Github.com</li>
|
39 |
<li>Foursquare</li>
|
63 |
|
64 |
== Installation ==
|
65 |
|
66 |
+
= Plugin Installation =
|
67 |
1. Upload the plugin folder to the "/wp-content/plugins/" directory of your WordPress site,
|
68 |
2. Activate the plugin through the 'Plugins' menu in WordPress,
|
69 |
3. Visit the "Settings\Social Login" administration page to setup the plugin.
|
70 |
|
71 |
+
= API Connection =
|
72 |
+
The social network APIs are constantly changing and being updated. We monitor these changes and automatically
|
73 |
+
update our APIs, so that you can be sure that Social Login will always run smoothly and with the most up-to-date
|
74 |
+
API calls.
|
75 |
+
|
76 |
+
In order to enable the plugin your therefore have to connect with the OneAll API and you need to create a free
|
77 |
+
account at https://app.oneall.com
|
78 |
+
|
79 |
+
|
80 |
== Frequently Asked Questions ==
|
81 |
|
82 |
= Do I have to add template tags to my theme? =
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 4.4 =
|
135 |
+
* Social Network "Xing" added
|
136 |
+
|
137 |
= 4.3 =
|
138 |
* Social Network Avatars improved
|
139 |
* Social Link shortcode/hook/action added
|