summaryrefslogtreecommitdiff
path: root/stamp
diff options
context:
space:
mode:
authorKarl-Heinz Gödderz (GuKKDevel) <Devel@GuKK-Online.de>2018-10-30 22:57:15 +0100
committerKarl-Heinz Gödderz (GuKKDevel) <Devel@GuKK-Online.de>2018-10-31 06:40:41 +0100
commita81747b7ed63126cf002ab8c587727973654fb98 (patch)
tree64305dd1c978ecfc355431fa158a04eb12727d07 /stamp
parentf8210d43aa91c16ca565f771fd23deb9b02af41d (diff)
downloadcacert-devel-a81747b7ed63126cf002ab8c587727973654fb98.tar.gz
cacert-devel-a81747b7ed63126cf002ab8c587727973654fb98.tar.xz
cacert-devel-a81747b7ed63126cf002ab8c587727973654fb98.zip
All mysql_-statments replaced by their corresponding mysqli_-statements
Diffstat (limited to 'stamp')
-rw-r--r--stamp/certdet.php4
-rw-r--r--stamp/common.php38
-rw-r--r--stamp/displogo.php4
-rw-r--r--stamp/report.php10
4 files changed, 28 insertions, 28 deletions
diff --git a/stamp/certdet.php b/stamp/certdet.php
index a43d2a0..2354c14 100644
--- a/stamp/certdet.php
+++ b/stamp/certdet.php
@@ -19,11 +19,11 @@
$tz = intval($_REQUEST['tz']);
$now = date("Y-m-d", gmmktime("U") + ($tz * 3600));
- $arr = explode("//", mysql_real_escape_string(trim($_REQUEST['refer'])), 2);
+ $arr = explode("//", mysqli_real_escape_string($_SESSION['mconn'], trim($_REQUEST['refer'])), 2);
$arr = explode("/", $arr['1'], 2);
$ref = $arr['0'];
- $arr = explode("//", mysql_real_escape_string(trim($_SERVER['HTTP_REFERER'])), 2);
+ $arr = explode("//", mysqli_real_escape_string($_SESSION['mconn'], trim($_SERVER['HTTP_REFERER'])), 2);
$arr = explode("/", $arr['1'], 2);
$siteref = $arr['0'];
diff --git a/stamp/common.php b/stamp/common.php
index d99a23a..13da662 100644
--- a/stamp/common.php
+++ b/stamp/common.php
@@ -20,7 +20,7 @@
function clean($key)
{
- return(mysql_real_escape_string(strip_tags(trim($_REQUEST[$key]))));
+ return(mysqli_real_escape_string($_SESSION['mconn'], strip_tags(trim($_REQUEST[$key]))));
}
function checkhostname($ref)
@@ -31,10 +31,10 @@
$stampid = 0;
$query = "select * from `stampcache` where `hostname`='$ref'";
- $res = mysql_query($query);
- if(mysql_num_rows($res) > 0)
+ $res = mysqli_query($_SESSION['mconn'], $query);
+ if(mysqli_num_rows($res) > 0)
{
- $row = mysql_fetch_assoc($res);
+ $row = mysqli_fetch_assoc($res);
if($row['cacheexpire'] >= date("U"))
return(array($row['valid'], $row));
else {
@@ -46,13 +46,13 @@
$query = "select * from `orgdomaincerts` where `id`='".intval($row['certid'])."' and `expire`>NOW() and `revoked`=0";
if($_REQUEST['debug'] == 1)
echo $query."<br>\n";
- $res = mysql_query($query);
- if(mysql_num_rows($res) > 0)
+ $res = mysqli_query($_SESSION['mconn'], $query);
+ if(mysqli_num_rows($res) > 0)
{
$query = "update `stampcache` set `cacheexpire`='".(date("U")+600)."' where `id`='$row[id]'";
if($_REQUEST['debug'] == 1)
echo $query."<br>\n";
- mysql_query($query);
+ mysqli_query($_SESSION['mconn'], $query);
return(array($row['valid'], $row));
}
}
@@ -68,8 +68,8 @@
group by `domaincerts`.`id` order by `domaincerts`.`id`";
if($_REQUEST['debug'] == 1)
echo $query."<br>\n";
- $res = mysql_query($query);
- if(mysql_num_rows($res) <= 0)
+ $res = mysqli_query($_SESSION['mconn'], $query);
+ if(mysqli_num_rows($res) <= 0)
{
$bits = explode(".", $ref);
for($i = 1; $i < count($bits); $i++)
@@ -88,8 +88,8 @@
group by `domaincerts`.`id` order by `domaincerts`.`id`";
if($_REQUEST['debug'] == 1)
echo $query."<br>\n";
- $res = mysql_query($query);
- if(mysql_num_rows($res) <= 0)
+ $res = mysqli_query($_SESSION['mconn'], $query);
+ if(mysqli_num_rows($res) <= 0)
{
$query = "select *,`orgdomaincerts`.`id` as `certid`,`orgdomaincerts`.`created` as `issued` from `orgdomaincerts`,`orgdomlink`,`orgdomains` where
(`orgdomaincerts`.`subject` like '%=DNS:$ref/%' or `orgdomaincerts`.`subject` like '%=DNS:*.$ref2/%' OR
@@ -101,8 +101,8 @@
group by `orgdomaincerts`.`id` order by `orgdomaincerts`.`id`";
if($_REQUEST['debug'] == 1)
echo $query."<br>\n";
- $res = mysql_query($query);
- if(mysql_num_rows($res) <= 0)
+ $res = mysqli_query($_SESSION['mconn'], $query);
+ if(mysqli_num_rows($res) <= 0)
{
$invalid = 1;
} else {
@@ -113,15 +113,15 @@
if($invalid == 0)
{
- $cert = mysql_fetch_assoc($res);
+ $cert = mysqli_fetch_assoc($res);
if($org == 0)
{
$query = "SELECT *, sum(`points`) AS `total` FROM `users`, `notary` WHERE `users`.`id` = '$cert[memid]' AND
`notary`.`to` = `users`.`id` and `notary`.`when` <= '$cert[issued]' and `notary`.`deleted`=0 GROUP BY `notary`.`to`";
- $user = mysql_fetch_assoc(mysql_query($query));
+ $user = mysqli_fetch_assoc(mysqli_query($_SESSION['mconn'], $query));
} else {
$query = "select * from `orginfo` where `id`='$cert[orgid]'";
- $orgi = mysql_fetch_assoc(mysql_query($query));
+ $orgi = mysqli_fetch_assoc(mysqli_query($_SESSION['mconn'], $query));
}
if($stampid <= 0)
@@ -134,12 +134,12 @@
`expire`='$cert[expire]',`subject`='$cert[subject]',`hostname`='$ref',`org`='$org',`points`='$user[total]',
`O`='$orgi[O]',`L`='$orgi[L]',`ST`='$orgi[ST]',`C`='$orgi[C]',`valid`='$invalid' where `id`='$stampid'";
}
- mysql_query($query);
+ mysqli_query($_SESSION['mconn'], $query);
} else if($stampid > 0) {
- mysql_query("update `stampcache` set `cacheexpire`='".(date("U")+600)."' where `id`='$stampid'");
+ mysqli_query($_SESSION['mconn'], "update `stampcache` set `cacheexpire`='".(date("U")+600)."' where `id`='$stampid'");
} else {
$query = "insert into `stampcache` set `cacheexpire`='".(date("U")+600)."',`hostname`='$ref',`valid`='$invalid'";
- mysql_query($query);
+ mysqli_query($_SESSION['mconn'], $query);
}
$arr = array("issued" => $cert['issued'], "expire" => $cert['expire'], "subject" => $cert['subject'], "hostname" => $ref,
diff --git a/stamp/displogo.php b/stamp/displogo.php
index 9c1f534..be519d1 100644
--- a/stamp/displogo.php
+++ b/stamp/displogo.php
@@ -16,11 +16,11 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
$img = "/www/stamp/images/CAverify.png";
- $arr = explode("//", mysql_real_escape_string(trim($_REQUEST['refer'])), 2);
+ $arr = explode("//", mysqli_real_escape_string($_SESSION['mconn'], trim($_REQUEST['refer'])), 2);
$arr = explode("/", $arr['1'], 2);
$ref = $arr['0'];
- $arr = explode("//", mysql_real_escape_string(trim($_SERVER['HTTP_REFERER'])), 2);
+ $arr = explode("//", mysqli_real_escape_string($_SESSION['mconn'], trim($_SERVER['HTTP_REFERER'])), 2);
$arr = explode("/", $arr['1'], 2);
$siteref = $arr['0'];
diff --git a/stamp/report.php b/stamp/report.php
index 519aa3a..b3a8392 100644
--- a/stamp/report.php
+++ b/stamp/report.php
@@ -15,11 +15,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- $arr = explode("//", mysql_real_escape_string(trim($_SESSION['_stamp']['ref'])), 2);
+ $arr = explode("//", mysqli_real_escape_string($_SESSION['mconn'], trim($_SESSION['_stamp']['ref'])), 2);
$arr = explode("/", $arr['1'], 2);
$ref = $arr['0'];
- $refer = mysql_real_escape_string(strip_tags(trim($_SESSION['_stamp']['ref'])));
+ $refer = mysqli_real_escape_string($_SESSION['mconn'], strip_tags(trim($_SESSION['_stamp']['ref'])));
$name = clean('name');
$email = clean('email');
$comment = clean('comment');
@@ -52,11 +52,11 @@
if($process != "")
{
- $IP = mysql_real_escape_string(trim($_SERVER['REMOTE_ADDR']));
+ $IP = mysqli_real_escape_string($_SESSION['mconn'], trim($_SERVER['REMOTE_ADDR']));
$iplong = ip2long($IP);
- mysql_query("insert into `abusereports` set `when`=NOW(), `IP`='$iplong', `url`='$refer', `name`='$name', `email`='$email',
+ mysqli_query($_SESSION['mconn'], "insert into `abusereports` set `when`=NOW(), `IP`='$iplong', `url`='$refer', `name`='$name', `email`='$email',
`comment`='$comment', `reason`='$reason'");
- $id = mysql_insert_id();
+ $id = mysqli_insert_id($_SESSION['mconn']);
$body = "New Abuse Report has been lodged via the the Stamp Interface:\n\n";
$body .= "Reported ID: $id\n";