#!/usr/bin/perl

# $Id: update_ws.pl,v 1.3 1996/01/17 05:05:35 hoagland Exp $

# update_ws.pl, by Jim Hoagland (hoagland@cs) 1/96

# this program takes the updated host list for a working set, stores it,
# then invokes &draw_ws to return the HTML for the page.
# Input is CGI, fields on a form,  Output is HTML to STDOUT.

require '/pkg/www/arpa/secret/cgi-bin/gui-helper.pl';
require '/pkg/www/arpa/secret/cgi-bin/draw_ws.pl';

require CGI;

$input= new CGI;

foreach (@ARGV) {  # simulate field input
  $input->param(split('=',$_,2));
}

$state= State->new(&get_statefile);

#-------------

$ws= $input->param('ws_name');
$input->delete('ws_name');
@hosts= $input->param();
$state->set_set($ws,@hosts);
$state->store;

&draw_ws($state,$ws);
1;
