function shortlogin_callback()
{
    $emember_config = Emember_Config::getInstance();
    if (wp_emember_is_member_logged_in()) {
        $emember_auth = Emember_Auth::getInstance();
        //        _pre($emember_auth);
        $str = '<div class="eMember_compact_login">Hello, ' . $emember_auth->getUserInfo('first_name') . ' ' . $emember_auth->getUserInfo('last_name') . '  | <a href="' . get_logout_url() . '">Logout</a></div>';
    } else {
        $str = '<div class="eMember_compact_login"><a href="' . $emember_config->getValue('login_page_url') . '"> LoginEmpleados</a></div>';
    }
    return $str;
}
function custom_comnpact_login()
{
    $emember_config = Emember_Config::getInstance();
    $join_url = $emember_config->getValue('eMember_payments_page');
    $auth = Emember_Auth::getInstance();
    $output = "";
    $output .= "<div class='eMember_compact_login'>";
    if ($auth->isLoggedIn()) {
        $output .= EMEMBER_HELLO;
        $name = $auth->getUserInfo('first_name') . " " . $auth->getUserInfo('last_name');
        $output .= $name;
        if (!empty($show_profile_link)) {
            $output .= ' | ';
            $edit_profile_page = $emember_config->getValue('eMember_profile_edit_page');
            $output .= '<a href="' . $edit_profile_page . '">' . EMEMBER_EDIT_PROFILE . '</a>';
        }
        $logout = get_logout_url();
        $output .= ' | ';
        $output .= '<a href="' . $logout . '">' . EMEMBER_LOGOUT . '</a>';
    } else {
        if (is_search()) {
            return get_login_link();
        }
        $output .= 'Returning Users: ';
        $eMember_enable_fancy_login = $emember_config->getValue('eMember_enable_fancy_login');
        if ($eMember_enable_fancy_login) {
            $output .= '<a id="' . microtime(true) . '" class="emember_fancy_login_link" href="javascript:void(0);">' . EMEMBER_LOGIN . '</a>';
            ob_start();
            include_once 'fancy_login.php';
            $output_fancy_jquery = ob_get_contents();
            ob_end_clean();
            $output .= $output_fancy_jquery;
        } else {
            $login_url = $emember_config->getValue('login_page_url');
            $output .= '<a href="' . $login_url . '">' . EMEMBER_LOGIN . '</a>';
        }
        $output .= '.   New Customers: ';
        $join_url = $emember_config->getValue('eMember_payments_page');
        $output .= '<a href="' . $join_url . '">Create an Account</a>';
    }
    $output .= "</div>";
    return $output;
}
Esempio n. 3
0
    }
    $host = $_SERVER['SERVER_NAME'];
    return "{$protocol}://{$host}/Shibboleth.sso/Logout";
}
function clear_session_with_message($message)
{
    if (session_id() == '') {
        session_start();
    }
    // On logout, clear the session. If you want to flush the cache,
    // simply logout and log back in again.
    foreach (array_keys($_SESSION) as $k) {
        unset($_SESSION[$k]);
    }
    if (isset($message) && !is_null($message) && trim($message) != "") {
        $_SESSION['lastmessage'] = $message;
    }
    session_write_close();
}
$message = "You have logged out of the GENI " . "Portal. <br/>Note however that you are still logged in to your identity " . "provider (e.g. school) which may enable access to other sites. If this is a shared " . "computer, log out of your identity provider if possible, or clear your cookies to " . "fully log out. (On Chrome to clear your cookies, select 'Clear Browsing Data...' and on " . "Firefox select 'History->Clear Recent History...'.)";
clear_session_with_message($message);
$shib_logout_url = get_logout_url();
$protocol = "http";
if (array_key_exists('HTTPS', $_SERVER)) {
    $protocol = "https";
}
$host = $_SERVER['SERVER_NAME'];
$logout_dest = "{$protocol}://{$host}";
$encoded_dest = urlencode($logout_dest);
$redirect_url = "{$shib_logout_url}?return={$encoded_dest}";
header("Location: {$redirect_url}");
Esempio n. 4
0
function eMember_compact_login_widget_custom()
{
    $emember_config = Emember_Config::getInstance();
    $auth = Emember_Auth::getInstance();
    $output = "";
    $output .= "<div class='eMember_compact_login_custom'>";
    if ($auth->isLoggedIn()) {
        //User is logged in (show the details for logged in user)
        //Show the member's name (remove the following 3 lines if you don't want to show the name)
        $output .= $auth->getUserInfo('first_name') . " " . $auth->getUserInfo('last_name');
        //Show a link to the profile edit page (remove the following 3 lines if you don't want to show a edit profile link)
        $output .= ' | ';
        $edit_profile_page = $emember_config->getValue('eMember_profile_edit_page');
        $output .= '<a href="' . $edit_profile_page . '">' . EMEMBER_EDIT_PROFILE . '</a>';
        //Show a logout link (remove the following 3 lines if you don't want to show a logout link)
        $logout = get_logout_url();
        $output .= ' | ';
        $output .= '<a href="' . $logout . '">' . EMEMBER_LOGOUT . '</a>';
    } else {
        //User is not logged in (show the login prompt)
        //Show a login link
        $login_url = $emember_config->getValue('login_page_url');
        $output .= '<a href="' . $login_url . '">' . EMEMBER_LOGIN . '</a>';
        //Show link to the Join us page
        $output .= EMEMBER_NOT_A_MEMBER_TEXT;
        $join_url = $emember_config->getValue('eMember_payments_page');
        $output .= '<a href="' . $join_url . '">' . EMEMBER_JOIN . '</a>';
    }
    $output .= "</div>";
    //End of "eMember_compact_login_custom" div
    return $output;
}