Пример #1
0
        $member_name = $member_user->prettyName();
        $member_email = $member_user->email();
        $member_role_index = $member['role'];
        $member_role = $CS_ATTRIBUTE_TYPE_NAME[$member_role_index];
        $row = "<tr>";
        $row .= "<td><a href=\"project-member.php?project_id={$project_id}&member_id={$member_id}\">{$member_name}</a></td>";
        $row .= "<td>{$member_role}</td>";
        $row .= "<td><a href=\"mailto:{$member_email}\">{$member_email}</a></td>";
        $row .= "</tr>";
        print $row;
    }
    print "</table>\n";
    $edit_url = relative_url("edit-project-member.php?project_id={$project_id}");
    print "<p><button onClick=\"window.location='{$edit_url}'\">";
    print "<b>Edit Membership</b></button>\n";
    $inv_url = relative_url("invite-to-project.php?project_id={$project_id}");
    print " <button onClick=\"window.location='{$inv_url}'\">";
    print "<b>Invite New Project Members</b></button><br/>\n";
}
print "</p>\n";
if ($isnew) {
    print "<p><b>Project Lead</b></p>\n";
    print "<p>There is exactly one project lead for each project. Project leads are ultimately responsible for all activity in all slices in their project, and may be contacted by GENI operations in the event of a problem.</p>\n";
    print "<p>You will be the project lead on your new project. The name of the project lead is public.</p>\n";
    print "<input type=\"hidden\" name=\"newlead\" value=\"" . $user->account_id . "\"/>\n";
} else {
    //   print "Project lead is: <b>$leadname</b><br/>\n";
    //   print "<p style=\"color: grey\">\n";
    //   print "To transfer project leads, enter email of proposed new project leads to ask them to take over:<br/>\n";
    //   print "<input type=\"text\" name=\"newlead\" disabled=\"disabled\"/></p><br/>\n";
}
     continue;
     //  relative_redirect('error-text.php?error=' . urlencode("Request was " . $status));
 }
 $req_member_id = $request[RQ_REQUEST_TABLE_FIELDNAME::REQUESTOR];
 if ($req_member_id != $member_id) {
     error_log("do-handle-proj-request: request {$request_id} member {$req_member_id} for diff member than {$member_id} expected");
     continue;
 }
 if ($request[RQ_REQUEST_TABLE_FIELDNAME::REQUEST_TYPE] != RQ_REQUEST_TYPE::JOIN) {
     error_log("do-handle-proj-request: request {$request_id} is not a project join request");
     continue;
 }
 // FIXME: Get a pretty member name here for the email message
 // error_log("Email " . $email_address . " Attribs " . print_r($attribs, true));
 $resolution_status = RQ_REQUEST_STATUS::APPROVED;
 $resolution_status_label = "approved (see " . relative_url("project.php?project_id=" . $project_id) . ")";
 $resolution_description = "";
 $email_subject = "Request to join GENI project {$project_name}";
 //  $email_subject = "GENI Request " . print_r($request_id, true) .
 //    " to join project " . $project_name;
 if ($role <= 0) {
     // This is a 'do not add' selection
     // Send rejection letter
     // FIXME: Allow custom deny letter
     $num_members_rejected = $num_members_rejected + 1;
     $resolution_description = "Request rejected";
     $resolution_status_label = "rejected";
     $resolution_status = RQ_REQUEST_STATUS::REJECTED;
     if (array_key_exists('nomessage', $_REQUEST)) {
         $nom = $_REQUEST['nomessage'];
         if (!is_null($nom)) {
Пример #3
0
/*
    STEP 3: CALL AM CLIENT
    Call create_sliver() in am_client.php and get a return code back.
    $retVal is non-null if successful, null if failed
*/
$retVal = create_sliver($am_urls, $user, $slice_users, $slice_credential, $slice_urn, $omni_invocation_dir, $slice['slice_id'], $bound_rspec, $stitch_rspec);
if ($retVal and $retVal != "Invalid AM URL" and $retVal != "Missing AM URL" and $retVal != "Missing slice credential") {
    // Really we want to come here if we spawned the process OK only
    // Set up link to results page
    $invoke_id = get_invocation_id_from_dir($omni_invocation_dir);
    $link = "sliceresource.php?invocation_user="******"&invocation_id={$invoke_id}&slice_id={$slice_id}";
    // if am_id specified, append it to link
    if (isset($am_id) && $am_id) {
        $link .= "&am_id={$am_id}";
    }
    $full_link = relative_url($link);
    // Write URL to 'Recent slice events' log
    $log_url = get_first_service_of_type(SR_SERVICE_TYPE::LOGGING_SERVICE);
    $project_attributes = get_attribute_for_context(CS_CONTEXT_TYPE::PROJECT, $slice['project_id']);
    $slice_attributes = get_attribute_for_context(CS_CONTEXT_TYPE::SLICE, $slice['slice_id']);
    $log_attributes = array_merge($project_attributes, $slice_attributes);
    if ($stitch_rspec) {
        log_event($log_url, $user, "Add resource request submitted for slice " . $slice_name . " from " . "stitching RSpec.<br><a href='{$full_link}'>Click here</a> for results.", $log_attributes);
    } else {
        log_event($log_url, $user, "Add resource request submitted for slice " . $slice_name . " at " . implode(", ", $am_names) . ".<br><a href='{$full_link}'>Click here</a> for results.", $log_attributes);
    }
    // Do redirection
    create_sliver_success($link, $full_link);
} else {
    $msg = "Failed to start an <tt>omni</tt> process.";
    if ($retVal == "Invalid AM URL" or $retVal == "Missing AM URL" or $retVal == "Missing slice credential") {
Пример #4
0
        $slice_name = "";
    }
    $_SESSION['lasterror'] = "Slice " . $slice_name . " is expired.";
    relative_redirect('dashboard.php#slices');
}
if (!$user->isAllowed(SA_ACTION::GET_SLICE_CREDENTIAL, CS_CONTEXT_TYPE::SLICE, $slice_id)) {
    relative_redirect('home.php');
}
// TODO: Pass expiration to slicecred.py
$outside_key = db_fetch_outside_private_key_cert($user->account_id);
if (!$outside_key) {
    include "header.php";
    show_header('GENI Portal: Slices');
    include "tool-breadcrumbs.php";
    print "<h2>Cannot Download Slice Credential</h2>\n";
    print "This page allows you to download a slice credential file," . " for use in other tools (e.g. Omni).\n" . "This is advanced functionality, not required for typical GENI users.\n" . "Please" . " <button onClick=\"window.location='" . relative_url("downloadkeycert.php") . "'\">Download your key and certificate</button>" . " so that a credential can be retrieved.";
    include "footer.php";
    exit;
}
// Get the slice credential from the SA using the outside certificate
$slice_credential = get_slice_credential($sa_url, $user, $slice_id, $outside_key['certificate']);
// FIXME: slice name only unique within project. Need slice URN?
/* FIXME COMMENT: The URN would suck as part of a filename. Too many
 *                special characters.
 */
$cred_filename = $slice_name . "-cred.xml";
// Set headers for download
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename={$cred_filename}");
header("Content-Type: text/xml");
Пример #5
0
$unexpired_slice_owner_names = array();
if (count($unexpired_slices) > 0) {
    $unexpired_slice_owner_names = lookup_member_names_for_rows($ma_url, $user, $unexpired_slices, SA_SLICE_TABLE_FIELDNAME::OWNER_ID);
}
$expired_slice_owner_names = array();
if (count($expired_slices) > 0) {
    $expired_slice_owner_names = lookup_member_names_for_rows($ma_url, $user, $expired_slices, SA_SLICE_TABLE_FIELDNAME::OWNER_ID);
}
$my_slice_objects = $unexpired_slices;
$slice_owner_names = $unexpired_slice_owner_names;
if (count($my_slice_objects) > 0) {
    $base_url = relative_url("slicecred.php?");
    $slice_base_url = relative_url("slice.php?");
    $listres_base_url = relative_url("listresources.php?");
    $resource_base_url = relative_url("slice-add-resources-jacks.php?");
    $delete_sliver_base_url = relative_url("confirm-sliverdelete.php?");
    //separate slices for which $user is lead
    $lead_slices = array();
    $nonlead_slices = array();
    foreach ($my_slice_objects as $slice) {
        if ($slice['owner_id'] === $user->account_id) {
            $lead_slices[] = $slice;
        } else {
            $nonlead_slices[] = $slice;
        }
    }
    function cmp($a, $b)
    {
        return strcmp(strtolower($a['slice_name']), strtolower($b['slice_name']));
    }
    usort($lead_slices, "cmp");
Пример #6
0
function show_header($title, $load_user = 1, $show_cards = false)
{
    global $in_maintenance_mode;
    global $in_lockdown_mode;
    global $has_maintenance_alert;
    global $maintenance_alert;
    global $user;
    if ($load_user) {
        global $user;
        if (!isset($user)) {
            $user = geni_loadUser();
        }
        check_km_authorization($user);
        record_last_seen($user, $_SERVER['REQUEST_URI']);
    }
    show_html_head($title);
    echo '<body>';
    echo '<script>';
    // For header interactivity
    echo '$(document).ready(function(){';
    echo '$(".has-sub").hover(function(){ $(this).find(\'ul\').show(); }, function(){ $(this).find(\'ul\').hide(); });';
    echo '$("#hamburger").click(function(){';
    echo '$("#dashboardtools").slideToggle();';
    echo '});';
    echo '});';
    echo '</script>';
    echo '<div id="dashboardheader">';
    echo '<img id="globe" src="/images/geni_globe.png" alt="Geni Logo" style="height:45px; margin-left: 20px; float: left;"/>';
    echo '<img id="hamburger" src="/images/menu.png" alt="optionsicon" style="height:20px; width: 20px; padding:15px; float: left;"/>';
    echo '<h2 class="dashtext" style="float: left; line-height: 50px; text-align: center; margin: 0 20px; display: inline; height: 50px; cursor: pointer;" 
          onclick="window.location=\'dashboard.php\'">GENI Portal</h2>';
    echo '<ul id="dashboardtools" class="floatright" style="vertical-align: top;">';
    if ($load_user) {
        echo "<li class='has-sub headerlink'>{$user->prettyName()}";
    } else {
        echo "<li class='has-sub headerlink'>User";
    }
    echo '<ul class="submenu">';
    echo '<li><a href="profile.php">Profile</a></li>';
    echo '<li><a href="profile.php#ssh">SSH Keys</a></li>';
    echo '<li><a href="profile.php#rspecs">RSpecs</a></li>';
    echo '<li><a href="profile.php#tools">Manage Accounts</a></li>';
    echo '<li><a href="profile.php#preferences">Preferences</a></li>';
    echo '<li><a href="' . relative_url("dologout.php") . '" >Logout</a></li>';
    if ($load_user && $user->isAllowed(CS_ACTION::ADMINISTER_MEMBERS, CS_CONTEXT_TYPE::MEMBER, null)) {
        echo '<li><a href="admin.php">Admin</a></li>';
    }
    echo '</ul></li>';
    echo '<li class="headerlink has-sub"><a href="help.php">Help</a>';
    echo '<ul class="submenu">';
    echo '<li><a target="_blank" href="http://groups.geni.net/geni/wiki">GENI Wiki <i class="material-icons">launch</i></a></li>';
    echo '<li><a target="_blank" href="http://groups.geni.net/geni/wiki/GENIExperimenter/GetHelp">GENI Help Wiki <i class="material-icons">launch</i></a></li>';
    echo '<li><a target="_blank" href="http://gmoc.grnoc.iu.edu/gmoc/index/support/gmoc-operations-calendars.html">Outages <i class="material-icons">launch</i> </a></li>';
    echo '<li><a target="_blank" href="http://groups.geni.net/geni/wiki/GENIGlossary">Glossary <i class="material-icons">launch</i></a></li>';
    echo '<li><a target="_blank" href="http://groups.geni.net/geni/wiki/GENIBibliography">Bibliography<i class="material-icons">launch</i></a></li>';
    echo '<li><a href="contact-us.php">Contact Us</a></li>';
    echo '</ul></li>';
    if ($load_user) {
        if (!isset($jfed_button_start)) {
            $jfedret = get_jfed_strs($user);
            $jfed_script_text = $jfedret[0];
            $jfed_button_start = $jfedret[1];
            $jfed_button_part2 = $jfedret[2];
            if (!is_null($jfed_button_start)) {
                print $jfed_script_text;
            }
        }
    }
    echo '<li class="headerlink has-sub">Partners';
    echo '<ul class="submenu">';
    echo "<li><a href='https://www.cloudlab.us/login.php' target='_blank'>CloudLab <i class='material-icons'>launch</i></a></li>";
    echo "<li><a href='http://gee-project.org/user' target='_blank'>GEE <i class='material-icons'>launch</i></a></li>";
    echo "<li><a href='wireless_redirect.php?site=ORBIT' target='_blank'>ORBIT<i class='material-icons'>launch</i></a></li>";
    echo "<li><a href='http://portal.savitestbed.ca/auth/login' target='_blank'>SAVI<i class='material-icons'>launch</i></a></li>";
    echo "<li><a href='wireless_redirect.php?site=WITEST' target='_blank'>WiTest<i class='material-icons'>launch</i></a></li>";
    echo '</ul></li>';
    echo '<li class="headerlink has-sub">Tools';
    echo '<ul class="submenu">';
    echo "<li><a href='gemini.php' target='_blank'>GENI Desktop<i class='material-icons'>launch</i></a></li>";
    if ($load_user && !is_null($jfed_button_start)) {
        echo "<li>";
        echo $jfed_button_start . getjFedSliceScript(NULL) . $jfed_button_part2 . ">jFed<i class='material-icons'>launch</i></button>";
        echo "</li>";
    }
    echo "<li><a href='http://labwiki.casa.umass.edu' target='_blank'>LabWiki <i class='material-icons'>launch</i></a></li>";
    echo "<li><a href='http://groups.geni.net/geni/wiki/GENIExperimenter/Tools' target='_blank' title='Omni, Geni-lib, VTS...'>Other Tools <i class='material-icons'>launch</i></a></li>";
    echo '</ul></li>';
    echo '<li class="headerlink has-sub"><a href="dashboard.php">Home</a>';
    echo '<ul class="submenu">';
    echo '<li><a href="dashboard.php#slices">Slices</a></li>';
    echo '<li><a href="dashboard.php#projects">Projects</a></li>';
    echo '</ul></li></ul>';
    echo '</div>';
    $cards_class = $show_cards ? 'content-cards' : 'one-card';
    echo '<div style="clear:both; height: 50px;">&nbsp;</div>';
    if ($in_maintenance_mode) {
        echo "<center><b>***** Maintenance Outage *****</b></center>";
    }
    if ($has_maintenance_alert) {
        print "<p class='instruction' id='maintenance_alert'>{$maintenance_alert}</p>";
    }
    echo "<div id='content-outer' class='{$cards_class}'>";
    echo "<div id='content'>";
}
Пример #7
0
} else {
    // User has requested edit
    show_header('GENI Portal: Profile');
    include "tool-breadcrumbs.php";
    print "<h1>Edit SSH Key</h1>";
    if (array_key_exists('id', $_REQUEST)) {
        $ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
        $ssh_keys = lookup_private_ssh_keys($ma_url, $user, $user->account_id);
        $ssh_key = NULL;
        foreach ($ssh_keys as $one_key) {
            if ($one_key['id'] == $_REQUEST['id']) {
                $ssh_key = $one_key;
            }
        }
        if ($ssh_key != NULL && array_key_exists('HTTP_REFERER', $_SERVER)) {
            $cancel_dest = $_SERVER['HTTP_REFERER'];
        } else {
            // If no referer, go to home page on cancel.
            $cancel_dest = relative_url('profile.php');
        }
        show_ssh_edit_form($ssh_key, $cancel_dest);
        js_delete_ssh_key();
        $delete_sshkey_url = relative_url('deletesshkey.php?');
        $args['id'] = $ssh_key['id'];
        $query = http_build_query($args);
        print "<br/><br/>You can ";
        print "<button onClick=\"deleteSshKey('" . $delete_sshkey_url . $query . "')\">delete</button>";
        print " this key if you are sure you no longer want to use it.";
    }
    include "footer.php";
}
Пример #8
0
    }
}
/*
 * If we weren't given a file but we're in update  mode (not upload a new rspec mode), there is no error
 */
if ($rspec_id != "" && $errorcode == UPLOAD_ERR_NO_FILE) {
    $error = NULL;
}
/* Set up the referer, which is used to
 * redirect after upload.
 */
$referer_key = 'HTTP_REFERER';
if (array_key_exists($referer_key, $_SERVER)) {
    $referer = $_SERVER['HTTP_REFERER'];
} else {
    $referer = relative_url('profile.php');
}
if ($error != NULL || count($_POST) == 0) {
    // Display the form and exit
    show_header('GENI Portal: Profile', 0);
    // 0=Don't load user to show header
    include "tool-breadcrumbs.php";
    include "tool-showmessage.php";
    $msg = "Upload experiment Resource Specification (RSpec)";
    if ($rspec_id != "") {
        $msg = "Update experiment Resource Specification (RSpec)";
    }
    print "<h1 style=\"line-height: 1.2em\">{$msg}</h1>\n";
    if ($error != NULL) {
        echo "<div id=\"error-message\"" . " style=\"background: #dddddd;font-weight: bold\">\n";
        echo "{$error}";
        return null;
    } else {
        return $relative_url;
    }
}
if (isset($_REQUEST["operation"]) && $_REQUEST["operation"] == 'login') {
    //
    //	Log in ajax handler
    //
    $r = authentication_user($_REQUEST, $conn);
    echo $r;
} else {
    if (isset($_REQUEST["signout"])) {
        //
        //	Sign out ajax handler
        //
        sign_out_user($_SESSION["email"], $conn);
        echo relative_url("home.php");
    } else {
        if (isset($_REQUEST["operation"]) && $_REQUEST["operation"] == 'register') {
            //
            //	Register new user
            //
            $r = register_new_user($_REQUEST, $conn);
            echo $r;
        } else {
            echo "fail";
        }
    }
}
mysql_close($conn);
Пример #10
0
function relative_redirect($relpath)
{
    $url = relative_url($relpath);
    header("Location: {$url}");
    exit;
}
Пример #11
0
?>
</table>

<?php 
$edit_members_disabled = "";
if (!$user->isAllowed(PA_ACTION::ADD_PROJECT_MEMBER, CS_CONTEXT_TYPE::PROJECT, $project_id) || $expired) {
    $edit_members_disabled = $disabled;
}
echo "<p><button {$edit_members_disabled} onClick=\"window.location='{$edit_project_members_url}'\"><b>Edit Current Project Membership</b></button></p>";
if ($user->isAllowed(PA_ACTION::ADD_PROJECT_MEMBER, CS_CONTEXT_TYPE::PROJECT, $project_id)) {
    $upload_project_members_url = "upload-project-members.php?project_id=" . $project_id;
    print "<h3>Add New Project Members</h3>";
    print "<p><button onClick=\"window.location='{$upload_project_members_url}'\"{$actdisabled}><b>Bulk Add New Members</b></button>";
    //  print "<br/><h3>Invite new project members</h3>\n";
    print " <button onClick=\"window.location='";
    print relative_url("invite-to-project.php?project_id={$project_id}'");
    print "\"{$actdisabled}><b>Invite New Members</b></button></p>\n";
    if (!isset($reqs) || is_null($reqs) || count($reqs) < 1) {
        print "<div class='announce'><p>No outstanding project join requests.</p></div>\n";
    }
}
?>
</div>



<div class='card' id='logs'>
<h2>Recent Project Actions</h2>
<p>Showing logs for the last 
<select onchange="getLogs(this.value);">
  <option value="24">day</option>
Пример #12
0
<h2>Expired Slices</h2>
<?php 
if (isset($expired_slices) && count($expired_slices) > 0) {
    print "\n<table>\n";
    print "<tr><th>Slice Name</th>";
    print "<th>Project</th>";
    print "<th>Slice Creation</th>";
    print "<th>Slice Expiration</th>";
    print "<th>Slice Owner</th>";
    print "</tr>\n";
    $base_url = relative_url("slicecred.php?");
    $slice_base_url = relative_url("slice.php?");
    $listres_base_url = relative_url("listresources.php?");
    $resource_base_url = relative_url("slice-add-resources-jacks.php?");
    $delete_sliver_base_url = relative_url("confirm-sliverdelete.php?");
    $flack_url = relative_url("flack.php?");
    $num_slices = count($expired_slices);
    if ($num_slices == 1) {
        print "<p><i>You were a member of <b>1</b> expired slice.</i></p>";
    } else {
        print "<p><i>You were a member of <b>" . $num_slices . "</b> expired slices.</i></p>";
    }
    foreach ($expired_slices as $slice) {
        $slice_id = $slice[SA_SLICE_TABLE_FIELDNAME::SLICE_ID];
        $slice_expired = 'f';
        if (array_key_exists(SA_SLICE_TABLE_FIELDNAME::EXPIRED, $slice)) {
            $slice_expired = $slice[SA_SLICE_TABLE_FIELDNAME::EXPIRED];
        }
        $isSliceExpired = False;
        $disable_buttons_str = "";
        if (isset($slice_expired) && convert_boolean($slice_expired)) {
         * Upload was successful, do some basic checks on the contents.
         */
        /* TODO: do some sort of check on the rspec.
         * Is it valid XML? Does it pass "rspeclint"?
         * Is it a request RSpec (not ad or manifest)?
         */
    }
}
/* Set up the referer, which is used to
 * redirect after upload.
 */
$referer_key = 'HTTP_REFERER';
if (array_key_exists($referer_key, $_SERVER)) {
    $referer = $_SERVER['HTTP_REFERER'];
} else {
    $referer = relative_url("project.php?project_id={$project_id}");
}
//error_log("Error = " . $error);
//error_log("POST = " . print_r($_POST, true));
//error_log("FILES = " . print_r($_FILES, true));
//error_log("PID = " . $project_id);
if ($error != NULL || count($_POST) == 0) {
    echo "<div id=\"error-message\"" . " style=\"background: #dddddd;font-weight: bold\">\n";
    echo "{$error}";
    echo "</div>\n";
    print "<h2>Upload Project Members</h2>";
    print "<p>You can upload a CSV (comma-separated-values) file of candidates members for your project or enter candidate information in the text box below. Use the following format:</p>";
    print "<p>";
    print "Format:</p>";
    print "<pre style='margin-left:80px;'>candidate_email, candidate_name, [optional: role = Admin, Member (default), Auditor]</pre>";
    print "<p>Example:</p>";