All mysql_-statments replaced by their corresponding mysqli_-statements
[cacert-devel.git] / scripts / mass-revoke.php
old mode 100755 (executable)
new mode 100644 (file)
index 18c036b..14192b6
@@ -44,37 +44,37 @@ while($in_string = rtrim(fgets($in))) {
                $query = "UPDATE `domaincerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
                $query = "UPDATE `domaincerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
-               if (!mysql_query($query)) {
+               if (!mysqli_query($_SESSION['mconn'], $query)) {
                        $num_failures++;
                }
                        $num_failures++;
                }
-               $num_domain+=mysql_affected_rows();
+               $num_domain+=mysqli_affected_rows($_SESSION['mconn']);
                
        } else if ($cert_type == "EmailCert") {
                $query = "UPDATE `emailcerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
                
        } else if ($cert_type == "EmailCert") {
                $query = "UPDATE `emailcerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
-               if (!mysql_query($query)) {
+               if (!mysqli_query($_SESSION['mconn'], $query)) {
                        $num_failures++;
                }
                        $num_failures++;
                }
-               $num_client+=mysql_affected_rows();
+               $num_client+=mysqli_affected_rows($_SESSION['mconn']);
                
        } else if ($cert_type == "OrgServerCert") {
                $query = "UPDATE `orgdomaincerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
                
        } else if ($cert_type == "OrgServerCert") {
                $query = "UPDATE `orgdomaincerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
-               if (!mysql_query($query)) {
+               if (!mysqli_query($_SESSION['mconn'], $query)) {
                        $num_failures++;
                }
                        $num_failures++;
                }
-               $num_orgdomain+=mysql_affected_rows();
+               $num_orgdomain+=mysqli_affected_rows($_SESSION['mconn']);
                
        } else if ($cert_type == "OrgEmailCert") {
                $query = "UPDATE `orgemailcerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
                
        } else if ($cert_type == "OrgEmailCert") {
                $query = "UPDATE `orgemailcerts` SET `revoked`='1970-01-01 10:00:01'
                        where `id`='$cert_recid' AND `revoked`<'1970-01-01 10:00:01'";
                
-               if (!mysql_query($query)) {
+               if (!mysqli_query($_SESSION['mconn'], $query)) {
                        $num_failures++;
                }
                        $num_failures++;
                }
-               $num_orgclient+=mysql_affected_rows();
+               $num_orgclient+=mysqli_affected_rows();
        }
 }
 
        }
 }