start work on nodelist page
smbaker [Fri, 9 Nov 2012 21:25:30 +0000 (13:25 -0800)]
apps/gacksadmin/Makefile
apps/gacksadmin/gacks_functions.php
apps/gacksadmin/user_nodelist.php [new file with mode: 0644]
apps/gacksadmin/vicci.module
apps/gacksadmin/wizard.php

index 12277db..648209b 100644 (file)
@@ -1,6 +1,6 @@
 RPM_DIR = RPMS
 
-GACKS_PHP = accounts.php account.php action.php add_account.php invoices.php reservations.php reservation_set.php nodestatus.php weekly.php wizard.php user_reservations.php user_service_level.php user_confirm_service.php gackstable.php user_add_reservation.php user_persons.php user_summary.php
+GACKS_PHP = accounts.php account.php action.php add_account.php invoices.php reservations.php reservation_set.php nodestatus.php weekly.php wizard.php user_reservations.php user_service_level.php user_confirm_service.php gackstable.php user_add_reservation.php user_persons.php user_summary.php user_nodelist.php
 GACKS_JS = popup.js gackstable.js
 GACKS_MODULE = gacks.module vicci.module
 GACKS_INCLUDE = gacks_functions.php gacksclient.php
index d27cef1..bde8975 100644 (file)
@@ -29,6 +29,7 @@ function l_gacks_all_invoices ()   { return l_gacks_invoice(NULL, NULL, STATE_IN
 function l_gacks_weekly ($y=NULL, $m=NULL, $d=NULL)         { return "/db/gacks/weekly.php?invoiceyear=$y&invoicemonth=$m&invoiceday=$d"; }
 function l_gacks_node_status ()    { return "/db/gacks/nodestatus.php"; }
 function l_gacks_wizard ()         { return "/db/gacks/wizard.php"; }
+function l_gacks_nodelist ()         { return "/db/gacks/user_nodelist.php"; }
 function l_gacks_user_reservations() { return "/db/gacks/user_reservations.php"; }
 function l_gacks_edit($item)       { return "/db/gacks/edit.php"; }
 function l_gacks_delete($item)     { $timeStart=$item['timeStart']; $timeStop=$item['timeStop']; $id=$item['id']; $lastAllocator=end($item['allocatorHRNs']); return "/db/gacks/action.php?action=delete-reservation&timeStart=$timeStart&timeStop=$timeStop&resource_id=$id&lastAllocator=$lastAllocator"; }
diff --git a/apps/gacksadmin/user_nodelist.php b/apps/gacksadmin/user_nodelist.php
new file mode 100644 (file)
index 0000000..cca31ae
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+\r
+// Require login\r
+require_once 'plc_login.php';\r
+\r
+// Get session and API handles\r
+require_once 'plc_session.php';\r
+global $plc, $api, $adm;\r
+\r
+// Common functions\r
+require_once 'plc_functions.php';\r
+require_once 'gacks_functions.php';\r
+require_once 'gacksclient.php';\r
+require_once 'linetabs.php';\r
+require_once 'table.php';\r
+require_once 'details.php';\r
+require_once 'toggle.php';\r
+require_once 'form.php';\r
+\r
+// find person roles\r
+$_person= $plc->person;\r
+$_person_id = $plc->person['person_id'];\r
+$_roles= $_person['role_ids'];
+
+// Print header
+require_once 'plc_drupal.php';\r
+drupal_set_title('Node Wizard');\r
+include 'plc_header.php';
+
+$tabs['Show Nodes'] = array('method'=>'POST',
+                           'url'=>l_gacks_nodelist(),\r
+                           'bubble'=>"Show nodes in your slice");
+
+$tabs['Add Nodes'] = array('method'=>'POST',
+                           'url'=>l_gacks_wizard(),\r
+                           'bubble'=>"Add nodes to your slice");\r
+\r
+plekit_linetabs($tabs);
+
+print "<br>";
+$account_name = get_account_name($api, $_person_id);
+
+if ($account_name != NULL) {
+}
+
+include 'plc_footer.php';
+\r
+?>\r
+
+
index 8435f21..5344c17 100644 (file)
@@ -89,21 +89,24 @@ function vicci_block($op = 'list', $delta = 0, $edit = array()) {
         $bullet_item = href( l_gacks_service_level(), "Service settings");
         $items []= expanded($bullet_item);
 
-        if ($plc_synced) {
+        if (($plc_synced) && (!plc_is_admin()) && (!plc_is_pi())) {
+            // SSO accounts have these pages disabled, unless they're an admin
+            // or a PI.
+
             $bullet_item = href("/planetlab_create_slice","Create new slice");
             $items []= expanded($bullet_item);
 
-            $bullet_item = href("/planetlab_add_users", "Add users to slice");
+            $bullet_item = href("/planetlab_add_users", "Manage Slice Users");
             $items []= expanded($bullet_item);
         } else {
             $bullet_item = href(l_slice_add(),"Create new slice");
             $items []= expanded($bullet_item);
 
-            $bullet_item = href( l_gacks_persons(), "Add users to slice");
+            $bullet_item = href( l_gacks_persons(), "Manage Slice Users");
             $items []= expanded($bullet_item);
         }
 
-        $bullet_item = href( l_gacks_wizard(), "Add nodes to slice");
+        $bullet_item = href( l_gacks_wizard(), "Manage Slice Nodes");
         $items []= expanded($bullet_item);
 
         $bullet_item = href( l_gacks_user_reservations(), "Reserve resources");
index 2c11d38..d6ec71e 100644 (file)
@@ -27,6 +27,16 @@ require_once 'plc_drupal.php';
 drupal_set_title('Node Wizard');\r
 include 'plc_header.php';
 
+$tabs['Show Nodes'] = array('method'=>'POST',
+                           'url'=>l_gacks_nodelist(),\r
+                           'bubble'=>"Show nodes in your slice");
+
+$tabs['Add Nodes'] = array('method'=>'POST',
+                           'url'=>l_gacks_wizard(),\r
+                           'bubble'=>"Add nodes to your slice");\r
+\r
+plekit_linetabs($tabs);
+
 print "<br>";
 $account_name = get_account_name($api, $_person_id);