<?php } printFooter(); break; case 'del_user_form': printHeader('admin'); ?> <body onLoad="self.focus();document.form.login.focus()"> <form action=<?php echo $PHP_SELF; ?> method=post name=form> <table> <th colspan=2><h3>Remove User</h3></th> <tr><td>User ID</td><td><input type=text name=login value="<?php echo htvar($login); ?> " maxlength=15 size=15></td></tr> </table> <input type=hidden name=stage value=del_user> <input type=submit name=submit value='Submit'> </form> <?php printFooter(); break; case 'del_user': printHeader('admin'); $pwdfile = escapeshellarg($config['passwd_file']); $login = escapeshellarg($login); print 'Results of htpasswd command:<br>'; system("htpasswd -D {$pwdfile} {$login} 2>&1");
<tr> <td>Country</td> <td><input class="btn" type="text" name="country" value="<?php print htvar($country); ?> " size=2 maxlength=2></td> </tr> <tr> <td>Certificate Password </td> <td><input type="password" class="btn" name="passwd" value="<?php print htvar($passwd); ?> " size="30"> Again <input class="btn" type=password name=passwdv value="<?php print htvar($passwdv); ?> " size=30></td> </tr> <tr> <td>Certificate Life </td> <td><select class="btn" name="expiry"> <?php # Fixed bug where certificate life would rever to 1 Month if < 1 Year print "<option value=0.083 " . ($expiry == 0.083 ? "selected='selected'" : "") . " >1 Month</option>\n"; print "<option value=0.25 " . ($expiry == 0.25 ? "selected='selected'" : "") . " >3 Months</option>\n"; print "<option value=0.5 " . ($expiry == 0.5 ? "selected='selected'" : "") . " >6 Months</option>\n"; print "<option value=1 " . ($expiry == 1 ? "selected='selected'" : "") . " >1 Year</option>\n"; for ($i = 2; $i < 6; $i++) { print "<option value={$i} " . ($expiry == $i ? "selected='selected'" : "") . " >{$i} Years</option>\n";
$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') { print ' <a href="' . $PHP_SELF . '?stage=dl-confirm&serial=' . $rec['serial'] . '&' . $qstr_sort . '&' . $qstr_filter . '">' . '<img src="../images/download.png" alt="Download" title="Download the PRIVATE certificate. DO NOT DISTRIBUTE THIS TO THE PUBLIC!"></a> <a href="' . $PHP_SELF . '?stage=revoke-form&serial=' . $rec['serial'] . '&' . $qstr_sort . '&' . $qstr_filter . '">' . '<img src="../images/revoke.png" alt="Revoke" title="Revoke the certificate when the e-mail address is no longer valid or the certificate password or private key has been compromised."></a>'; } print ' <a href="' . $PHP_SELF . '?stage=renew-form&serial=' . $rec['serial'] . '&' . $qstr_sort . '&' . $qstr_filter . '">' . '<img src="../images/view-refresh-th.png" alt="Renew" title="Renew the certificate by revoking it, if necessary, and creating a replacement with a new expiration date."></a></td></tr>'; } ?> </table> </div> <?php printFooter(); }
"> </form> <?php printFooter(); break; default: printHeader('public'); ?> <body onLoad="self.focus();document.search.search.focus()"> <center><h2>Certificate Search</h2> <form action=<?php echo $PHP_SELF; ?> method=post name=search> <input type=text name=search value="<?php echo htvar($search); ?> " maxlength=60 size=40> <input type=submit name=submit value="Find It!"><br> <input type=checkbox name=show_valid value="V" <?php echo $show_valid ? 'checked' : ''; ?> >Valid <input type=checkbox name=show_revoked value="R" <?php echo $show_revoked ? 'checked' : ''; ?> >Revoked <input type=checkbox name=show_expired value="E" <?php echo $show_expired ? 'checked' : ''; ?> >Expired
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') { print ' <a href="' . $PHP_SELF . '?stage=dl-confirm&serial=' . $rec[serial] . '&' . $qstr_sort . '&' . $qstr_filter . '">' . '<img src=../images/download.png alt="Download" title="Download the PRIVATE certificate. DO NOT DISTRIBUTE THIS TO THE PUBLIC!"></a> <a href="' . $PHP_SELF . '?stage=revoke-form&serial=' . $rec[serial] . '&' . $qstr_sort . '&' . $qstr_filter . '">' . '<img src=../images/revoke.png alt="Revoke" title="Revoke the certificate when the e-mail address is no longer valid or the certificate password or private key has been compromised."></a>'; } print ' <a href="' . $PHP_SELF . '?stage=renew-form&serial=' . $rec[serial] . '&' . $qstr_sort . '&' . $qstr_filter . '">' . '<img src=../images/renew.png alt="Renew" title="Renew the certificate by revoking it, if necessary, and creating a replacement with a new expiration date."></a></td></tr>'; } print '</table>'; printFooter(); }
</form> </div> <?php printFooter(); break; default: printHeader('public'); ?> <body onLoad="self.focus();document.search.search.focus()"> <div style="text-align:center"><h2>Certificate Search</h2> <form action="<?php print $PHP_SELF; ?> " method="post" name="search"> <input type="text" name="search" value="<?php print htvar($search); ?> " maxlength="60" size="40"> <input type="submit" name="submit" value="Find It!"><br> <input type="checkbox" name="show_valid" value="V" <?php print $show_valid ? 'checked' : ''; ?> >Valid <input type="checkbox" name="show_revoked" value="R" <?php print $show_revoked ? 'checked' : ''; ?> >Revoked <input type="checkbox" name="show_expired" value="E" <?php print $show_expired ? 'checked' : ''; ?> >Expired
printHeader('ca'); ?> <br><br> <table class="menu" style="width:80%"> <tr> <th colspan="2"><h2>OpenVPN Client Configuration</h2></th> </tr> </table> <div style="text-align:center;"> <span><br> This is the template used by PHPki to generate the OpenVPN config file.<br> All users in possession of a valid certificate also need the config file to connect to our VPN.<br> Edit if you know what you're doing.<br><br> <form id="openvpn_edit_settings" action="" method="post" style="display:inline"> <textarea id="openvpn_client_cnf_text" name="txtarea" cols="40" rows="20" style="background:#DEE3EC" readonly><?php print htvar($openvpn_client_cnf); ?> </textarea> <br><br> <button class="btn" value="Edit" onclick="return hitEdit('openvpn_client_cnf_text');">Edit</button> <input type="submit" class="btn" name="submit" value="Save" onclick="return hitSave('openvpn_client_cnf_text');"> </form> </span> <span> <a href="<?php echo back_link(); ?> "><button class="btn">Go Back</button></a> </span></div> <?php
print '<option value="server" ' . ($cert_type == 'server' ? 'selected' : '') . '>SSL Server</option>'; print '<option value="vpn_client" ' . ($cert_type == 'vpn_client' ? 'selected' : '') . '>VPN Client Only</option>'; print '<option value="vpn_server" ' . ($cert_type == 'vpn_server' ? 'selected' : '') . '>VPN Server Only</option>'; print '<option value="vpn_client_server" ' . ($cert_type == 'vpn_client_server' ? 'selected' : '') . '>VPN Client, VPN Server</option>'; print '<option value="time_stamping" ' . ($cert_type == 'time_stamping' ? 'selected' : '') . '>Time Stamping</option>'; ?> </select></td> </tr> <tr id="testrow2" name="testrow2" style="visibility:hidden;display:none;"> <td>Alternative DNS Names<br>(only one per Line)</td><td><textarea name=dns_names cols=30 rows=5><?php echo htvar($dns_names); ?> </textarea></td> </tr> <tr id="testrow1" name="testrow1" style="visibility:hidden;display:none;"> <td>IP's<br>(only one per Line)</td><td><textarea name=ip_addr cols=30 rows=5><?php echo htvar($ip_addr); ?> </textarea></td> </tr> <tr> <td><center><input type=submit name=submit value='Submit Request'></center><input type=hidden name=form_stage value='validate'></td><td><font color=red size=3>* Fields are required</td> </tr> </table> </form> <?php printFooter(); }