本文整理汇总了PHP中relative_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP relative_redirect函数的具体用法?PHP relative_redirect怎么用?PHP relative_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了relative_redirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: no_time_error
function no_time_error()
{
relative_redirect("error-text.php?error=" . urlencode("No new sliver expiration time specified."));
// header('HTTP/1.1 404 Not Found');
// print 'No expiration time specified.';
exit;
}
示例2: check_km_authorization
function check_km_authorization($user)
{
global $NO_AUTHZ_REDIRECT;
if (isset($NO_AUTHZ_REDIRECT) && $NO_AUTHZ_REDIRECT) {
return;
}
if (!$user->portalIsAuthorized()) {
$request_uri = $_SERVER['REQUEST_URI'];
// $km_url = get_first_service_of_type(SR_SERVICE_TYPE::KEY_MANAGER);
relative_redirect("kmhome.php");
}
}
示例3: relative_redirect
// included in all copies or substantial portions of the Work.
//
// THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS
// IN THE WORK.
//----------------------------------------------------------------------
require_once "user.php";
require_once 'portal.php';
require_once 'cs_constants.php';
require_once 'maintenance_mode.php';
relative_redirect("dashboard.php");
// include("tool-showmessage.php");
// if (is_null($user)) {
// // TODO: Handle unknown state
// print "Unable to load user record.<br/>";
// } else {
// if ($user->isRequested()) {
// include("home-requested.php");
// } else if ($user->isDisabled()) {
// print "User $user->eppn has been disabled.";
// } else if ($user->isActive()) {
// include("home-active.php");
// } else {
// // TODO: Handle unknown state
// print "Unknown account state: $user->status<br/>";
// }
示例4: ma_lookup_certificate
maybe HTTP redirect there if this key exists in the session.
*/
$result = ma_lookup_certificate($ma_url, $km_signer, $member_id);
if (!is_null($result) && key_exists(MA_ARGUMENT::PRIVATE_KEY, $result)) {
/* If the user has an outside certificate AND key, redirect back to the
certificate loading page.
*/
$loc = $_SESSION['xml-signer'];
unset($_SESSION['xml-signer']);
relative_redirect($loc);
exit;
}
}
/* Auto-redirect to KM activate page if there's no member id. */
if (!isset($member_id)) {
relative_redirect("kmactivate.php");
exit;
}
$result = ma_lookup_certificate($ma_url, $km_signer, $member_id);
$has_cert = !is_null($result);
// Has the certificate expired?
$expired = false;
// Will the certificate expire soon?
$expiring = false;
if ($has_cert && array_key_exists('expiration', $result)) {
// Is expiration real soon or in the past?
$expiration = $result['expiration'];
$now = new DateTime('now', new DateTimeZone("UTC"));
$diff = $now->diff($expiration);
$days = $diff->days;
$expired = $days < 1;
示例5: geni_loadUser
//----------------------------------------------------------------------
require_once "settings.php";
require_once "util.php";
require_once "user.php";
require_once "pa_constants.php";
require_once "cs_client.php";
require_once "cs_constants.php";
require_once 'logging_client.php';
require_once 'logging_constants.php';
require_once 'ma_client.php';
require_once 'ma_constants.php';
require_once "db_utils.php";
include_once '/etc/geni-ch/settings.php';
$user = geni_loadUser();
if (!isset($user) || !$user->isActive()) {
relative_redirect("home.php");
}
$sr_url = get_sr_url();
$ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
$log_url = get_first_service_of_type(SR_SERVICE_TYPE::LOGGING_SERVICE);
/*
* Pull info from the $_REQUEST
*/
$form_name = 'name';
$form_telephone = 'telephone';
$form_reference = 'reference';
$form_url = 'url';
$form_reason = 'reason';
$form_projectlead = 'projectlead';
function from_request($key)
{
示例6: sa_create_slice
}
// Do we have all the required params?
if ($slice_name) {
// Create the slice...
$result = sa_create_slice($user, $slice_name, $project_id, $project_name, $slice_description);
if (!$result) {
error_log("Create Slice failed for slice {$slice_name}");
$_SESSION['lasterror'] = "Slice creation failed for slice {$slice_name}";
relative_redirect('home.php');
} else {
/* $pretty_result = print_r($result, true); */
/* error_log("sa_create_slice result: $pretty_result\n"); */
// Redirect to this slice's page now...
$slice_id = $result[SA_SLICE_TABLE_FIELDNAME::SLICE_ID];
$_SESSION['lastmessage'] = "Created slice {$slice_name}";
relative_redirect('slice.php?slice_id=' . $slice_id);
}
}
// else if came from the createslice page then print an error or something
// If here, present the form
require_once "header.php";
show_header('GENI Portal: Slices');
if ($message) {
print "<i>" . $message . "</i>\n";
}
if ($show_breadcrumbs) {
include "tool-breadcrumbs.php";
}
include "tool-showmessage.php";
print "<h1>Create New Slice</h1>\n";
print "<p>A GENI slice is a container for reserving and managing a set of GENI resources.</p>\n";
示例7: add_project_member
if (!is_null($yesm)) {
$reason = $yesm;
}
}
// This is an 'add' selection
// Add member
add_project_member($sa_url, $user, $project_id, $member_id, $role);
// I _believe_ we'll have been redirected to the error page if the add fails
// and send acceptance letter
}
// Resolve pending request
resolve_pending_request($sa_url, $user, CS_CONTEXT_TYPE::PROJECT, $request_id, $resolution_status, $resolution_description);
// FIXME: Do not send the rejection mail if the user is already in the project - ticket #410
// FIXME: Allow the person rejecting your join request to edit/specify the email contents, so they can explain the rejection
// -- ticket #876
// Send acceptance/rejection letter
$hostname = $_SERVER['SERVER_NAME'];
$email_message = "Your request to join GENI project " . $project_name . " has been " . $resolution_status_label . " by " . $user->prettyName() . ".\n\n";
if (isset($reason) && $reason != '') {
$email_message = $email_message . "\n{$reason}\n\n";
}
$email_message = $email_message . "GENI Portal Operations";
$headers = "Cc: " . $user->prettyEmailAddress() . "\r\nContent-Type: text/plain; charset=UTF-8\r\nContent-Transfer-Encoding: 8bit";
mail($email_address, $email_subject, $email_message, $headers);
}
// end of loop over rows to process
$_SESSION['lastmessage'] = "Added {$num_members_added} members; Rejected {$num_members_rejected} members";
relative_redirect("project.php?project_id=" . $project_id);
?>
示例8: add_reply_to_post
// Display errors
echo "<p>There were some problems with your form. Please go back and try again.</p><br /><br />";
// Display error messages
echo "<ul>\n";
for ($i = 0; $i < count($errors); $i++) {
echo "<li>" . $errors[$i] . "</li>";
}
echo "</ul>";
} else {
// Post comment
// Determine whether it's supposed to post a reply to a post or a comment
if ($_POST['parentType'] == "post") {
$commentid = add_reply_to_post($user_id, $_POST['parentID'], $_POST['replyContent']);
$post = get_post($_POST['parentID']);
$postid = $post['id'];
} else {
if ($_POST['parentType'] == "comment") {
$commentid = add_reply_to_comment($user_id, $_POST['parentID'], $_POST['replyContent']);
$comment = get_comment($_POST['parentID']);
$postid = $comment['postparent'];
}
}
echo "Post successful!";
//$domain = $_SERVER['HTTP_HOST'];
//header("Location: http://$domain/govit/viewpost.php?postid=$postid&commentid=$commentid#$commentid");
//exit();
relative_redirect("viewpost?postid={$postid}&commentid={$commentid}#{$commentid}");
}
require_once "footer.php";
ob_flush();
//for redirect
示例9: create_sliver_success
function create_sliver_success($link, $full_link)
{
global $background;
if ($background) {
show_page_header();
$string = "<p class='instruction'>Resource request submitted. If you are ";
$string .= "not automatically redirected, <a href='{$full_link}'>click here</a> ";
$string .= "to view request progress and results.</p>";
echo $string;
include "footer.php";
ob_end_clean();
print_r($link);
} else {
// FIXME: We probably want to redirect the user as
// quickly as possible, but
// is this the best way of doing it?
relative_redirect($link);
exit;
}
}
示例10: file_get_contents
if ($error != NULL) {
echo "<div id=\"error-message\"" . " style=\"background: #dddddd;font-weight: bold\">\n";
echo "{$error}";
echo "</div>\n";
}
include 'uploadsshkey.html';
// show button only if there are no SSH keys on file
// don't let user generate public/private keypair if
// they already have 1+ public keys on file
$keys = $user->sshKeys();
if (count($keys) == 0) {
echo "<p>If you don't have an SSH keypair or want to create a new SSH keypair, <button onClick=\"window.location='generatesshkey.php'\">generate and download an SSH keypair</button>.</p>";
}
include "footer.php";
exit;
}
// The public key is in $_FILES["file"]["tmp_name"]
$contents = file_get_contents($_FILES["file"]["tmp_name"]);
$filename = $_FILES["file"]["name"];
$description = NULL;
if (array_key_exists("description", $_POST)) {
$description = $_POST["description"];
}
$ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
register_ssh_key($ma_url, $user, $user->account_id, $filename, $description, $contents);
$_SESSION['lastmessage'] = "Uploaded SSH public key from " . $_FILES["file"]["name"];
relative_redirect('profile');
?>
Your key was uploaded.<br/>
<a href="profile.php">My Profile page</a>
示例11: strtolower
return;
}
if ($in_maintenance_mode) {
print "This GENI Clearinghouse is currently in maintenance mode and cannot register new users.";
print "<br>";
print "<button onClick=\"history.back(-1)\"><b>Back</b></button>";
return;
}
// 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");
}
示例12: geni_loadUser
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and/or hardware specification (the "Work") to
// deal in the Work without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Work, and to permit persons to whom the Work
// is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Work.
//
// THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS
// IN THE WORK.
//----------------------------------------------------------------------
require_once "user.php";
require_once "header.php";
$user = geni_loadUser();
if (!isset($user) || !$user->isActive()) {
relative_redirect("home.php");
}
include "tool-lookupids.php";
show_header('GENI Portal: Projects');
// FIXME do real stuff here!
relative_redirect('project.php?project_id=' . $project_id);
include "footer.php";
示例13: header
}
if (!isset($slice_urn)) {
header('HTTP/1.1 404 Not Found');
print 'No slice id specified.';
exit;
}
if (isset($slice_expired) && convert_boolean($slice_expired)) {
if (!isset($slice_name)) {
$slice_name = "";
}
$_SESSION['lasterror'] = "Slice " . $slice_name . " is expired.";
relative_redirect('dashboard.php#slices');
}
$keys = $user->sshKeys();
if (count($keys) == 0) {
relative_redirect("error-text.php?error=" . urlencode("No SSH keys " . "have been uploaded. Please <a href='uploadsshkey.php'>" . "Upload an SSH key</a> or <a href='generatesshkey.php'>Generate and Download an " . "SSH keypair</a> to enable access to nodes."));
}
/* Get the SA and CH URLs. These are really the PGCH URLs because
* Flack speaks the ProtoGENI Slice Authority and Clearinghouse APIs.
*
* If Flack is changed to support the Common Federation API these URLs
* will change.
*/
$pgchs = get_services_of_type(SR_SERVICE_TYPE::PGCH);
if (count($pgchs) != 1) {
error_log("flack must have exactly one PGCH service defined");
return "Should be exactly one PGCH url.";
} else {
$pgch = $pgchs[0];
$PGCH_URL = $pgch[SR_TABLE_FIELDNAME::SERVICE_URL];
}
示例14: geni_loadUser
// IN THE WORK.
//----------------------------------------------------------------------
require_once "user.php";
require_once "header.php";
require_once 'sr_constants.php';
require_once 'sr_client.php';
require_once 'sa_constants.php';
require_once 'sa_client.php';
$user = geni_loadUser();
if (!isset($user) || is_null($user) || !$user->isActive()) {
relative_redirect('home.php');
}
include "tool-lookupids.php";
if (isset($slice) && !is_null($slice)) {
// FIXME: Do anything to slices first? Members?
$result = "Disable Slice Not Implemented";
error_log("Disable Slice not implemented");
// $result = delete_slice($sa_url, $slice_id);
// if (! $result) {
// error_log("Failed to Disable slice $slice_id: $result");
// }
} else {
error_log("Didnt find to disable slice {$slice_id}");
}
// FIXME: remove the slice from the DB
// Invalidate credentials?
// FIXME
$_SESSION['lastmessage'] = "Asked to disable slice {$slice_name} - NOT IMPLEMENTED";
show_header('GENI Portal: Slices');
relative_redirect('dashboard.php#slices');
include "footer.php";
示例15: default_put_message_result_handler
function default_put_message_result_handler($result)
{
// error_log("Decoded raw result : " . $result);
// error_log("MH.RESULT = " . print_r($result, true));
if ($result[RESPONSE_ARGUMENT::CODE] != RESPONSE_ERROR::NONE) {
error_log("SCRIPT_NAME = " . $_SERVER['SCRIPT_NAME']);
error_log("ERROR.CODE " . print_r($result[RESPONSE_ARGUMENT::CODE], true));
error_log("ERROR.VALUE " . print_r($result[RESPONSE_ARGUMENT::VALUE], true));
error_log("ERROR.OUTPUT " . print_r($result[RESPONSE_ARGUMENT::OUTPUT], true));
relative_redirect('error-text.php' . "?error=" . urlencode($result[RESPONSE_ARGUMENT::OUTPUT]));
}
// error_log("ERROR.OUTPUT " . print_r($result[RESPONSE_ARGUMENT::OUTPUT], true));
return $result[RESPONSE_ARGUMENT::VALUE];
}