support for vicci simplified portal
[plewww.git] / modules / planetlab.module
index 080e8b9..3fd2c5b 100644 (file)
@@ -77,9 +77,9 @@ function plc_my_site_links() {
 function plc_my_node_links () {
   $html = '';
   if (count (plc_my_site_ids()) == 1) {
-    $html .= leaf( href (l_nodes_site (plc_my_site_id()),"My Site Nodes"));
+    $html .= leaf( href (l_nodes_my_site() ,"My Site Nodes"));
   } else {
-    $html .= leaf( href (l_nodes_person (plc_my_person_id()),"All My Sites Nodes"));
+    $html .= leaf( href (l_nodes_all_my_site(),"All My Sites Nodes"));
   }
   return $html;
 }
@@ -130,7 +130,7 @@ function planetlab_block($op = 'list', $delta = 0, $edit = array()) {
       $block['content'] .= p( href (l_reset_password(),"Forgot your password?") );
       $block['content'] .= p( href(l_person_register(),"Create an account") );
       $block['content'] .= p( href(l_site_register(),"File a site registration") );
-    } else {
+    } else if (plc_advanced()) {
       $block['subject'] = truncate($plc->person['email'],30);
 
       //////////////////// Logout 
@@ -158,10 +158,10 @@ function planetlab_block($op = 'list', $delta = 0, $edit = array()) {
       $bullet_item .=  l_person_t(plc_my_person_id(),"My Account");
       $bullet_item .= ul_start();
       if (plc_is_admin() || plc_is_pi()) 
-       $bullet_item .= leaf( href( l_persons_site(plc_my_site_id()), "My Users"));
+       $bullet_item .= leaf( href( l_persons_site(plc_my_site_id()), "My Site Accounts"));
       if (plc_is_admin()) {
-       $bullet_item .= leaf(href(l_persons_peer('local'),'Local users (looong)'));
-       $bullet_item .= leaf(href(l_persons(),'All users (looong)'));
+       $bullet_item .= leaf(href(l_persons_peer('local'),'Local Accounts (slow)'));
+       $bullet_item .= leaf(href(l_persons(),'All Accounts (slow)'));
       }
        
       $bullet_item .= ul_end();
@@ -182,7 +182,8 @@ function planetlab_block($op = 'list', $delta = 0, $edit = array()) {
       $bullet_item .= href(l_nodes(),"Nodes");
       $bullet_item .= ul_start();
       $bullet_item .= plc_my_node_links();
-      $bullet_item .= leaf( href (l_register_node(),"Register Node"));
+      if (plc_is_admin() || plc_is_pi() || plc_is_tech()) 
+       $bullet_item .= leaf( href (l_register_node(),"Register Node"));
       $bullet_item .= ul_end();
       $items [] = expanded($bullet_item);
 
@@ -196,7 +197,7 @@ function planetlab_block($op = 'list', $delta = 0, $edit = array()) {
       }
       $bullet_item .= ul_start();
       if (plc_is_admin()) 
-       $bullet_item .= leaf ( href(l_slices_site(plc_my_site_id()), 'My Site Slices'));
+       $bullet_item .= leaf ( href(l_slices_my_site(), 'My Site Slices'));
       if( plc_is_admin() || plc_is_pi() ) {
        $bullet_item .= leaf(href(l_slice_add(),"Create Slice"));
       }
@@ -210,7 +211,8 @@ function planetlab_block($op = 'list', $delta = 0, $edit = array()) {
        $bullet_item = '';
        $bullet_item .= href(l_admin(),"Admin search");
        $bullet_item .= ul_start();
-       $bullet_item .= leaf( href (l_node_add(),"Add Node"));
+       if ( plc_is_admin() )
+         $bullet_item .= leaf( href (l_node_add(),"Add Node"));
        $bullet_item .= leaf( href( l_tags(),"Tags"));
        $bullet_item .= leaf( href( l_nodegroups(),"Node groups"));
        $bullet_item .= leaf (href(l_peers(),'Peers'));