Ejemplo n.º 1
0
<?php

include '../config.php';
include STORE_DIR . '/config/config.php';
include '../include/my_functions.php';
include '../include/common.php';
$stage = gpvar('stage');
$login = gpvar('login');
$passwd = gpvar('passwd');
$passwdv = gpvar('passwdv');
switch ($stage) {
    case 'list_users':
        printHeader('admin');
        print '<p><h3>Contents of ' . htvar($config['passwd_file']) . ' file:</h3><pre>';
        readfile($config['passwd_file']);
        ?>
	</pre>
	<form action=<?php 
        echo $PHP_SELF;
        ?>
 method=post>
	<input type=submit name=submit value="Back to Menu">
	</form>
	<?php 
        printFooter(false);
        break;
    case 'add_user_form':
        printHeader('admin');
        ?>
	<body onLoad="self.focus();document.form.login.focus()">
	<form action=<?php 
Ejemplo n.º 2
0
include STORE_DIR . '/config/config.php';
include '../include/my_functions.php';
include '../include/common.php';
include '../include/openssl_functions.php';
$stage = gpvar('stage');
$serial = gpvar('serial');
$sortfield = gpvar('sortfield');
$ascdec = gpvar('ascdec');
$passwd = gpvar('passwd');
$expiry = gpvar('expiry');
$submit = gpvar('submit');
$dl_type = gpvar('dl_type');
$search = gpvar('search');
$show_valid = gpvar('show_valid');
$show_revoked = gpvar('show_revoked');
$show_expired = gpvar('show_expired');
# Prevent handling certs that don't belong to user
if ($serial && CAdb_issuer($serial) != $PHPki_user && !in_array($PHPki_user, $PHPki_admins)) {
    $stage = 'goaway';
}
if (!($show_valid . $show_revoked . $show_expired)) {
    $show_valid = 'V';
    $show_revoked = 'R';
    $show_expired = 'E';
}
$qstr_filter = 'search=' . htvar($search) . '&' . "show_valid={$show_valid}&" . "show_revoked={$show_revoked}&" . "show_expired={$show_expired}&";
$qstr_sort = "sortfield={$sortfield}&ascdec={$ascdec}";
switch ($stage) {
    case 'goaway':
        printHeader(false);
        ?>
Ejemplo n.º 3
0
#if (isset($_GET['unit']) || isset($_POST['unit']))
$unit = gpvar('unit');
#if (isset($_GET['common_name']) || isset($_POST['common_name']))
$common_name = gpvar('common_name');
#if (isset($_GET['email']) || isset($_POST['email']))
$email = gpvar('email');
#if (isset($_GET['passwd']) || isset($_POST['passwd']))
$passwd = gpvar('passwd');
#if (isset($_GET['passwdv']) || isset($_POST['passwdv']))
$passwdv = gpvar('passwdv');
#if (isset($_GET['expiry']) || isset($_POST['expiry']))
$expiry = gpvar('expiry');
#if (isset($_GET['keysize']) || isset($_POST['keysize']))
$keysize = gpvar('keysize');
#if (isset($_GET['cert_type']) || isset($_POST['cert_type']))
$cert_type = gpvar('cert_type');
# To repopulate the fields in the form after error.
$hidden_fields = '
    <input type="hidden" name="country" value="' . htvar($country) . '">
    <input type="hidden" name="province" value="' . htvar($province) . '">
    <input type="hidden" name="locality" value="' . htvar($locality) . '">
    <input type="hidden" name="organization" value="' . htvar($organization) . '">
    <input type="hidden" name="unit" value="' . htvar($unit) . '">
    <input type="hidden" name="common_name" value="' . htvar($common_name) . '">
    <input type="hidden" name="email" value="' . htvar($email) . '">
    <input type="hidden" name="passwd" value="' . htvar($passwd) . '">
    <input type="hidden" name="passwdv" value="' . htvar($passwdv) . '">
    <input type="hidden" name="expiry" value="' . htvar($expiry) . '">
    <input type="hidden" name="keysize" value="' . htvar($keysize) . '">
    <input type="hidden" name="cert_type" value="' . htvar($cert_type) . '">
';
Ejemplo n.º 4
0
<?php

include "../config.php";
include STORE_DIR . '/config/config.php';
include "../include/my_functions.php";
include "../include/common.php";
include "../include/openssl_functions.php";
$stage = gpvar('stage');
switch ($stage) {
    case 'dl_root':
        upload($config['cacert_pem'], $config['ca_prefix'] . "cacert.crt", 'application/x-x509-ca-cert');
        break;
    case 'dl_crl':
        upload($config['cacrl_der'], $config['ca_prefix'] . "cacrl.crl", 'application/pkix-crl');
        break;
    case 'gen_crl':
        list($ret, $errtxt) = CA_generate_crl();
        printHeader(false);
        if ($ret) {
            ?>
                <div style="text-align:center"><h2>Certificate Revocation List Updated</h2></div>
                <p>
                <form action="<?php 
            echo $PHP_SELF;
            ?>
" method="post">
                <input type="submit" name="submit" value="Back to Menu">
                </form>
                <?php 
            print '<pre>' . CA_crl_text() . '</pre>';
        } else {
Ejemplo n.º 5
0
$form_stage = gpvar('form_stage');
$submit = gpvar('submit');
$country = gpvar('country');
$province = gpvar('province');
$locality = gpvar('locality');
$organization = gpvar('organization');
$unit = gpvar('unit');
$common_name = gpvar('common_name');
$email = gpvar('email');
$passwd = gpvar('passwd');
$passwdv = gpvar('passwdv');
$expiry = gpvar('expiry');
$keysize = gpvar('keysize');
$cert_type = gpvar('cert_type');
$dns_names = gpvar('dns_names');
$ip_addr = gpvar('ip_addr');
# To repopulate form after error.
$hidden_fields = '
    <input type=hidden name=country value="' . htvar($country) . '">
    <input type=hidden name=province value="' . htvar($province) . '">
    <input type=hidden name=locality value="' . htvar($locality) . '">
    <input type=hidden name=organization value="' . htvar($organization) . '">
    <input type=hidden name=unit value="' . htvar($unit) . '">
    <input type=hidden name=common_name value="' . htvar($common_name) . '">
    <input type=hidden name=email value="' . htvar($email) . '">
    <input type=hidden name=passwd value="' . htvar($passwd) . '">
    <input type=hidden name=passwdv value="' . htvar($passwdv) . '">
    <input type=hidden name=expiry value="' . htvar($expiry) . '">
    <input type=hidden name=keysize value="' . htvar($keysize) . '">
    <input type=hidden name=cert_type value="' . htvar($cert_type) . '">
    <input type=hidden name=dns_names value="' . htvar($dns_names) . '">
Ejemplo n.º 6
0
<?php

include '../config.php';
include STORE_DIR . '/config/config.php';
include '../include/my_functions.php';
$openvpn_client_cnf = gpvar('txtarea');
$fd = fopen($config['openvpn_client_cnf_dir'] . '/general_client.conf', 'wb');
fwrite($fd, $openvpn_client_cnf);
fclose($fd);