summaryrefslogtreecommitdiff
path: root/includes/temp_functions.php
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-01-16 20:43:39 +0100
committerINOPIAE <inopiae@cacert.org>2013-01-16 20:43:39 +0100
commit89cdb66cf73a70fd67c5aeadb614a08d84314fde (patch)
treee78d2d27f36359cc94bf7e55b4f82a225c5b17da /includes/temp_functions.php
parent2a10ade8665af5ed4444dd7ec09a304fa6d0a1c6 (diff)
downloadcacert-devel-89cdb66cf73a70fd67c5aeadb614a08d84314fde.tar.gz
cacert-devel-89cdb66cf73a70fd67c5aeadb614a08d84314fde.tar.xz
cacert-devel-89cdb66cf73a70fd67c5aeadb614a08d84314fde.zip
bug 893: added check for orgadmin and revokation of cert
Diffstat (limited to 'includes/temp_functions.php')
-rw-r--r--includes/temp_functions.php24
1 files changed, 7 insertions, 17 deletions
diff --git a/includes/temp_functions.php b/includes/temp_functions.php
index d7b4757..f42b1a1 100644
--- a/includes/temp_functions.php
+++ b/includes/temp_functions.php
@@ -175,7 +175,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()";
+ $query = "select * from `gpg` where `memid`='$uid' and `expire`>NOW()+90*86400";
}
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
@@ -194,8 +194,8 @@ function check_client_cert_running($uid,$cca=0){
$query = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()";
$query1 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()";
}else{
- $query = "select from `emailcerts` where `memid`='$uid' and `expire`>NOW()";
- $query1 = "select from `emailcerts` where `memid`='$uid' and `revoked`>NOW()";
+ $query = "select from `emailcerts` where `memid`='$uid' and `expire`>NOW()+90*86400";
+ $query1 = "select from `emailcerts` where `memid`='$uid' and `revoked`>NOW()+90*86400";
}
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
@@ -211,13 +211,7 @@ function check_client_cert_running($uid,$cca=0){
}else{
$r2=false;
}
- if(true==$r1 || true==$r2)
- {
- return true;
- }else{
- return false;
- }
-
+ return !!($a || $b);
}
function check_server_cert_running($uid,$cca=0){
@@ -227,8 +221,8 @@ function check_server_cert_running($uid,$cca=0){
$query = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()";
$query1 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()";
}else{
- $query = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()";
- $query1 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()";
+ $query = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()+90*86400";
+ $query1 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()+90*86400";
}
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
@@ -245,11 +239,7 @@ function check_server_cert_running($uid,$cca=0){
$r2=false;
}
if(true==$r1 || true==$r2)
- {
- return true;
- }else{
- return false;
- }
+ return !!($a || $b);
}
function check_is_orgadmin($uid){
// called from includes/account.php if($oldid == 50 && $process != "")