use ext_consortium_id for pending sites
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 16 Oct 2009 10:21:06 +0000 (10:21 +0000)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 16 Oct 2009 10:21:06 +0000 (10:21 +0000)
planetlab/includes/plc_header.php
planetlab/sites/join_request.php
planetlab/sites/site.php

index c1f67a3..ab710fc 100644 (file)
@@ -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();
index 3a5e4e0..0540bf1 100644 (file)
@@ -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("<table width=100%>");
     print("<tr><th>Site Name</th><th>site_id</th><th>Submitted</th></tr>");
@@ -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("<p class='plc-warning'> This site is already enabled </p>");
     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
 <p> Please review the join request below.</p>
     <p> <b> Warning:</b> the PI email address that was provided in this form will <b> not be checked</b> 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.</p>
@@ -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)) {
index d9c5cdb..ef5fe1e 100644 (file)
@@ -150,10 +150,15 @@ plekit_linetabs($tabs);
 // show gray background on foreign objects : start a <div> 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());