Fix for https://bugs.cacert.org/view.php?id=922
"CAcert application code problem causing missing 'certificate about to expire'
messages"
since that new code is locking up the mysql server.
mysql_query("update `domains` set `deleted`=NOW() where `id`='$id'");
$dres = mysql_query("select * from `domlink` where `domid`='$id'");
while($drow = mysql_fetch_assoc($dres))
{
mysql_query(
"update `domaincerts`
set `revoked`='1970-01-01 10:00:01'
where `id` = '".$drow['id']."'
and `revoked` = 0
and UNIX_TIMESTAMP(`expire`) -
UNIX_TIMESTAMP() > 0");
}
mysql_query(
"update `domains`
set `deleted`=NOW()
where `id` = '$id'");
mysql_query("update `domaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$drow['certid']."' and `revoked`=0 and UNIX_TIMESTAMP(`expire`)-UNIX_TIMESTAMP() > 0");
$body .= _("You are receiving this email as you are the listed contact for:")."\n\n";
$body .= $row['subject']."\n\n";
$body .= sprintf(_("Your certificate with the serial number %s is ".
"set to expire in approximately %s days time. You can ".
"renew it by going to the following URL:"),
$row['serial'],
$row['daysleft'])."\n\n";
$body .= sprintf(_("Your certificate is set to expire in approximately %s days time, you can renew this by going to the following URL:"), $row['daysleft'])."\n\n";
$body .= _("You are receiving this email as you are the listed contact for:")."\n\n";
$body .= $row['subject']."\n\n";
$body .= sprintf(_("Your certificate with the serial number %s is ".
"set to expire in approximately %s days time. You can ".
"renew it by going to the following URL:"),
$row['serial'],
$row['daysleft'])."\n\n";
$body .= sprintf(_("Your certificate is set to expire in approximately %s days time, you can renew this by going to the following URL:"), $row['daysleft'])."\n\n";