summaryrefslogtreecommitdiff
path: root/CommModule
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2014-06-17 23:01:58 +0200
committerBenny Baumann <BenBE@geshi.org>2014-06-17 23:01:58 +0200
commit7f332a32fff1e45afc939220effe042ad7b3f4b8 (patch)
treed95d9adc2d557cdf386648623ca88a3007ef01c9 /CommModule
parent10e61e1d6f7543278faec4721d3d20c64722f156 (diff)
parentb275df70541737f4bc1576db57e7236e105f101f (diff)
downloadcacert-devel-7f332a32fff1e45afc939220effe042ad7b3f4b8.tar.gz
cacert-devel-7f332a32fff1e45afc939220effe042ad7b3f4b8.tar.xz
cacert-devel-7f332a32fff1e45afc939220effe042ad7b3f4b8.zip
Merge branch 'bug-773' into testserver-stable
Diffstat (limited to 'CommModule')
-rwxr-xr-xCommModule/client.pl45
1 files changed, 36 insertions, 9 deletions
diff --git a/CommModule/client.pl b/CommModule/client.pl
index 368345f..5aac7ee 100755
--- a/CommModule/client.pl
+++ b/CommModule/client.pl
@@ -1023,17 +1023,29 @@ 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");
+ if($org eq "")
+ {
+ if($server)
+ {
+ my @a=$dbh->selectrow_array("select `memid` from `domains` where `id`='".int($row{domid})."'");
+ sendRevokeMail($a[0], $row{'CN'}, $row{'serial'});
+ }
+ else
+ {
+ sendRevokeMail($row{memid}, $row{'CN'}, $row{'serial'});
+ }
+ }
+ else
+ {
+ my $orgsth = $dbh->prepare("select `memid` from `org` where `orgid`='".int($row{orgid})."'");
+ $orgsth->execute();
+ while ( my ($memid) = $orgsth->fetchrow_array() )
+ {
+ sendRevokeMail($memid, $row{'CN'}, $row{'serial'});
+ }
+ }
}
}
@@ -1046,6 +1058,21 @@ sub RevokeCerts($$)
}
+sub sendRevokeMail()
+{
+ my $memid = $_[0];
+ my $certName = $_[1];
+ my $serial = $_[2];
+ 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", $certName, $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");
+}