summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2014-04-07 18:49:04 +0200
committerMichael Tänzer <neo@nhng.de>2014-04-07 18:49:04 +0200
commited5cb34b88aa4e3c664db86ae65f475895720bfa (patch)
treed8857711e9298fad42c39a7e6363125e20e95a12
parentcc6de7e119451494960466770d142a363b444f4d (diff)
downloadcacert-devel-ed5cb34b88aa4e3c664db86ae65f475895720bfa.tar.gz
cacert-devel-ed5cb34b88aa4e3c664db86ae65f475895720bfa.tar.xz
cacert-devel-ed5cb34b88aa4e3c664db86ae65f475895720bfa.zip
bug 1138: Use blocks in if clauses and make logic explicit
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--includes/notary.inc.php48
1 files changed, 33 insertions, 15 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index d9fa37b..56d5755 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1668,16 +1668,22 @@ function output_client_cert_header($support=0, $readonly=true){
function output_client_cert($row, $support=0, $readonly=true){
//should be entered in account/5.php
$verified="";
- if($row['timeleft'] > 0)
+ if ($row['timeleft'] > 0) {
$verified = _("Valid");
- if($row['timeleft'] <= 0)
+ } else {
$verified = _("Expired");
- if($row['expired'] == 0)
+ }
+
+ if ($row['expired'] == 0) {
$verified = _("Pending");
- if($row['revoked'] > 0)
- $verified = _("Revoked");
- if($row['revoked'] == 0)
+ }
+
+ if ($row['revoked'] == 0) {
$row['revoke'] = _("Not Revoked");
+ } else {
+ $verified = _("Revoked");
+ }
+
?>
<tr>
<?
@@ -1791,16 +1797,23 @@ function output_server_certs_header($support=0, $readonly=true){
*/
function output_server_certs($row, $support=0, $readonly=true){
//should be entered in account/12.php
- if($row['timeleft'] > 0)
+ $verified="";
+ if ($row['timeleft'] > 0) {
$verified = _("Valid");
- if($row['timeleft'] <= 0)
+ } else {
$verified = _("Expired");
- if($row['expired'] == 0)
+ }
+
+ if ($row['expired'] == 0) {
$verified = _("Pending");
- if($row['revoked'] > 0)
- $verified = _("Revoked");
- if($row['revoked'] == 0)
+ }
+
+ if ($row['revoked'] == 0) {
$row['revoke'] = _("Not Revoked");
+ } else {
+ $verified = _("Revoked");
+ }
+
?>
<tr>
<?
@@ -1900,12 +1913,17 @@ function output_gpg_certs_header($support=0, $readonly=true){
*/
function output_gpg_certs($row, $support=0, $readonly=true){
//should be entered in account/55.php
- if($row['timeleft'] > 0)
+ $verified="";
+ if ($row['timeleft'] > 0) {
$verified = _("Valid");
- if($row['timeleft'] <= 0)
+ } else {
$verified = _("Expired");
- if($row['expired'] == 0)
+ }
+
+ if ($row['expired'] == 0) {
$verified = _("Pending");
+ }
+
?>
<tr>
<td class="DataTD"><?=$verified?></td>