Commit ed783338 authored by Russ Fish's avatar Russ Fish
Browse files

Tweak the newosid "template".

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