/** * Display social login interface in widget area. */ public static function login_radius_widget_connect_button() { global $loginRadiusSettings, $user_ID; if (!is_user_logged_in()) { Login_Helper::get_loginradius_interface_container(); } // On user Login show user details. if (is_user_logged_in() && !is_admin()) { $size = '60'; $user = get_userdata($user_ID); $currentSocialId = get_user_meta($user_ID, 'loginradius_current_id', true); // hold the value of avatar option echo "<div style='height:80px;width:180px'><div style='width:63px;float:left;'>"; echo @get_avatar($user_ID, $size, $default, $alt); echo "</div><div style='width:100px; float:left; margin-left:10px'>"; // username separator if (!isset($loginRadiusSettings['username_separator']) || $loginRadiusSettings['username_separator'] == 'dash') { echo $user->user_login; } elseif (isset($loginRadiusSettings['username_separator']) && $loginRadiusSettings['username_separator'] == 'dot') { echo str_replace('-', '.', $user->user_login); } else { echo str_replace('-', ' ', $user->user_login); } if (isset($loginRadiusSettings['LoginRadius_loutRedirect']) && $loginRadiusSettings['LoginRadius_loutRedirect'] == 'custom' && !empty($loginRadiusSettings['custom_loutRedirect'])) { $redirect = htmlspecialchars($loginRadiusSettings['custom_loutRedirect']); } else { $redirect = home_url(); ?> <?php } ?> <br/><a href="<?php echo wp_logout_url($redirect); ?> "><?php _e('Log Out', 'LoginRadius'); ?> </a></div></div><?php } }
/** * Displaying account linking on profile page */ public static function account_linking_info_on_profile_page() { global $pagenow, $lr_custom_interface_settings; $user_Id = get_current_user_id(); if (isset($loginRadiusSettings['LoginRadius_socialLinking']) && $loginRadiusSettings['LoginRadius_socialLinking'] == '1' || !$user_Id == '1') { return; } $custom = false; if (isset($lr_custom_interface_settings['custom_interface']) && $lr_custom_interface_settings['custom_interface'] == '1') { $custom = true; } if ($pagenow == 'profile.php') { if (!class_exists('LR_Raas_Install')) { echo LR_Common::check_linking_status_parameters(); // If remove button clicked if (isset($_GET['loginRadiusMap']) && !empty($_GET['loginRadiusMap']) && isset($_GET['loginRadiusMappingProvider']) && !empty($_GET['loginRadiusMappingProvider'])) { Login_Helper::unlink_provider(); } LR_Common::link_account_if_possible(); ?> <div class="metabox-holder columns-2" id="post-body"> <div class="stuffbox wrap" style="padding-bottom:10px"> <h3><label><?php _e('Link your account', 'LoginRadius'); ?> </label></h3> <div class="inside" style='padding:0'> <table class="form-table editcomment"> <tr> <td colspan="2"><?php _e('By adding another account, you can log in with the new account as well!', 'LoginRadius'); ?> </td> </tr> <tr> <td colspan="2"> <?php if (!class_exists("Login_Helper")) { require_once LOGINRADIUS_PLUGIN_DIR . 'public/inc/login/class-login-helper.php'; } Login_Helper::get_loginradius_interface_container(); ?> </td> </tr> <?php echo LR_Common::get_connected_providers_list(); ?> </table> </div> </div> </div> <?php } else { do_action('lr_raas_social_linking'); } } }
/** * Callback for Social Linking widget shortcode */ public static function linking_widget_shortcode() { global $loginRadiusObject, $loginradius_api_settings, $lr_custom_interface_settings; if (!is_user_logged_in()) { return ''; } $custom = false; if (isset($lr_custom_interface_settings['custom_interface']) && $lr_custom_interface_settings['custom_interface'] == '1') { $custom = true; } $html = LR_Common::check_linking_status_parameters(); if (!($loginRadiusObject->loginradius_is_valid_guid(trim($loginradius_api_settings['LoginRadius_apikey'])) && $loginRadiusObject->loginradius_is_valid_guid(trim($loginradius_api_settings['LoginRadius_secret'])))) { $html .= '<div style="color:red">' . __('Your LoginRadius API key or secret is not valid, please correct it or contact LoginRadius support at <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b>', 'LoginRadius') . '</div>'; } // function call LR_Common::link_account_if_possible(); if (!($loginRadiusObject->loginradius_is_valid_guid(trim($loginradius_api_settings['LoginRadius_apikey'])) && $loginRadiusObject->loginradius_is_valid_guid(trim($loginradius_api_settings['LoginRadius_secret'])))) { $html .= '<div style="color:red">' . __('Your LoginRadius API key or secret is not valid, please correct it or contact LoginRadius support at <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b>', 'LoginRadius') . '</div>'; } $html .= Login_Helper::get_loginradius_interface_container(true); $html .= '<table class="loginRadiusLinking">'; $html .= LR_Common::get_connected_providers_list(); $html .= '</table>'; return $html; }