From e14802949c7a66853594ae9d8c297ce666039fed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 16 Oct 2009 10:21:06 +0000 Subject: [PATCH] use ext_consortium_id for pending sites --- planetlab/includes/plc_header.php | 3 +++ planetlab/sites/join_request.php | 7 ++++--- planetlab/sites/site.php | 13 +++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/planetlab/includes/plc_header.php b/planetlab/includes/plc_header.php index c1f67a3..ab710fc 100644 --- a/planetlab/includes/plc_header.php +++ b/planetlab/includes/plc_header.php @@ -11,6 +11,9 @@ require_once 'plc_drupal.php'; +$PENDING_CONSORTIUM_ID = 0; +$APPROVED_CONSORTIUM_ID = 999999; + if (!function_exists('drupal_page_header')) { $title = drupal_get_title(); $head = drupal_get_html_head(); diff --git a/planetlab/sites/join_request.php b/planetlab/sites/join_request.php index 3a5e4e0..0540bf1 100644 --- a/planetlab/sites/join_request.php +++ b/planetlab/sites/join_request.php @@ -24,7 +24,7 @@ include 'site_form.php'; //////////////////////////////////////// function render_all_join_requests($api) { - $sites = $api->GetSites( array("enabled" => False, "peer_id" => NULL)); + $sites = $api->GetSites( array("enabled" => False, "peer_id" => NULL, "ext_consortium_id" => $PENDING_CONSORTIUM_ID)); if (!empty($sites)) { print(""); print(""); @@ -46,7 +46,7 @@ function render_join_request_review($api, $site_id) { return; } $site = $sites[0]; - if ($site['enabled']) { + if ($site['enabled'] && $site['ext_consortium_id'] == $PENDING_CONSORTIUM_ID) { print("

This site is already enabled

"); return; } @@ -76,7 +76,7 @@ function render_join_request_review($api, $site_id) { } $pi_id = $pi['person_id']; $tech_id = $tech['person_id']; - + print <<< EOF

Please review the join request below.

Warning: the PI email address that was provided in this form will not be checked automatically. We expect that as part of the handshake with the site, the support team has had an opportunity to use this address so it can be considered safe. Please check it manually if this is not the case.

@@ -234,6 +234,7 @@ else if ($_POST['submitted'] ) // the PI's email address, which makes the whole thing *a lot* simpler // enable the site, enable the PI, and VerifyPerson the thec if different from the PI $site['enabled'] = True; + $site['ext_consortium_id'] = $APPROVED_CONSORTIUM_ID; $api->UpdateSite ($site_id,$site); $api_error=$api->error(); if (!empty($api_error)) { diff --git a/planetlab/sites/site.php b/planetlab/sites/site.php index d9c5cdb..ef5fe1e 100644 --- a/planetlab/sites/site.php +++ b/planetlab/sites/site.php @@ -150,10 +150,15 @@ plekit_linetabs($tabs); // show gray background on foreign objects : start a
with proper class $peers->block_start ($peer_id); -if ( $local_peer && ( ! $enabled ) ) - plc_warning ("This site is not enabled - Please visit " . - href (l_sites_pending(),"this page") . - " to review pending applications."); +if ( $local_peer && ( ! $enabled ) ) { + if ($site['ext_consortium_id'] == $PENDING_CONSORTIUM_ID) { + plc_warning ("This site is not enabled - Please visit " . + href (l_sites_pending(),"this page") . + " to review pending applications."); + } else { + plc_warning ("This site is disabled."); + } +} $can_update=(plc_is_admin () && $local_peer) || ( plc_in_site($site_id) && plc_is_pi()); -- 2.43.0
Site Namesite_idSubmitted