X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=web%2Fhtdocs%2Fdetails%2Fedit.mc;h=363dbbc6fc1079c36a97eebec68792ec90c72675;hb=aa38bfcb03f514e615577960f71115301959f3a5;hp=bfe383691238715839cde6cf351b8d64c04db45a;hpb=a5dd8537772021ab6cd0d5221462feed60015ddc;p=irspy-moved-to-github.git diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index bfe3836..363dbbc 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; @@ -119,12 +121,15 @@ my @fields = [ port => 0, "Port", "e:serverInfo/e:port" ], [ dbname => 0, "Database Name", "e:serverInfo/e:database", qw(e:host e:port) ], + [ udb => 0, "Access Name (Unique DB)", "e:databaseInfo/i:udb", qw(e:host e:port e:database) ], [ type => $m->comp("libtype-list.mc"), "Type of Library", "i:status/i:libraryType" ], [ username => 0, "Username (if needed)", "e:serverInfo/e:authentication/e:user", qw() ], [ password => 0, "Password (if needed)", "e:serverInfo/e:authentication/e:password", qw(e:user) ], + [ proxy => 0, "Proxy (if needed)", "e:serverInfo/e:authentication/e:proxy", + qw(e:password) ], [ description => 5, "Description", "e:databaseInfo/e:description", qw(e:title) ], [ author => 0, "Author", "e:databaseInfo/e:author", @@ -335,6 +340,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