Waiting Function for New CommModule

pull/1/head
root 18 years ago
parent d2f5be6401
commit 8c76ca7c45

@ -661,4 +661,36 @@
mysql_query($query);
return _("Failed to make a connection to the mail server");
}
function waitForResult($table, $certid, $id = 0)
{
$found = $trycount = 0;
while($trycount++ <= 30)
{
if($table == "gpg")
$query = "select * from `$table` where `id`='$certid' and `crt` != ''";
else
$query = "select * from `$table` where `id`='$certid' and `crt_name` != ''";
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
{
$found = 1;
break;
}
sleep(1);
}
if(!$found)
{
showheader(_("My CAcert.org Account!"));
$query = "select * from `$table` where `id`='$certid' ";
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
printf(_("Your certificate request is still queued and hasn't been processed yet. Please wait, and go to Certificates -> View to see it's status."));
else
printf(_("Your certificate request has failed to be processed correctly, see %sthe WIKI page%s for reasons and solutions."), "<a href='http://wiki.cacert.org/wiki/FAQ/CertificateRenewal'>", "</a>");
showfooter();
exit;
}
}
?>

Loading…
Cancel
Save