diff options
author | INOPIAE <inopiae@cacert.org> | 2014-01-26 11:42:34 +0100 |
---|---|---|
committer | INOPIAE <inopiae@cacert.org> | 2014-01-26 11:42:34 +0100 |
commit | 54e587272a8da664594aef2ed5f04e976a475c25 (patch) | |
tree | 3554b05e87aecc0edbb00943353a34d7f7675303 /includes | |
parent | 5742f878f6b47785378fa1ff570eea5da1b80bb1 (diff) | |
download | cacert-devel-54e587272a8da664594aef2ed5f04e976a475c25.tar.gz cacert-devel-54e587272a8da664594aef2ed5f04e976a475c25.tar.xz cacert-devel-54e587272a8da664594aef2ed5f04e976a475c25.zip |
bug 550: added output for org server certifcatesbug-550
Diffstat (limited to 'includes')
-rw-r--r-- | includes/notary.inc.php | 124 |
1 files changed, 122 insertions, 2 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 337d8d5..03bf92e 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -1342,7 +1342,7 @@ function output_orgclientcert_table_header($orgname){ <? } -function output_orgclient_table_row($verified, $row, $support = 0){ +function output_orgclientcert_table_row($verified, $row, $support = 0){ ?> <tr> <td class="DataTD"><?=$row['ou']?></td> @@ -1379,7 +1379,7 @@ function output_orgclient_table_row($verified, $row, $support = 0){ <? } -function output_orgclient_table_footer($support = 0){ +function output_orgclientcert_table_footer($support = 0){ ?> <tr> <td class="DataTD" colspan="11"> @@ -1397,3 +1397,123 @@ function output_orgclient_table_footer($support = 0){ </tr> <? } } + + +function output_orgservercerts_data($orgadminid = 0, $orgfilterid = 0, $sorting, $status){ + $query = "select UNIX_TIMESTAMP(`orgdomaincerts`.`created`) as `created`, + UNIX_TIMESTAMP(`orgdomaincerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`, + UNIX_TIMESTAMP(`orgdomaincerts`.`expire`) as `expired`, + `orgdomaincerts`.`expire` as `expires`, `revoked` as `revoke`, + UNIX_TIMESTAMP(`revoked`) as `revoked`, `CN`, + `orgdomaincerts`.`serial`, + `orgdomaincerts`.`id` as `id`, + `orgdomaincerts`.`description`, `orginfo`.`O`, + `cu`.`fname` as cfname, `cu`.`lname` as clname , + `ru`.`fname` as rfname, `ru`.`lname` as rlname + from `org`, `orginfo`, `orgdomaincerts` + left join users as `cu` on `orgdomaincerts`.`orgadminid` = `cu`.`id` + left join users as `ru` on `orgdomaincerts`.`revokeorgadminid` = `ru`.`id` + where `org`.`orgid`=`orgdomaincerts`.`orgid` and `orginfo`.`id` = `org`.`orgid` "; + + if($orgadminid > 0) + { + $query .= "AND `org`.`memid` = $orgadminid "; + } + + if($orgfilterid > 0) + { + $query .= "AND `org`.`orgid` = $orgfilterid "; + } + + if(0 == $status) + { + $query .= "AND `oemail`.`revoked`=0 AND `orgdomaincerts`.`renewed`=0 "; + $query .= "HAVING `timeleft` > 0 AND `revoked`=0 "; + } + switch ($sorting){ + case 0: + $query .= "ORDER BY `orginfo`.`O`, `orgdomaincerts`.`expire` desc"; + break; + case 1: + $query .= "ORDER BY `orginfo`.`O`, `orgdomaincerts`.`CN`, `orgdomaincerts`.`expire` desc"; + break; + } + return mysql_query($query); +} + +function output_orgservercert_table_header($orgname){ + ?> + <tr> + <td colspan="10" class="title"></td> + </tr> + <tr> + <td colspan="10" class="title"><? printf(_("Certificates for %s"), $orgname)?> </td> + </tr> + <tr> + <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td> + <td class="DataTD"><?=_("Status")?></td> + <td class="DataTD"><?=_("CommonName")?></td> + <td class="DataTD"><?=_("SerialNumber")?></td> + <td class="DataTD"><?=_("Created by")?></td> + <td class="DataTD"><?=_("Revoked")?></td> + <td class="DataTD"><?=_("Revoked by")?></td> + <td class="DataTD"><?=_("Expires")?></td> + <td colspan="2" class="DataTD"><?=_("Comment *")?></td> + </tr> + <? +} + +function output_orgservercert_table_row($verified, $row, $support = 0){ + ?> + <tr> + <? if($verified == _("Valid") || $verified == _("Expired")) { ?> + <td class="DataTD"><input type="checkbox" name="revokeid[]" value="<?=$row['id']?>"></td> + <td class="DataTD"><?=$verified?></td> + <td class="DataTD"><a href="account.php?id=23&cert=<?=$row['id']?>"><?=$row['CN']?></a></td> + <? } elseif($support == 1) { ?> + <td class="DataTD"> </td> + <td class="DataTD"><?=$verified?></td> + <td class="DataTD"><?=$row['CN']?></td> + <? } else if($verified == _("Pending")) { ?> + <td class="DataTD"><input type="checkbox" name="delid[]" value="<?=$row['id']?>"></td> + <td class="DataTD"><?=$verified?></td> + <td class="DataTD"><?=$row['CN']?></td> + <? } else { ?> + <td class="DataTD"> </td> + <td class="DataTD"><?=$verified?></td> + <td class="DataTD"><a href="account.php?id=23&cert=<?=$row['id']?>"><?=$row['CN']?></a></td> + <? } ?> + <td class="DataTD"><?=$row['serial']?></td> + <td class="DataTD"><?=$row['cfname'] . ' ' . $row['clname']?></td> + <td class="DataTD"><?=$row['revoke']?></td> + <td class="DataTD"><?=$row['rfname'] . ' ' . $row['rlname']?></td> + <td class="DataTD"><?=$row['expires']?></td> + <? if($support == 1) { ?> + <td class="DataTD"><?=htmlspecialchars($row['description'])?></td> + <td class="DataTD"> </td> + <? } else { ?> + <td class="DataTD"><input name="comment_<?=$row['id']?>" type="text" value="<?=htmlspecialchars($row['description'])?>" /></td> + <td class="DataTD"><input type="checkbox" name="check_comment_<?=$row['id']?>" /></td> + <? } ?> + </tr> + <? +} + +function output_orgservercert_table_footer($support = 0){ + ?> + <tr> + <td class="DataTD" colspan="10"> + <?=_('* Comment is NOT included in the certificate as it is intended for your personal reference only. To change the comment tick the checkbox and hit "Change Settings".')?> + </td> + </tr> + <? if ($support == 0) { ?> + <tr> + <td class="DataTD" colspan="7"><input type="submit" name="renew" value="<?=_("Renew")?>">     + <input type="submit" name="revoke" value="<?=_("Revoke/Delete")?>"></td> + <td class="DataTD" colspan="3"><input type="submit" name="change" value="<?=_("Change settings")?>"> </td> + </tr> + <tr> + <td class="DataTD" colspan="10"><?=_("From here you can delete pending requests, or revoke valid certificates.")?></td> + </tr> + <? } +} |