\n"; my %old = map { lc($_->[0]), $_ } &list_addresses(); print &ui_columns_start([ $text{'address_addr'}, $text{'address_name'}, $text{'import_action'} ], 100); foreach my $a (@addrs) { my $o = $old{lc($a->[0])}; $a->[0] =~ s/^\s+//; $a->[0] =~ s/\s+$//; $a->[1] =~ s/^\s+//; $a->[1] =~ s/\s+$//; if ($a->[0] !~ /^\S+\@\S+$/) { # Invalid email print &ui_columns_row([ &html_escape($a->[0]), &html_escape($a->[1]), $text{'import_noemail'} ]); } elsif (!$o) { # Missing, need to add print &ui_columns_row([ &html_escape($a->[0]), &html_escape($a->[1]), $text{'import_add'} ]); &create_address($a->[0], $a->[1], $a->[2]); } elsif ($in{'dup'}) { if ($o->[1] ne $a->[1] && $o->[2] ne '') { # Exists but is different .. update print &ui_columns_row([ &html_escape($a->[0]), &html_escape($a->[1]), $text{'import_update'} ]); &modify_address($o->[2], $a->[0], $a->[1], $a->[2]); } elsif ($o->[1] ne $a->[1] && $o->[2] eq '') { # Exists but cannot be updated print &ui_columns_row([ &html_escape($a->[0]), &html_escape($a->[1]), $text{'import_readonly'} ]); } else { # Exists and is same print &ui_columns_row([ &html_escape($a->[0]), &html_escape($a->[1]), $text{'import_same'} ]); } } else { # Exists, skip print &ui_columns_row([ &html_escape($a->[0]), &html_escape($a->[1]), $text{'import_skip'} ]); } } print &ui_columns_end(); &ui_print_footer("list_addresses.cgi", $text{'address_return'});