Commit ed783338 authored by Russ Fish's avatar Russ Fish

Tweak the newosid "template".

parent 8965aad8
......@@ -110,12 +110,11 @@ else {
fatal("Bad data in translated pathname: $xmlfile");
}
# The web interface (and in the future the xmlrpc interface) will
# sets this.
# The web interface (and in the future the xmlrpc interface) sets this.
$this_user = User->ImpliedUser();
if (! defined($this_user)) {
fatal("Cannot determind implied user!");
fatal("Cannot determine implied user!");
}
}
......@@ -280,10 +279,14 @@ delete($newosid_args{"osname"});
# Ditto the pid.
delete($newosid_args{"pid"});
my $new_osinfo = OSinfo->Create($project, $this_user, $osname, \%newosid_args);
if (!defined($new_osinfo)) {
fatal("Could not create new OSID!");
}
my $usrerr;
my $new_osinfo = OSinfo->Create($project, $this_user, $osname,
\%newosid_args, \$usrerr);
UserError($usrerr)
if (defined($usrerr));
fatal("Could not create new OSID!")
if (!defined($new_osinfo));
my $osid = $new_osinfo->osid();
# The web interface requires this line to be printed.
......
......@@ -174,12 +174,12 @@ sub mfs($) { return field($_[0], "mfs"); }
sub reboot_waittime($) { return field($_[0], "reboot_waittime"); }
#
# Create a new experiment. This installs the new record in the DB,
# Create a new os_info. This installs the new record in the DB,
# and returns an instance. There is some bookkeeping along the way.
#
sub Create($$$$)
{
my ($class, $project, $creator, $osname, $argref) = @_;
my ($class, $project, $creator, $osname, $argref, $usrerr_ref) = @_;
my $idx;
my $now = time();
......@@ -203,7 +203,7 @@ sub Create($$$$)
if ($query_result->numrows) {
DBQueryWarn("unlock tables");
tberror("OS $osname in project $pid already exists!");
$$usrerr_ref = "Error: OS $osname in project $pid already exists!";
return undef;
}
......
......@@ -110,12 +110,11 @@ else {
fatal("Bad data in translated pathname: $xmlfile");
}
# The web interface (and in the future the xmlrpc interface) will
# sets this.
# The web interface (and in the future the xmlrpc interface) sets this.
$this_user = User->ImpliedUser();
if (! defined($this_user)) {
fatal("Cannot determind implied user!");
fatal("Cannot determine implied user!");
}
}
......@@ -280,10 +279,14 @@ delete($newosid_args{"osname"});
# Ditto the pid.
delete($newosid_args{"pid"});
my $new_osinfo = OSinfo->Create($project, $this_user, $osname, \%newosid_args);
if (!defined($new_osinfo)) {
fatal("Could not create new OSID!");
}
my $usrerr;
my $new_osinfo = OSinfo->Create($project, $this_user, $osname,
\%newosid_args, \$usrerr);
UserError($usrerr)
if (defined($usrerr));
fatal("Could not create new OSID!")
if (!defined($new_osinfo));
my $osid = $new_osinfo->osid();
# The web interface requires this line to be printed.
......
......@@ -83,8 +83,7 @@ function SPITFORM($formfields, $errors)
#
echo "<tr>
<td>*Select Project:</td>
<td><select name=\"formfields[pid]\"
onChange='SetPrefix(idform);'>
<td><select name=\"formfields[pid]\">
<option value=''>Please Select &nbsp</option>\n";
while (list($project) = each($projlist)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment