Ejemplo n.º 1
0
function geni_load_user_by_eppn($eppn, $sfcred)
{
    $ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
    //  $attrs = array('eppn' => $eppn);
    $signer = Portal::getInstance($sfcred);
    $member = ma_lookup_member_by_eppn($ma_url, $signer, $eppn);
    //error_log("MEMBER = " . print_r($member, True));
    if (is_null($member)) {
        // New identity, go to activation page
        relative_redirect("kmactivate.php");
    }
    $user = new GeniUser();
    $user->init_from_member($member);
    $user->sfcred = $sfcred;
    if (!$sfcred && !$user->portalIsAuthorized()) {
        // Portal is not authorized (no inside certificate)
        // and no speaks-for cred has been supplied.
        relative_redirect("kmhome.php");
    }
    return $user;
}
Ejemplo n.º 2
0
}
// Get the EPPN now that we know it's there.
$eppn = strtolower($_SERVER['eppn']);
// If no email address and no preasserted email
//    Then redirect to kmnoemail.php
if (!key_exists('mail', $_SERVER)) {
    $asserted_attrs = get_asserted_attributes($eppn);
    if (!key_exists('mail', $asserted_attrs)) {
        relative_redirect('kmnoemail.php');
    }
}
// Avoid double registration by checking if this is a valid
// user before displaying the page. If this user is already
// registered, redirect to the home page.
$ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
$member = ma_lookup_member_by_eppn($ma_url, Portal::getInstance(), $eppn);
//$attrs = array('eppn' => $eppn);
//$ma_members = ma_lookup_members($ma_url, Portal::getInstance(), $attrs);
//$count = count($ma_members);
//if ($count !== 0) {
if (!is_null($member)) {
    // Existing account, go to home page or to referer
    redirect_referer("kmhome.php");
}
include "kmheader.php";
print "<h2> GENI Account Activation Page </h2>\n";
include "tool-showmessage.php";
?>

<br/>
In order to activate your GENI account, you must first agree to GENI