include "tool-lookupids.php"; if (!isset($slice)) { relative_redirect("home.php"); } if (!$user->isAllowed(SA_ACTION::RENEW_SLICE, CS_CONTEXT_TYPE::SLICE, $slice_id)) { relative_redirect('home.php'); } if (array_key_exists("slice_expiration", $_REQUEST)) { $req_exp = dateUIFormat($_REQUEST["slice_expiration"]); } else { relative_redirect('slice.php?slice_id=' . $slice_id); } if (isset($slice)) { $old_slice_expiration = dateUIFormat($slice[SA_ARGUMENT::EXPIRATION]); } $res = renew_slice($sa_url, $user, $slice_id, $req_exp); //error_log("Renew Slice output = " . $res); if ($res) { // get the new slice expiration $res = "Renewed slice (requested {$req_exp}, was {$old_slice_expiration})"; unset($slice); $slice = lookup_slice($sa_url, $user, $slice_id); $slice_expiration = dateUIFormat($slice[SA_ARGUMENT::EXPIRATION]); } else { $res = "FAILed to renew slice (requested {$req_exp}, was {$old_slice_expiration})"; $slice_expiration = $old_slice_expiration; } $res = $res . " - slice expiration is now: <b>{$slice_expiration}</b>\n"; $header = "Renewed Slice {$slice_name}"; show_header('GENI Portal: Slices'); include "tool-breadcrumbs.php";
$desired_expiration = $project_expiration; } else { // renew for the end of the day $desired_expiration = $desired_expiration . " 23:59:59"; } } } // what to send to the AM(s) $rfc3339_expiration = rfc3339Format($desired_expiration); // what to display to the user $ui_expiration = dateUIFormat($desired_expiration); } else { no_time_error(); } if ($renew_slice) { $res = renew_slice($sa_url, $user, $slice_id, $desired_expiration); //error_log("Renew Slice output = " . $res); if (!$res) { $res = "FAILed to renew slice (requested {$desired_expiration}, was {$old_slice_expiration})"; $slice_expiration = $old_slice_expiration; } else { $renewed_slice = true; // get the new slice expiration $res = "Renewed slice (requested {$desired_expiration}, was {$old_slice_expiration})"; unset($slice); $slice = lookup_slice($sa_url, $user, $slice_id); $slice_expiration = dateUIFormat($slice[SA_ARGUMENT::EXPIRATION]); } $res = $res . " - slice expiration is now: <b>{$slice_expiration}</b>\n"; } if ($renew_sliver and ($renew_slice and $renewed_slice or !$renew_slice)) {