Exemple #1
0
        foreach ($headings as $field => $head) {
            print '<th><a href="' . $PHP_SELF . '?sortfield=' . $field . '&ascdec=A&' . $qstr_filter . '" title="Click to sort by this column."><u>' . $head . '</u></a>';
            if ($sortfield == $field) {
                print '&nbsp<a href="' . $PHP_SELF . '?sortfield=' . $field . '&ascdec=' . $ht_ascdec . '&' . $qstr_filter . '" >' . '<img src=' . $arrow_gif . ' height=12 alt=\'Change sort order.\' title=\'Click to reverse sort order.\'></a>';
            }
            print '</th>';
        }
        print '<th><a href="" title="Pick an action to perform to certificate.">Action</a></th>';
        print '</tr>';
        $x = "^[{$show_valid}{$show_revoked}{$show_expired}]";
        if (in_array($PHPki_user, $PHPki_admins)) {
            $x = "{$x}.*{$search}";
        } else {
            $x = "{$x}.*{$search}.*{$PHPki_user}|{$x}.*{$PHPki_user}.*{$search}";
        }
        $db = csort(CAdb_to_array($x), $sortfield, $ascdec == 'A' ? SORT_ASC : SORT_DESC);
        $stcolor = array('Valid' => 'green', 'Revoked' => 'red', 'Expired' => 'orange');
        foreach ($db as $rec) {
            print '<tr style="font-size: 11px;">
			 <td><font color=' . $stcolor[$rec['status']] . '><b>' . $rec['status'] . '</b></font></td>
			 <td style="white-space: nowrap">' . $rec['issued'] . '</td>
			 <td style="white-space: nowrap">' . $rec['expires'] . '</td>
			 <td>' . $rec['common_name'] . '</td>
			 <td style="white-space: nowrap">
				<a href="mailto:' . htvar($rec['common_name']) . ' <' . htvar($rec['email']) . '>" >' . htvar($rec['email']) . '</a>
			 </td>
			 <td>' . htvar($rec['organization']) . '</td>
			 <td>' . htvar($rec['unit']) . '</td>
			 <td>' . htvar($rec['locality']) . '</td>
			 <td><a href="' . $PHP_SELF . '?stage=display&serial=' . $rec['serial'] . '" target="_certdisp">' . '<img src="../images/display.png" alt="Display" title="Display complete certificate details."></a>';
            if ($rec['status'] == 'Valid') {
Exemple #2
0
        printHeader('about');
        print '
	<center><h2>Certificate Details</h2></center>
	<center><font color=#0000AA><h3>(#' . htvar($serial) . ')<br>' . htvar(CA_cert_cname($serial) . ' <' . CA_cert_email($serial) . '>') . '</h3></font></center>';
        if ($revoke_date = CAdb_is_revoked($serial)) {
            print '<center><font color=red><h2>REVOKED ' . htvar($revoke_date) . '</h2></font></center>';
        }
        print '<pre>' . htvar(CA_cert_text($serial)) . '</pre>';
        break;
    case 'download':
        $rec = CAdb_get_entry($serial);
        upload("{$config['cert_dir']}/{$serial}.der", "{$rec['common_name']} ({$rec['email']}).cer", 'application/pkix-cert');
        break;
    case search:
        printHeader('public');
        $db = CAdb_to_array("^[{$show_valid}{$show_revoked}{$show_expired}].*{$search}");
        print '<body onLoad="self.focus();document.form.submit.focus()">';
        if (sizeof($db) == 0) {
            ?>
		<center>
		<h2>Nothing Found</h2>
		<form action=<?php 
            echo $PHP_SELF;
            ?>
 method=post name=form>
		<input type=hidden name=search value="<?php 
            echo htvar($search);
            ?>
">
		<input type=hidden name=show_valid value="<?php 
            echo htvar($show_valid);