php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /proc/self/root/usr/libexec/webmin/virtualmin-registrar/ |
| files >> //proc/self/root/usr/libexec/webmin/virtualmin-registrar/edit_onecontact.cgi |
#!/usr/bin/perl
# Show a form to edit a single contact associated with a registrar
require './virtualmin-registrar-lib.pl';
&ReadParse();
&error_setup($text{'onecontact_err'});
# Get the account
@accounts = &list_registrar_accounts();
($account) = grep { $_->{'id'} eq $in{'id'} } @accounts;
$account || &error($text{'contacts_eaccount'});
&ui_print_header($account->{'desc'},
$in{'new'} ? $text{'onecontact_create'}
: $text{'onecontact_edit'}, "");
$cfunc = "type_".$account->{'registrar'}."_get_contact_classes";
@classes = &$cfunc($account);
if (!$in{'new'}) {
# Get the contact
$cfunc = "type_".$account->{'registrar'}."_list_contacts";
($ok, $contacts) = &$cfunc($account);
$ok || &error(&text('contacts_elist', $contacts));
($con) = grep { $_->{'id'} eq $in{'cid'} } @$contacts;
($cls) = grep { $con->{$_->{'field'}} eq $_->{'id'} } @classes;
$in{'cls'} = $cls->{'id'} if ($cls);
}
else {
# Set type from class
($cls) = grep { $_->{'id'} eq $in{'cls'} } @classes;
if ($cls && $cls->{'field'}) {
$con = { $cls->{'field'} => $cls->{'id'} };
}
}
&ui_print_header(undef, $text{'onecontact_title'}, "");
print &ui_form_start("save_onecontact.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("cid", $in{'cid'});
print &ui_hidden("new", $in{'new'});
print &ui_hidden("cls", $in{'cls'});
print &ui_table_start(&text('onecontact_header', $cls->{'desc'}),
"width=100%", 2);
@schema = &get_contact_schema($account, undef, undef, $in{'new'}, $in{'cls'});
foreach my $s (@schema) {
$n = $s->{'name'};
if ($s->{'readonly'}) {
# Just show value
$field = $con->{$s->{'name'}};
next if ($in{'new'} && !$field);
if ($s->{'choices'}) {
($c) = grep { $_->[0] eq $field } @{$s->{'choices'}};
$field = $c->[1] if ($c);
}
}
elsif ($s->{'choices'}) {
# Select from menu
@choices = @{$s->{'choices'}};
if ($s->{'opt'}) {
unshift(@choices,
[ undef, $text{'contact_default'} ]);
}
$field = &ui_select($n, $con->{$s->{'name'}},
\@choices, 1, 0, !$in{'new'});
}
elsif ($s->{'opt'} == 1) {
# Optional value
$field = &ui_opt_textbox($n,
$con->{$s->{'name'}}, $s->{'size'},
$text{'contact_default'});
}
else {
# Required value
$field = &ui_textbox($n,
$con->{$s->{'name'}}, $s->{'size'});
}
print &ui_table_row($text{'contact_'.$s->{'name'}}, $field);
}
print &ui_table_end();
if ($in{'new'}) {
print &ui_form_end([ [ undef, $text{'create'} ] ]);
}
else {
$dfunc = "type_".$account->{'registrar'}."_delete_one_contact";
print &ui_form_end([ [ undef, $text{'save'} ],
defined(&$dfunc) ?
[ 'delete', $text{'delete'} ] : undef ]);
}
&ui_print_footer(&virtual_server::domain_footer_link($d));
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`