Support editing of servers with the same name and type, and check for clashes when creating and editing.

https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3309470&group_id=17457
This commit is contained in:
Jamie Cameron
2011-05-30 17:45:22 -07:00
parent e68627490e
commit fc03d67257
5 changed files with 21 additions and 3 deletions

View File

@ -18,7 +18,8 @@ if ($in{'new'}) {
};
}
else {
($prog) = grep { $_->{'name'} eq $in{'name'} } @$master;
($prog) = grep { $_->{'name'} eq $in{'name'} &&
$_->{'type'} eq $in{'type'} } @$master;
$prog || &error($text{'master_egone'});
&ui_print_header(undef, $text{'master_edit'}, "");
}
@ -26,6 +27,7 @@ else {
print &ui_form_start("save_master.cgi", "post");
print &ui_hidden("new", $in{'new'}),"\n";
print &ui_hidden("old", $in{'name'}),"\n";
print &ui_hidden("oldtype", $in{'type'}),"\n";
print &ui_table_start($text{'master_header'}, "width=100%", 4);
print &ui_table_row($text{'master_type'},