From d2f5be640123ee36708803c05ba3c48d9781c556 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 28 Jan 2007 18:54:23 +0000 Subject: [PATCH] New CommModule --- includes/account.php | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/includes/account.php b/includes/account.php index 9c8af34..65aeed2 100644 --- a/includes/account.php +++ b/includes/account.php @@ -336,7 +336,7 @@ fclose($fp); mysql_query("update `emailcerts` set `csr_name`='$CSRname' where `id`='$emailid'"); } - $do = `../scripts/runclient`; + waitForResult("emailcerts", $emailid, 4); $query = "select * from `emailcerts` where `id`='$emailid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -620,11 +620,12 @@ } rename($_SESSION['_config']['tmpfname'], $CSRname); mysql_query("update `domaincerts` set `CSR_name`='$CSRname' where `id`='$CSRid'"); - $do = `../scripts/runserver`; + waitForResult("domaincerts", $CSRid, 11); $query = "select * from `domaincerts` where `id`='$CSRid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) { + $id = 11; showheader(_("My CAcert.org Account!")); printf(_("Your certificate request has failed to be processed correctly, see %sthe WIKI page%s for reasons and solutions."), "", ""); showfooter(); @@ -710,7 +711,7 @@ mysql_query("update `domaincerts` set `subject`='$subject',`csr_name`='$newfile' where `id`='$newid'"); echo _("Renewing").": ".$_SESSION['_config']['0.CN']."
\n"; - $do = `../scripts/runserver`; + waitForResult("domaincerts", $newid); $query = "select * from `domaincerts` where `id`='$newid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -754,7 +755,6 @@ continue; } mysql_query("update `domaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='$id'"); - $do = `../scripts/runserver`; printf(_("Certificate for '%s' has been revoked.")."
\n", $row['CN']); } } @@ -825,7 +825,7 @@ mysql_query("insert into `emaillink` set `emailid`='".$r2['emailid']."', `emailcertsid`='$newid'"); } - $do = `../scripts/runclient`; + waitForResult("emailcerts", $newid); $query = "select * from `emailcerts` where `id`='$newid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -867,7 +867,6 @@ continue; } mysql_query("update `emailcerts` set `revoked`='1970-01-01 10:00:01' where `id`='$id'"); - $do = `../scripts/runclient`; printf(_("Certificate for '%s' has been revoked.")."
\n", $row['CN']); } } @@ -1250,7 +1249,7 @@ fclose($fp); mysql_query("update `orgemailcerts` set `csr_name`='$CSRname' where `id`='$emailid'"); } - $do = `../scripts/runclient`; + waitForResult("orgemailcerts", $emailid); $query = "select * from `orgemailcerts` where `id`='$emailid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -1300,7 +1299,7 @@ $newfile = $_SESSION['_config']['filepath']."/csr/orgclient-$newid.csr"; copy($row['csr_name'], $newfile); mysql_query("update `orgemailcerts` set `csr_name`='$newfile' where `id`='$newid'"); - $do = `../scripts/runclient`; + waitForResult("orgemailcerts", $newid); $query = "select * from `orgemailcerts` where `id`='$newid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -1343,7 +1342,6 @@ continue; } mysql_query("update `orgemailcerts` set `revoked`='1970-01-01 10:00:01' where `id`='$id'"); - $do = `../scripts/runclient`; printf(_("Certificate for '%s' has been revoked.")."
\n", $row['CN']); } } @@ -1505,7 +1503,7 @@ if(is_array($_SESSION['_config']['altid'])) foreach($_SESSION['_config']['altid'] as $id) mysql_query("insert into `orgdomlink` set `orgdomid`='$id', `orgcertid`='$CSRid'"); - $do = `../scripts/runserver`; + waitForResult("orgdomaincerts", $CSRid); $query = "select * from `orgdomaincerts` where `id`='$CSRid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -1559,7 +1557,7 @@ $res = mysql_query("select * from `orgdomlink` where `orgcertid`='".$row['id']."'"); while($r2 = mysql_fetch_assoc($res)) mysql_query("insert into `orgdomlink` set `orgdomid`='".$r2['id']."', `orgcertid`='$newid'"); - $do = `../scripts/runserver`; + waitForResult("orgdomaincerts", $newid); $query = "select * from `orgdomaincerts` where `id`='$newid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -1603,7 +1601,6 @@ continue; } mysql_query("update `orgdomaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='$id'"); - $do = `../scripts/runserver`; printf(_("Certificate for '%s' has been revoked.")."
\n", $row['CN']); } } @@ -1766,9 +1763,6 @@ $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) mysql_query("update `orgemailcerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$row['id']."'"); - - $do = `../scripts/runserver`; - $do = `../scripts/runclient`; } if($oldid == 29 && $_REQUEST['process'] != "") @@ -1814,7 +1808,6 @@ while($row = mysql_fetch_assoc($res)) { mysql_query("update `orgdomaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$row['id']."'"); - $do = `../scripts/runserver`; mysql_query("delete from `orgdomaincerts` where `orgid`='".$row['id']."'"); mysql_query("delete from `orgdomlink` where `domid`='".$row['id']."'"); } @@ -1827,7 +1820,6 @@ while($row = mysql_fetch_assoc($res)) { mysql_query("update `orgemailcerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$row['id']."'"); - $do = `../scripts/runclient`; mysql_query("delete from `orgemailcerts` where `id`='".$row['id']."'"); mysql_query("delete from `orgemaillink` where `domid`='".$row['id']."'"); } @@ -2224,7 +2216,7 @@ fputs($fp, $_SESSION['_config']['CSR']); fclose($fp); mysql_query("update `domaincerts` set `CSR_name`='$CSRname' where `id`='$CSRid'"); - $do = `../scripts/runserver`; + waitForResult("domaincerts", $CSRid); $query = "select * from `domaincerts` where `id`='$CSRid' and `crt_name` != ''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0)