show slice_id for admins only
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 8 Jun 2009 12:28:16 +0000 (12:28 +0000)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 8 Jun 2009 12:28:16 +0000 (12:28 +0000)
planetlab/slices/slices.php

index e541e0d..92210e4 100644 (file)
@@ -106,7 +106,7 @@ if ( ! $slices ) {
   
 $nifty=new PlekitNifty ('','objects-list','big');
 $nifty->start();
-$headers["I"]="int";
+if (plc_is_admin()) $headers["I"]="int";
 $headers["Peer"]="string";
 $headers["Name"]="string";
 $headers["Users"]="string";
@@ -115,7 +115,10 @@ $headers["N"]="int";
 $headers["Exp. d/m/y"]="date-dmy";
 
 # initial sort on hostnames
-$table=new PlekitTable ("slices",$headers,3,
+if (plc_is_admin()) $slices_sort_column = 3;
+else $slices_sort_column = 2;
+    
+$table=new PlekitTable ("slices",$headers,$slices_sort_column,
                        array('search_width'=>20));
 $table->start();
 
@@ -128,7 +131,7 @@ foreach ($slices as $slice) {
   $expires= date( "d/m/Y", $slice['expires'] );
 
   $table->row_start();
-  $table->cell (l_slice_t($slice_id,$slice_id));
+  if (plc_is_admin()) $table->cell (l_slice_t($slice_id,$slice_id));
   $peers->cell($table,$peer_id);
   $table->cell (l_slice_obj($slice));
   $table->cell ($users);