Version Description
- Added resend otp in Profile Completion
- Added column timestamp in account linking table
- Added option to disable custom app
- Added include_email parameter in for twitter custom app
- Added prompt to ask user for confirmation on custom app deletion
- Code cleanup
Download this release
Release Info
Developer | cyberlord92 |
Plugin | Social Login |
Version | 6.6.0 |
Comparing to | |
See all releases |
Code changes from version 6.5.0 to 6.6.0
- class-mo-openid-login-widget.php +52 -59
- includes/css/mo_openid_style.css +62 -1
- miniorange_openid_sso_settings.php +13 -2
- miniorange_openid_sso_settings_page.php +48 -9
- readme.txt +17 -1
- twitter_oauth.php +2 -1
- uninstall.php +5 -0
class-mo-openid-login-widget.php
CHANGED
@@ -345,7 +345,8 @@ if(mo_openid_is_customer_registered()) {
|
|
345 |
$appslist = array();
|
346 |
|
347 |
foreach( $appslist as $key => $app){
|
348 |
-
|
|
|
349 |
return 'true';
|
350 |
}
|
351 |
return 'false';
|
@@ -853,7 +854,22 @@ if(mo_openid_is_customer_registered()) {
|
|
853 |
|
854 |
function mo_openid_login_validate(){
|
855 |
|
856 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
857 |
echo mo_openid_profile_completion_form($_POST["last_name"],$_POST["first_name"], $_POST["user_full_name"],$_POST["user_url"], $_POST["user_picture"], $_POST['username_field'], $_POST['email_field'],$_POST["decrypted_app_name"],$_POST["decrypted_user_id"]);
|
858 |
exit;
|
859 |
}
|
@@ -1029,12 +1045,29 @@ if(mo_openid_is_customer_registered()) {
|
|
1029 |
$decrypted_app_name = $_POST["decrypted_app_name"];
|
1030 |
$decrypted_user_id = $_POST["decrypted_user_id"];
|
1031 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1032 |
$validate_content = validate_otp_token($transaction_id, $otp_token);
|
1033 |
$status = $validate_content['status'];
|
1034 |
|
1035 |
//if invalid OTP
|
1036 |
if($status == 'FAILURE'){
|
1037 |
-
|
|
|
|
|
|
|
1038 |
}
|
1039 |
//if OTP is Valid
|
1040 |
else{
|
@@ -1688,13 +1721,15 @@ if(mo_openid_is_customer_registered()) {
|
|
1688 |
}
|
1689 |
else if($appname == "twitter") {
|
1690 |
if (isset($profile_json_output['name'])) {
|
1691 |
-
$
|
|
|
|
|
1692 |
}
|
1693 |
if (isset($profile_json_output['screen_name'])) {
|
1694 |
$user_name = isset( $profile_json_output['screen_name']) ? $profile_json_output['screen_name'] : '';
|
1695 |
}
|
1696 |
-
if (isset($profile_json_output['
|
1697 |
-
$email = isset( $profile_json_output['
|
1698 |
}
|
1699 |
if (isset($profile_json_output['url'])) {
|
1700 |
$user_url = isset( $profile_json_output['url']) ? $profile_json_output['url'] : '';
|
@@ -1977,7 +2012,7 @@ if(mo_openid_is_customer_registered()) {
|
|
1977 |
}
|
1978 |
}
|
1979 |
|
1980 |
-
function mo_openid_validate_otp_form($username, $user_email, $transaction_id, $user_picture, $user_url, $last_name, $user_full_name ,$first_name, $decrypted_app_name, $decrypted_user_id){
|
1981 |
$path = mo_openid_get_wp_style();
|
1982 |
$html = '<head><link rel="stylesheet" href='.$path.' type="text/css" media="all" /></head>
|
1983 |
|
@@ -1991,10 +2026,10 @@ if(mo_openid_is_customer_registered()) {
|
|
1991 |
<span style="margin:120px;font-size: 24px;font-family: Arial">Verify your email</span><br>
|
1992 |
<div style="padding: 12px;"></div>
|
1993 |
<div style=" padding: 16px;background-color:rgba(1, 145, 191, 0.117647);color: black;">
|
1994 |
-
<span style=" margin-left: 15px;color: black;font-weight: bold;float: right;font-size: 22px;line-height: 20px;cursor: pointer;font-family: Arial;transition: 0.3s"></span>
|
1995 |
<p>
|
1996 |
<label for="user_login">Enter your verification code<br/>
|
1997 |
-
<input type="text" pattern="\d{4,5}" class="input" name="otp_field" value="" size="20"
|
1998 |
</p>
|
1999 |
<input type="hidden" name="username_field" value='.$username.'>
|
2000 |
<input type="hidden" name="email_field" value='.$user_email.'>
|
@@ -2012,7 +2047,8 @@ if(mo_openid_is_customer_registered()) {
|
|
2012 |
<input type="button" onclick="show_profile_completion_form()" name="otp_back" id="back" class="button button-primary button-large" value="Back"/> 
|
2013 |
</div>
|
2014 |
<div style="float: right">
|
2015 |
-
|
|
|
2016 |
</div>';
|
2017 |
|
2018 |
if(get_option('mo_openid_oauth')=='1' && get_option('moopenid_logo_check') == 1) {
|
@@ -2140,53 +2176,6 @@ if(mo_openid_is_customer_registered()) {
|
|
2140 |
return $html;
|
2141 |
}
|
2142 |
|
2143 |
-
function mo_openid_invalid_otp_form($first_name, $last_name, $user_full_name, $user_url, $user_picture, $decrypted_app_name, $decrypted_user_id, $username,$user_email, $transaction_id){
|
2144 |
-
$path = mo_openid_get_wp_style();
|
2145 |
-
$html = '<style>.form-input-validation.is-error {color: #d94f4f;}</style>
|
2146 |
-
<head><link rel="stylesheet" href='.$path.' type="text/css" media="all" /></head>
|
2147 |
-
|
2148 |
-
<body class="login login-action-login wp-core-ui locale-en-us">
|
2149 |
-
<div style="position:fixed;background:#f1f1f1;"></div>
|
2150 |
-
<div id="add_field" style="position:fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 1;padding-top:130px;">
|
2151 |
-
<div style="width: 500px; margin: 30px auto;">
|
2152 |
-
<form name="f" method="post" action="">
|
2153 |
-
<div style="background: white;margin-top:-15px;padding: 15px;">
|
2154 |
-
|
2155 |
-
<span style="margin:120px;font-size: 24px;font-family: Arial">Verify your email</span>
|
2156 |
-
|
2157 |
-
<p>
|
2158 |
-
<label for="user_login">Enter verification code<br/>
|
2159 |
-
<input type="text" pattern="\d{4,5}" class="input" name="otp_field" value="" size="20" required></label>
|
2160 |
-
<span align="center" class="form-input-validation is-error">You have entered an invalid verification code. Enter a valid code.</span>
|
2161 |
-
</p>
|
2162 |
-
|
2163 |
-
<input type="hidden" name="first_name" value='.$first_name.'>
|
2164 |
-
<input type="hidden" name="last_name" value='.$last_name.'>
|
2165 |
-
<input type="hidden" name="user_full_name" value='.$user_full_name.'>
|
2166 |
-
<input type="hidden" name="user_url" value='.$user_url.'>
|
2167 |
-
<input type="hidden" name="user_picture" value='.$user_picture.'>
|
2168 |
-
<input type="hidden" name="decrypted_app_name" value='.$decrypted_app_name.'>
|
2169 |
-
<input type="hidden" name="decrypted_user_id" value='.$decrypted_user_id.'>
|
2170 |
-
<input type="hidden" name="username_field" value='.$username.'>
|
2171 |
-
<input type="hidden" name="email_field" value='.$user_email.'>
|
2172 |
-
<input type="hidden" name="transaction_id" value='.$transaction_id.'>
|
2173 |
-
<input type="hidden" name="option" value="mo_openid_otp_validation">
|
2174 |
-
</div>
|
2175 |
-
<p class="submit">
|
2176 |
-
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Submit"/>
|
2177 |
-
</p> ';
|
2178 |
-
|
2179 |
-
if(get_option('mo_openid_oauth')=='1' && get_option('moopenid_logo_check') == 1) {
|
2180 |
-
$html .= mo_openid_customize_logo();
|
2181 |
-
}
|
2182 |
-
|
2183 |
-
$html .= '</form>
|
2184 |
-
</div>
|
2185 |
-
</div>
|
2186 |
-
</body>';
|
2187 |
-
return $html;
|
2188 |
-
}
|
2189 |
-
|
2190 |
function mo_openid_account_linking_form(){
|
2191 |
$path = mo_openid_get_wp_style();
|
2192 |
$html = "<head><link rel=\"stylesheet\" href=".$path. " type='text/css' media='all' /><head>
|
@@ -2267,6 +2256,9 @@ if(mo_openid_is_customer_registered()) {
|
|
2267 |
}
|
2268 |
|
2269 |
function mo_openid_insert_query($social_app_name,$user_email,$userid,$social_app_identifier){
|
|
|
|
|
|
|
2270 |
global $wpdb;
|
2271 |
$db_prefix = $wpdb->prefix;
|
2272 |
$table_name = $db_prefix. 'mo_openid_linked_user';
|
@@ -2277,12 +2269,14 @@ if(mo_openid_is_customer_registered()) {
|
|
2277 |
'linked_social_app' => $social_app_name,
|
2278 |
'linked_email' => $user_email,
|
2279 |
'user_id' => $userid,
|
2280 |
-
'identifier' => $social_app_identifier
|
|
|
2281 |
),
|
2282 |
array(
|
2283 |
'%s',
|
2284 |
'%s',
|
2285 |
'%d',
|
|
|
2286 |
'%s'
|
2287 |
)
|
2288 |
);
|
@@ -2314,7 +2308,6 @@ if(mo_openid_is_customer_registered()) {
|
|
2314 |
|
2315 |
function mo_openid_get_redirect_url() {
|
2316 |
|
2317 |
-
$url = '';
|
2318 |
$current_url = isset($_COOKIE["redirect_current_url"]) ? $_COOKIE["redirect_current_url"]:'';
|
2319 |
$pos = strpos($_SERVER['REQUEST_URI'], '/openidcallback');
|
2320 |
|
345 |
$appslist = array();
|
346 |
|
347 |
foreach( $appslist as $key => $app){
|
348 |
+
$option = 'mo_openid_enable_custom_app_' . $key;
|
349 |
+
if($app_name == $key && get_option($option) == '1')
|
350 |
return 'true';
|
351 |
}
|
352 |
return 'false';
|
854 |
|
855 |
function mo_openid_login_validate(){
|
856 |
|
857 |
+
// ajax call - custom app over default app
|
858 |
+
if ((isset($_POST['selected_app'])) && (isset($_POST['selected_app_value']))){
|
859 |
+
if($_POST['selected_app_value'] == 'true'){
|
860 |
+
//if custome app enable
|
861 |
+
$option = 'mo_openid_enable_custom_app_' . $_POST['selected_app'];
|
862 |
+
update_option( $option, '1');
|
863 |
+
}
|
864 |
+
else{
|
865 |
+
//if custome app Disable
|
866 |
+
$option = 'mo_openid_enable_custom_app_' . $_POST['selected_app'];
|
867 |
+
update_option( $option, '0');
|
868 |
+
}
|
869 |
+
exit;
|
870 |
+
}
|
871 |
+
|
872 |
+
else if( isset( $_POST['option'] ) and strpos( $_POST['option'], 'mo_openid_show_profile_form' ) !== false ){
|
873 |
echo mo_openid_profile_completion_form($_POST["last_name"],$_POST["first_name"], $_POST["user_full_name"],$_POST["user_url"], $_POST["user_picture"], $_POST['username_field'], $_POST['email_field'],$_POST["decrypted_app_name"],$_POST["decrypted_user_id"]);
|
874 |
exit;
|
875 |
}
|
1045 |
$decrypted_app_name = $_POST["decrypted_app_name"];
|
1046 |
$decrypted_user_id = $_POST["decrypted_user_id"];
|
1047 |
|
1048 |
+
if(isset($_POST['resend_otp']))
|
1049 |
+
{
|
1050 |
+
$send_content = send_otp_token($user_email);
|
1051 |
+
if($send_content['status']=='FAILURE'){
|
1052 |
+
$message = 'Either your SMTP is not configured or you have entered an unmailable email. Please register to the <a href="'.get_site_url().'">website</a> manually.';
|
1053 |
+
wp_die($message);
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
$transaction_id = $send_content['tId'];
|
1057 |
+
echo mo_openid_validate_otp_form($username, $user_email, $transaction_id, $user_picture, $user_url, $last_name, $user_full_name,$first_name, $decrypted_app_name, $decrypted_user_id);
|
1058 |
+
|
1059 |
+
exit;
|
1060 |
+
}
|
1061 |
+
|
1062 |
$validate_content = validate_otp_token($transaction_id, $otp_token);
|
1063 |
$status = $validate_content['status'];
|
1064 |
|
1065 |
//if invalid OTP
|
1066 |
if($status == 'FAILURE'){
|
1067 |
+
$message = 'You have entered an invalid verification code. Enter a valid code.';
|
1068 |
+
echo mo_openid_validate_otp_form($username, $user_email, $transaction_id, $user_picture, $user_url, $last_name, $user_full_name,$first_name, $decrypted_app_name, $decrypted_user_id,$message);
|
1069 |
+
exit;
|
1070 |
+
|
1071 |
}
|
1072 |
//if OTP is Valid
|
1073 |
else{
|
1721 |
}
|
1722 |
else if($appname == "twitter") {
|
1723 |
if (isset($profile_json_output['name'])) {
|
1724 |
+
$full_name = explode(" ", $profile_json_output['name']);
|
1725 |
+
$first_name = isset( $full_name[0]) ? $full_name[0] : '';
|
1726 |
+
$last_name = isset( $full_name[1]) ? $full_name[1] : '';
|
1727 |
}
|
1728 |
if (isset($profile_json_output['screen_name'])) {
|
1729 |
$user_name = isset( $profile_json_output['screen_name']) ? $profile_json_output['screen_name'] : '';
|
1730 |
}
|
1731 |
+
if (isset($profile_json_output['email'])) {
|
1732 |
+
$email = isset( $profile_json_output['email']) ? $profile_json_output['email'] : '';
|
1733 |
}
|
1734 |
if (isset($profile_json_output['url'])) {
|
1735 |
$user_url = isset( $profile_json_output['url']) ? $profile_json_output['url'] : '';
|
2012 |
}
|
2013 |
}
|
2014 |
|
2015 |
+
function mo_openid_validate_otp_form($username, $user_email, $transaction_id, $user_picture, $user_url, $last_name, $user_full_name ,$first_name, $decrypted_app_name, $decrypted_user_id,$message = 'We have sent a verification code to given email. Please verify your account with it.'){
|
2016 |
$path = mo_openid_get_wp_style();
|
2017 |
$html = '<head><link rel="stylesheet" href='.$path.' type="text/css" media="all" /></head>
|
2018 |
|
2026 |
<span style="margin:120px;font-size: 24px;font-family: Arial">Verify your email</span><br>
|
2027 |
<div style="padding: 12px;"></div>
|
2028 |
<div style=" padding: 16px;background-color:rgba(1, 145, 191, 0.117647);color: black;">
|
2029 |
+
<span style=" margin-left: 15px;color: black;font-weight: bold;float: right;font-size: 22px;line-height: 20px;cursor: pointer;font-family: Arial;transition: 0.3s"></span>'.$message.'</div> <br>
|
2030 |
<p>
|
2031 |
<label for="user_login">Enter your verification code<br/>
|
2032 |
+
<input type="text" pattern="\d{4,5}" class="input" name="otp_field" value="" size="20" /></label>
|
2033 |
</p>
|
2034 |
<input type="hidden" name="username_field" value='.$username.'>
|
2035 |
<input type="hidden" name="email_field" value='.$user_email.'>
|
2047 |
<input type="button" onclick="show_profile_completion_form()" name="otp_back" id="back" class="button button-primary button-large" value="Back"/> 
|
2048 |
</div>
|
2049 |
<div style="float: right">
|
2050 |
+
<input type="submit" style="margin-left:10px" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Submit"/>
|
2051 |
+
<input type="submit" name="resend_otp" id="resend_otp" class="button button-primary button-large" value="Resend OTP"/>
|
2052 |
</div>';
|
2053 |
|
2054 |
if(get_option('mo_openid_oauth')=='1' && get_option('moopenid_logo_check') == 1) {
|
2176 |
return $html;
|
2177 |
}
|
2178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2179 |
function mo_openid_account_linking_form(){
|
2180 |
$path = mo_openid_get_wp_style();
|
2181 |
$html = "<head><link rel=\"stylesheet\" href=".$path. " type='text/css' media='all' /><head>
|
2256 |
}
|
2257 |
|
2258 |
function mo_openid_insert_query($social_app_name,$user_email,$userid,$social_app_identifier){
|
2259 |
+
date_default_timezone_set('Asia/Kolkata');
|
2260 |
+
$date = date('Y-m-d H:i:s');
|
2261 |
+
|
2262 |
global $wpdb;
|
2263 |
$db_prefix = $wpdb->prefix;
|
2264 |
$table_name = $db_prefix. 'mo_openid_linked_user';
|
2269 |
'linked_social_app' => $social_app_name,
|
2270 |
'linked_email' => $user_email,
|
2271 |
'user_id' => $userid,
|
2272 |
+
'identifier' => $social_app_identifier,
|
2273 |
+
'timestamp' => $date,
|
2274 |
),
|
2275 |
array(
|
2276 |
'%s',
|
2277 |
'%s',
|
2278 |
'%d',
|
2279 |
+
'%s',
|
2280 |
'%s'
|
2281 |
)
|
2282 |
);
|
2308 |
|
2309 |
function mo_openid_get_redirect_url() {
|
2310 |
|
|
|
2311 |
$current_url = isset($_COOKIE["redirect_current_url"]) ? $_COOKIE["redirect_current_url"]:'';
|
2312 |
$pos = strpos($_SERVER['REQUEST_URI'], '/openidcallback');
|
2313 |
|
includes/css/mo_openid_style.css
CHANGED
@@ -376,4 +376,65 @@ aside.widget-area>section.widget_mo_openid_sharing_hor_wid>div.mo-openid-app-ico
|
|
376 |
{
|
377 |
font-size:0 !important;
|
378 |
|
379 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
{
|
377 |
font-size:0 !important;
|
378 |
|
379 |
+
}
|
380 |
+
|
381 |
+
.mo-switch {
|
382 |
+
position: relative;
|
383 |
+
display: inline-block;
|
384 |
+
width: 50px;
|
385 |
+
height: 26px;
|
386 |
+
}
|
387 |
+
|
388 |
+
.mo-switch input {display:none;}
|
389 |
+
|
390 |
+
.mo-slider {
|
391 |
+
position: absolute;
|
392 |
+
cursor: pointer;
|
393 |
+
top: 0;
|
394 |
+
left: 0;
|
395 |
+
right: 0;
|
396 |
+
bottom: 0;
|
397 |
+
background-color: grey;
|
398 |
+
-webkit-transition: .4s;
|
399 |
+
transition: .4s;
|
400 |
+
}
|
401 |
+
|
402 |
+
.mo-slider:before {
|
403 |
+
position: absolute;
|
404 |
+
content: "";
|
405 |
+
height: 16px;
|
406 |
+
width: 16px;
|
407 |
+
left: 4px;
|
408 |
+
bottom: 5px;
|
409 |
+
background-color: white;
|
410 |
+
-webkit-transition: .4s;
|
411 |
+
transition: .4s;
|
412 |
+
}
|
413 |
+
|
414 |
+
input:checked + .mo-slider {
|
415 |
+
background-color: #0085ba;
|
416 |
+
}
|
417 |
+
|
418 |
+
input:focus + .mo-slider {
|
419 |
+
box-shadow: 0 0 1px #2196F3;
|
420 |
+
}
|
421 |
+
|
422 |
+
input:checked + .mo-slider:before {
|
423 |
+
-webkit-transform: translateX(26px);
|
424 |
+
-ms-transform: translateX(26px);
|
425 |
+
transform: translateX(26px);
|
426 |
+
}
|
427 |
+
|
428 |
+
input:checked+ .mo-slider .on
|
429 |
+
{display: block;}
|
430 |
+
|
431 |
+
input:checked + .mo-slider .off
|
432 |
+
{display: none;}
|
433 |
+
|
434 |
+
.mo-slider.round {
|
435 |
+
border-radius: 34px;
|
436 |
+
}
|
437 |
+
|
438 |
+
.mo-slider.round:before {
|
439 |
+
border-radius: 50%;}
|
440 |
+
|
miniorange_openid_sso_settings.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Social Login, Social Sharing by miniOrange
|
5 |
* Plugin URI: https://www.miniorange.com
|
6 |
* Description: Allow your users to login, comment and share with Facebook, Google, Twitter, LinkedIn etc using customizable buttons.
|
7 |
-
* Version: 6.
|
8 |
* Author: miniOrange
|
9 |
* Author URI: https://www.miniorange.com
|
10 |
* License: GPL2
|
@@ -238,6 +238,11 @@ class Miniorange_OpenID_SSO {
|
|
238 |
add_option( 'mo_openid_bp_before_register_page','0');
|
239 |
add_option( 'mo_openid_bp_before_account_details_fields','0');
|
240 |
add_option( 'mo_openid_bp_after_register_page','0');
|
|
|
|
|
|
|
|
|
|
|
241 |
}
|
242 |
|
243 |
function mo_openid_deactivate() {
|
@@ -262,15 +267,21 @@ class Miniorange_OpenID_SSO {
|
|
262 |
function mo_openid_plugin_update(){
|
263 |
global $wpdb;
|
264 |
$table_name = $wpdb->prefix . 'mo_openid_linked_user';
|
|
|
265 |
$charset_collate = $wpdb->get_charset_collate();
|
266 |
|
267 |
-
|
|
|
|
|
|
|
|
|
268 |
$sql = "CREATE TABLE $table_name (
|
269 |
id mediumint(9) NOT NULL AUTO_INCREMENT,
|
270 |
linked_social_app varchar(55) NOT NULL,
|
271 |
linked_email varchar(55) NOT NULL,
|
272 |
user_id mediumint(10) NOT NULL,
|
273 |
identifier VARCHAR(100) NOT NULL,
|
|
|
274 |
PRIMARY KEY (id)
|
275 |
) $charset_collate;";
|
276 |
|
4 |
* Plugin Name: Social Login, Social Sharing by miniOrange
|
5 |
* Plugin URI: https://www.miniorange.com
|
6 |
* Description: Allow your users to login, comment and share with Facebook, Google, Twitter, LinkedIn etc using customizable buttons.
|
7 |
+
* Version: 6.6.0
|
8 |
* Author: miniOrange
|
9 |
* Author URI: https://www.miniorange.com
|
10 |
* License: GPL2
|
238 |
add_option( 'mo_openid_bp_before_register_page','0');
|
239 |
add_option( 'mo_openid_bp_before_account_details_fields','0');
|
240 |
add_option( 'mo_openid_bp_after_register_page','0');
|
241 |
+
|
242 |
+
//Custom app switch button option
|
243 |
+
add_option('mo_openid_enable_custom_app_google','1');
|
244 |
+
add_option('mo_openid_enable_custom_app_facebook','1');
|
245 |
+
add_option('mo_openid_enable_custom_app_twitter','1');
|
246 |
}
|
247 |
|
248 |
function mo_openid_deactivate() {
|
267 |
function mo_openid_plugin_update(){
|
268 |
global $wpdb;
|
269 |
$table_name = $wpdb->prefix . 'mo_openid_linked_user';
|
270 |
+
$column_name = 'timestamp';
|
271 |
$charset_collate = $wpdb->get_charset_collate();
|
272 |
|
273 |
+
$prepared_statement = $wpdb->prepare( "SELECT {$column_name} FROM {$table_name} WHERE {$column_name} like %s", $column_name );
|
274 |
+
$timestamp_column = $wpdb->get_col( $prepared_statement );
|
275 |
+
|
276 |
+
// if table doesn't exist or the 'timestamp' column doesn't exist
|
277 |
+
if($wpdb->get_var("show tables like '$table_name'") != $table_name || empty($timestamp_column) ) {
|
278 |
$sql = "CREATE TABLE $table_name (
|
279 |
id mediumint(9) NOT NULL AUTO_INCREMENT,
|
280 |
linked_social_app varchar(55) NOT NULL,
|
281 |
linked_email varchar(55) NOT NULL,
|
282 |
user_id mediumint(10) NOT NULL,
|
283 |
identifier VARCHAR(100) NOT NULL,
|
284 |
+
timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
285 |
PRIMARY KEY (id)
|
286 |
) $charset_collate;";
|
287 |
|
miniorange_openid_sso_settings_page.php
CHANGED
@@ -29,6 +29,16 @@ function mo_register_openid() {
|
|
29 |
</h2>
|
30 |
</div>
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<div id="mo_openid_settings">
|
33 |
|
34 |
<div class="mo_container">
|
@@ -3266,27 +3276,56 @@ function mo_openid_custom_app_config(){?>
|
|
3266 |
echo "<br><input onclick='window.location.href=\"admin.php?page=mo_openid_settings&tab=custom_app&action=add\"' type='button' class='button button-primary button-large' style='float:right;text-align:center;' value='Add Application'>";
|
3267 |
echo "<h3>Applications List</h3>";
|
3268 |
echo "<table class='tableborder'>";
|
3269 |
-
|
3270 |
foreach($appslist as $key => $app){
|
3271 |
-
|
3272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3273 |
echo "</table>";
|
3274 |
echo "<br><br><br><br><br><br><br><br>";
|
3275 |
-
echo "<div style='text-align: center'><p><u>Please Note :</u><br>
|
3276 |
-
Please add an application here only if you don't want to use the default miniOrange application. <br>
|
3277 |
</p></div>";
|
3278 |
|
3279 |
}elseif (get_option('mo_openid_apps_list')==null){
|
3280 |
echo "<div style='text-align: center'><p>You have not configured any custom apps yet. Please click on <b>Add Application</b> to configure your own app.</p>";
|
3281 |
-
echo "<
|
3282 |
-
Please add an application here only if you don't want to use the default miniOrange application. <br>
|
3283 |
-
</p></div>";
|
3284 |
-
echo "<br><input type='button' onclick='window.location.href=\"admin.php?page=mo_openid_settings&tab=custom_app&action=add\"' class='button button-primary button-large' style='margin-left:300px;text-align:center;' value='Add Application'>";
|
3285 |
echo "<br><br><br><br><br><br><br>";
|
3286 |
|
3287 |
}?>
|
3288 |
</div>
|
3289 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3290 |
<?php
|
3291 |
}
|
3292 |
|
29 |
</h2>
|
30 |
</div>
|
31 |
|
32 |
+
<script>
|
33 |
+
function popup_delete_app(selected_app){
|
34 |
+
|
35 |
+
if (confirm("Are you sure you want to delete the app.")) {
|
36 |
+
location.href='admin.php?page=mo_openid_settings&tab=custom_app&action=delete&app=' + selected_app ;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
</script>
|
40 |
+
|
41 |
+
|
42 |
<div id="mo_openid_settings">
|
43 |
|
44 |
<div class="mo_container">
|
3276 |
echo "<br><input onclick='window.location.href=\"admin.php?page=mo_openid_settings&tab=custom_app&action=add\"' type='button' class='button button-primary button-large' style='float:right;text-align:center;' value='Add Application'>";
|
3277 |
echo "<h3>Applications List</h3>";
|
3278 |
echo "<table class='tableborder'>";
|
3279 |
+
echo "<tr><th><b>Name</b></th><th>Action</th><th>Enable Custom app</tr></tr>";
|
3280 |
foreach($appslist as $key => $app){
|
3281 |
+
|
3282 |
+
$option = 'mo_openid_enable_custom_app_' . $key;
|
3283 |
+
|
3284 |
+
if(get_option($option) == '1'){
|
3285 |
+
$enable_status = 'checked';
|
3286 |
+
}
|
3287 |
+
else{
|
3288 |
+
$enable_status = '';
|
3289 |
+
}
|
3290 |
+
echo "<tr><td>".$key."</td><td><a href='admin.php?page=mo_openid_settings&tab=custom_app&action=update&app=".$key."'>Edit</a> | <a onclick='popup_delete_app(\"".$key."\")'>Delete</a>
|
3291 |
+
</td><td><label class='mo-switch'>
|
3292 |
+
<input type='checkbox' ". $enable_status ." onclick='enable_custom_app(\"".$key."\"); ' id='mo_id_".$key."' >
|
3293 |
+
<div class='mo-slider round' id='switch_checkbox' >
|
3294 |
+
</div>
|
3295 |
+
|
3296 |
+
</label></td></tr>";
|
3297 |
+
}
|
3298 |
echo "</table>";
|
3299 |
echo "<br><br><br><br><br><br><br><br>";
|
3300 |
+
echo "<div style='text-align: center'><p><u>Please Note :</u><br>Enable custom app overrides the default app miniOrange uses. If you want to use the default app miniOrange uses, please disable the custom app here.<br>
|
|
|
3301 |
</p></div>";
|
3302 |
|
3303 |
}elseif (get_option('mo_openid_apps_list')==null){
|
3304 |
echo "<div style='text-align: center'><p>You have not configured any custom apps yet. Please click on <b>Add Application</b> to configure your own app.</p>";
|
3305 |
+
echo "<br><input type='button' onclick='window.location.href=\"admin.php?page=mo_openid_settings&tab=custom_app&action=add\"' class='button button-primary button-large' style='text-align:center;' value='Add Application'>";
|
|
|
|
|
|
|
3306 |
echo "<br><br><br><br><br><br><br>";
|
3307 |
|
3308 |
}?>
|
3309 |
</div>
|
3310 |
</td>
|
3311 |
+
<script>
|
3312 |
+
//ajax call for custom app over default app
|
3313 |
+
function enable_custom_app(appname){
|
3314 |
+
|
3315 |
+
var checkbox_id = 'mo_id_'+appname;
|
3316 |
+
var value = document.getElementById(checkbox_id).checked;
|
3317 |
+
|
3318 |
+
jQuery.ajax({
|
3319 |
+
url:"<?php echo admin_url();?>", //the page containing php script
|
3320 |
+
method: "POST", //request type,
|
3321 |
+
data: {selected_app: appname, selected_app_value : value},
|
3322 |
+
dataType: 'text',
|
3323 |
+
success:function(result){
|
3324 |
+
|
3325 |
+
}
|
3326 |
+
});
|
3327 |
+
}
|
3328 |
+
</script>
|
3329 |
<?php
|
3330 |
}
|
3331 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.miniorange.com
|
|
4 |
Tags: social login, social, facebook, twitter, login
|
5 |
Requires at least: 2.0.2
|
6 |
Tested up to: 4.9.4
|
7 |
-
Stable tag: 6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -165,6 +165,14 @@ Please email us at info@miniorange.com. You can also submit your query from the
|
|
165 |
|
166 |
|
167 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
= 6.5.0 =
|
169 |
* Fix for issue during WP default login (unset session variables on logout)
|
170 |
* Fix for issue during Facebook login (used correct variable names)
|
@@ -503,6 +511,14 @@ Please email us at info@miniorange.com. You can also submit your query from the
|
|
503 |
* First version of Social Login, Social Sharing plugin.
|
504 |
|
505 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
= 6.5.0 =
|
507 |
* Fix for issue during WP default login (unset session variables on logout)
|
508 |
* Fix for issue during Facebook login (used correct variable names)
|
4 |
Tags: social login, social, facebook, twitter, login
|
5 |
Requires at least: 2.0.2
|
6 |
Tested up to: 4.9.4
|
7 |
+
Stable tag: 6.6.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
165 |
|
166 |
|
167 |
== Changelog ==
|
168 |
+
= 6.6.0 =
|
169 |
+
* Added resend otp in Profile Completion
|
170 |
+
* Added column timestamp in account linking table
|
171 |
+
* Added option to disable custom app
|
172 |
+
* Added include_email parameter in for twitter custom app
|
173 |
+
* Added prompt to ask user for confirmation on custom app deletion
|
174 |
+
* Code cleanup
|
175 |
+
|
176 |
= 6.5.0 =
|
177 |
* Fix for issue during WP default login (unset session variables on logout)
|
178 |
* Fix for issue during Facebook login (used correct variable names)
|
511 |
* First version of Social Login, Social Sharing plugin.
|
512 |
|
513 |
== Upgrade Notice ==
|
514 |
+
= 6.6.0 =
|
515 |
+
* Added resend otp in Profile Completion
|
516 |
+
* Added column timestamp in account linking table
|
517 |
+
* Added option to disable custom app
|
518 |
+
* Added include_email parameter in for twitter custom app
|
519 |
+
* Added prompt to ask user for confirmation on custom app deletion
|
520 |
+
* Code cleanup
|
521 |
+
|
522 |
= 6.5.0 =
|
523 |
* Fix for issue during WP default login (unset session variables on logout)
|
524 |
* Fix for issue during Facebook login (used correct variable names)
|
twitter_oauth.php
CHANGED
@@ -102,7 +102,8 @@ class twitter_oauth
|
|
102 |
"oauth_consumer_key" => $this->key,
|
103 |
"oauth_token" => $oauth_token,
|
104 |
"oauth_signature_method" => "HMAC-SHA1",
|
105 |
-
"screen_name" => $screen_name
|
|
|
106 |
);
|
107 |
|
108 |
$keys = $this->_urlencode_rfc3986(array_keys($params));
|
102 |
"oauth_consumer_key" => $this->key,
|
103 |
"oauth_token" => $oauth_token,
|
104 |
"oauth_signature_method" => "HMAC-SHA1",
|
105 |
+
"screen_name" => $screen_name,
|
106 |
+
"include_email" => "true"
|
107 |
);
|
108 |
|
109 |
$keys = $this->_urlencode_rfc3986(array_keys($params));
|
uninstall.php
CHANGED
@@ -139,4 +139,9 @@
|
|
139 |
delete_option( 'mo_openid_bp_before_account_details_fields');
|
140 |
delete_option( 'mo_openid_bp_after_register_page');
|
141 |
delete_option('mo_openid_relative_login_redirect_url');
|
|
|
|
|
|
|
|
|
|
|
142 |
?>
|
139 |
delete_option( 'mo_openid_bp_before_account_details_fields');
|
140 |
delete_option( 'mo_openid_bp_after_register_page');
|
141 |
delete_option('mo_openid_relative_login_redirect_url');
|
142 |
+
|
143 |
+
//Custom app switch button option
|
144 |
+
delete_option( 'mo_openid_enable_custom_app_google');
|
145 |
+
delete_option( 'mo_openid_enable_custom_app_facebook');
|
146 |
+
delete_option( 'mo_openid_enable_custom_app_twitter');
|
147 |
?>
|