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/save_contact.cgi |
#!/usr/bin/perl
# Update contact details for some domain
require './virtualmin-registrar-lib.pl';
&ReadParse();
&error_setup($text{'contact_err'});
# Get the Virtualmin domain
&can_domain($in{'dom'}) || &error($text{'contact_ecannot'});
$d = &virtual_server::get_domain_by("dom", $in{'dom'});
$d || &error(&text('contact_edom', $in{'dom'}));
&can_contacts($d) == 1 || &can_contacts($d) == 3 ||
&error(&text('contact_edom', $in{'dom'}));
($account) = grep { $_->{'id'} eq $d->{'registrar_account'} }
&list_registrar_accounts();
$account || &error(&text('contact_eaccount', $in{'dom'}));
# Get contact info from registrar
$cfunc = "type_".$account->{'registrar'}."_get_contact";
$cons = &$cfunc($account, $d);
ref($cons) || &error($cons);
# Validate all input types, and update object
foreach my $con (@$cons) {
if ($in{$con->{'purpose'}."same"}) {
# Same as first one
$ot = $con->{'purpose'};
%$con = %{$cons->[0]};
$con->{'purpose'} = $ot;
next;
}
@schema = &get_contact_schema($account, $d, $con->{'purpose'});
foreach my $s (@schema) {
$n = $con->{'purpose'}.$s->{'name'};
$fn = $text{'contact_'.lc($s->{'name'})};
if ($s->{'readonly'}) {
# No need to save
next;
}
elsif ($s->{'choices'}) {
# Menu of choices
$con->{$s->{'name'}} = $in{$n};
}
elsif ($s->{'opt'} == 1) {
# Optional value with default
if ($in{$n."_def"}) {
$con->{$s->{'name'}} = "";
}
else {
$in{$n} =~ /\S/ ||
&error(&text('contact_emissing', $fn));
$con->{$s->{'name'}} = $in{$n};
}
}
elsif ($s->{'opt'} == 2) {
# Optional value
$con->{$s->{'name'}} = $in{$n};
}
else {
# Mandatory value
$in{$n} =~ /\S/ ||
&error(&text('contact_emissing', $fn));
$con->{$s->{'name'}} = $in{$n};
}
}
}
# Save the contact
$sfunc = "type_".$account->{'registrar'}."_save_contact";
$err = &$sfunc($account, $d, $cons);
&error(&text('contact_esave', $err)) if ($err);
# Redirect to Virtualmin post-save page
&virtual_server::domain_redirect($d);
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`