X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Fedit.mc;h=4b0b540e6a8f0be9bc8f85bbb0c7fc14cfa35407;hp=ca1213a9a66423973efa666189701a5d258ff3b0;hb=d8931f76879e7d7b5d0cb8340291b7d2dac65c91;hpb=dcdacfd6a4d3d979e910276d3bdcf0ae32320051 diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index ca1213a..4b0b540 100644 --- a/web/htdocs/details/edit.mc +++ b/web/htdocs/details/edit.mc @@ -1,4 +1,4 @@ -%# $Id: edit.mc,v 1.29 2007-03-29 16:19:39 mike Exp $ +%# $Id: edit.mc,v 1.30 2007-04-27 14:04:40 mike Exp $ <%args> $op $id => undef @@ -50,20 +50,25 @@ if (defined $id && ($op ne "copy" || !$update)) { } else { # No ID supplied -- this is a brand new record + my $protocol = $r->param("protocol"); my $host = $r->param("host"); my $port = $r->param("port"); my $dbname = $r->param("dbname"); - if (!defined $host || $host eq "" || + if (!defined $protocol || $protocol eq "" || + !defined $host || $host eq "" || !defined $port || $port eq "" || !defined $dbname || $dbname eq "") { print qq[

-You must specify host, port and database name.

\n] if $update; +You must specify protocol, host, port and database name.

\n] if $update; undef $update; } else { - my $query = cql_target($host, $port, $dbname); + ### Should use a utility function for this + my $query = cql_target($protocol, $host, $port, $dbname); my $rs = $conn->search(new ZOOM::Query::CQL($query)); if ($rs->size() > 0) { - my $fakeid = xml_encode(uri_escape("$host:$port/$dbname")); + my $fakeid = + xml_encode(uri_escape(irspy_make_identifier($protocol, $host, + $port, $dbname))); print qq[

There is already a record