summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-05-01 00:52:27 +0200
committerINOPIAE <inopiae@cacert.org>2013-05-01 00:52:27 +0200
commita7e362a25081b2aaf5069f52c79ffec96109e132 (patch)
treedc41c36d5f93bc16da74f174220e1848afbabfd9 /includes
parent8c4068f534f61c53d113ad443ead6277eb8a874c (diff)
downloadcacert-devel-a7e362a25081b2aaf5069f52c79ffec96109e132.tar.gz
cacert-devel-a7e362a25081b2aaf5069f52c79ffec96109e132.tar.xz
cacert-devel-a7e362a25081b2aaf5069f52c79ffec96109e132.zip
bug 893: fixed query for check_certificates
Diffstat (limited to 'includes')
-rw-r--r--includes/temp_functions.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/includes/temp_functions.php b/includes/temp_functions.php
index e7a111a..23a9acd 100644
--- a/includes/temp_functions.php
+++ b/includes/temp_functions.php
@@ -172,7 +172,7 @@ function check_gpg_cert_running($uid,$cca=0){
if (0==$cca) {
$query = "select * from `gpg` where `memid`='$uid' and `expire`>NOW()";
}else{
- $query = "select * from `gpg` where `memid`='$uid' and `expire`>NOW()-90*86400";
+ $query = "select * from `gpg` where `memid`='$uid' and `expire`>(NOW()-90*86400)";
}
$res = mysql_query($query);
return mysql_num_rows($res) > 0;
@@ -183,11 +183,11 @@ function check_client_cert_running($uid,$cca=0){
// called from includes/account.php if($oldid == 50 && $process != "")
$uid = intval($uid);
if (0==$cca) {
- $query1 = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()";
- $query2 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()";
+ $query1 = "select 1 from `emailcerts` where `memid`='$uid' and `expire`>NOW()";
+ $query2 = "select 1 from `emailcerts` where `memid`='$uid' and `revoked`>NOW()";
}else{
- $query1 = "select from `emailcerts` where `memid`='$uid' and `expire`>NOW()-90*86400";
- $query2 = "select from `emailcerts` where `memid`='$uid' and `revoked`>NOW()-90*86400";
+ $query1 = "select 1 from `emailcerts` where `memid`='$uid' and `expire`>(NOW()-90*86400)";
+ $query2 = "select 1 from `emailcerts` where `memid`='$uid' and `revoked`>(NOW()-90*86400)";
}
$res = mysql_query($query1);
$r1 = mysql_num_rows($res)>0;
@@ -201,11 +201,11 @@ function check_server_cert_running($uid,$cca=0){
// called from includes/account.php if($oldid == 50 && $process != "")
$uid = intval($uid);
if (0==$cca) {
- $query1 = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()";
- $query2 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()";
+ $query1 = "select 1 from `domiancerts` where `memid`='$uid' and `expire`>NOW()";
+ $query2 = "select 1 from `domiancerts` where `memid`='$uid' and `revoked`>NOW()";
}else{
- $query1 = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()-90*86400";
- $query2 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()-90*86400";
+ $query1 = "select 1 from `domiancerts` where `memid`='$uid' and `expire`>(NOW()-90*86400)";
+ $query2 = "select 1 from `domiancerts` where `memid`='$uid' and `revoked`>(NOW()-90*86400)";
}
$res = mysql_query($query1);
$r1 = mysql_num_rows($res)>0;
@@ -216,7 +216,7 @@ function check_server_cert_running($uid,$cca=0){
function check_is_orgadmin($uid){
// called from includes/account.php if($oldid == 50 && $process != "")
$uid = intval($uid);
- $query = "select * from `org` where `memid`='$uid' and `deleted`=0";
+ $query = "select 1 from `org` where `memid`='$uid' and `deleted`=0";
$res = mysql_query($query);
return mysql_num_rows($res) > 0;
}