X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Fedit.mc;h=e0cb6e76f0d5323202f34ded959c306d347f8564;hp=bfe383691238715839cde6cf351b8d64c04db45a;hb=570b57305c273a1d71e86fd44c50fb27d42aefbd;hpb=a5dd8537772021ab6cd0d5221462feed60015ddc diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index bfe3836..e0cb6e7 100644 --- a/web/htdocs/details/edit.mc +++ b/web/htdocs/details/edit.mc @@ -36,10 +36,11 @@ my $conn = new ZOOM::Connection($db, 0, user => "admin", password => "fruitbat", elementSetName => "zeerex"); -my $protocol = utf8param($r, "protocol"); -my $host = utf8param($r, "host"); -my $port = utf8param($r, "port"); -my $dbname = utf8param($r, "dbname"); +my $protocol = utf8paramTrim($r, "protocol"); +my $host = utf8paramTrim($r, "host"); +my $port = utf8paramTrim($r, "port"); +my $dbname = utf8paramTrim($r, "dbname"); +my $title = utf8paramTrim($r, "title"); if ((!defined $port || $port eq "") && (defined $protocol && $protocol ne "")) { @@ -53,6 +54,7 @@ my $newid; if (defined $protocol && $protocol ne "" && defined $host && $host ne "" && defined $port && $port ne "" && + defined $title && $title ne "" && defined $dbname && $dbname ne "") { $newid = irspy_make_identifier($protocol, $host, $port, $dbname); } @@ -66,9 +68,9 @@ if (!defined $id) { } elsif (!defined $newid) { # Tried to create new record but data is insufficient print qq[

- Please specify protocol, host, port and database name.

\n]; + Please specify name, protocol, host, port and database name.

\n]; undef $update; - } elsif ($host !~ /^\w+\.[\w.]*\w$/i) { + } elsif ($host !~ /^[\w-]+\.[\w.-]*\w$/i) { print qq[

This host name is not valid.

\n]; undef $update; @@ -335,6 +337,8 @@ my @fields = qw(e:title e:description) ], [ subjects => 2, "Subjects", "e:databaseInfo/e:subjects", qw(e:title e:description) ], + [ disabled => [ qw(0 1) ], + "Target Test Disabled", "i:status/i:disabled" ], ); # Update record with submitted data