summaryrefslogtreecommitdiff
path: root/CommModule
diff options
context:
space:
mode:
authorFelix Dörre <felix@dogcraft.de>2014-06-17 17:58:29 +0200
committerFelix Dörre <felix@dogcraft.de>2014-06-17 17:58:29 +0200
commitddabc10cd826ee00015732e8bff2141438ce282f (patch)
treef25b6c5b4a9caf7811db1e6be92d5b2a87a706c4 /CommModule
parentf2e2938666127a8636ac7770a1cfdb089124528b (diff)
downloadcacert-devel-ddabc10cd826ee00015732e8bff2141438ce282f.tar.gz
cacert-devel-ddabc10cd826ee00015732e8bff2141438ce282f.tar.xz
cacert-devel-ddabc10cd826ee00015732e8bff2141438ce282f.zip
bug 773: fix sending email on revocation.
Use the email (and language) of domain owner to send mail.
Diffstat (limited to 'CommModule')
-rwxr-xr-xCommModule/client.pl32
1 files changed, 23 insertions, 9 deletions
diff --git a/CommModule/client.pl b/CommModule/client.pl
index c337d94..78b229d 100755
--- a/CommModule/client.pl
+++ b/CommModule/client.pl
@@ -1023,17 +1023,25 @@ sub RevokeCerts($$)
if($result)
{
- setUsersLanguage($row{memid});
-
- my %user=getUserData($row{memid});
-
$dbh->do("update `$table` set `revoked`=now() where `id`='".$row{'id'}."'");
- my $body = _("Hi")." $user{fname},\n\n";
- $body .= sprintf(_("Your certificate for '%s' with the serial number '%s' has been revoked, as per request.")."\n\n", $row{'CN'}, $row{'serial'});
- $body .= _("Best regards")."\n"._("CAcert.org Support!")."\n\n";
- SysLog("Sending email to ".$user{"email"}."\n") if($debug);
- sendmail($user{email}, "[CAcert.org] "._("Your certificate"), $body, "support\@cacert.org", "", "", "CAcert Support");
+ my $memid = $row{memid};
+ if($server)
+ {
+ $memid = getMemidFromDomid($row{domid});
+ }
+ if($org == "")
+ {
+ setUsersLanguage($memid);
+
+ my %user=getUserData($memid);
+
+ my $body = _("Hi")." $user{fname},\n\n";
+ $body .= sprintf(_("Your certificate for '%s' with the serial number '%s' has been revoked, as per request.")."\n\n", $row{'CN'}, $row{'serial'});
+ $body .= _("Best regards")."\n"._("CAcert.org Support!")."\n\n";
+ SysLog("Sending email to ".$user{"email"}."\n") if($debug);
+ sendmail($user{email}, "[CAcert.org] "._("Your certificate"), $body, "support\@cacert.org", "", "", "CAcert Support");
+ }
}
}
@@ -1046,6 +1054,12 @@ sub RevokeCerts($$)
}
+sub getMemidFromDomid()
+{
+ my @a=$dbh->selectrow_array("select memid from domains where id='".int($_[0])."'");
+ return $a[0];
+}
+