add an admin option to update the site:enabled field on the site view page.
[plewww.git] / planetlab / common / actions.php
index 8a3b0fb..c05d0b0 100644 (file)
@@ -184,7 +184,7 @@ switch ($action) {
 
  case 'become-person' : {
    $plc->BecomePerson (intval($person_id));
-   plc_redirect (l_persons());
+   plc_redirect (l_person(intval($person_id)));
  }
 
  case 'delete-person' : {
@@ -434,6 +434,9 @@ switch ($action) {
      $fields['login_base'] = $_POST['login_base'];
    if ($_POST['max_slices']) 
      $fields['max_slices'] = intval($_POST['max_slices']);
+   if (isset($_POST['enabled'])) {
+     $fields['enabled'] = (bool)$_POST['enabled'];
+   }
    
    $retcod=$api->UpdateSite( intval( $site_id ), $fields );
    if ($retcod == 1) 
@@ -600,8 +603,11 @@ switch ($action) {
    if ($result)
      drupal_set_message ("Added slice tag.");
    else 
-     drupal_set_error("Could not add slice tag");
-   plc_redirect(l_slice($slice_id) . "&show_tags=true" );
+       drupal_set_error("Could not add slice tag");
+   if ($_POST['sliver_action'])
+       plc_redirect(l_sliver($node_id,$slice_id));
+   else
+       plc_redirect(l_slice($slice_id) . "&show_tags=true" );
    break;
  }