Beispiel #1
0
<?php 
include '../database-methods.php';
#$authorized_users = ["Paula","Darja","*****@*****.**"];
$authorized_users = DBTrgovina::getAdmin();
$client_cert = filter_input(INPUT_SERVER, "SSL_CLIENT_CERT");
if ($client_cert == null) {
    die('err: Spremenljivka SSL_CLIENT_CERT ni nastavljena.');
}
$cert_data = openssl_x509_parse($client_cert);
$commonname = is_array($cert_data['subject']['emailAddress']) ? $cert_data['subject']['emailAddress'][0] : $cert_data['subject']['emailAddress'];
if (in_array($commonname, $authorized_users)) {
    ?>
        <html>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <title>Spletna trgovina</title>
            </head>
            <body>
                <p>Pozdravljen administrator, za nadaljevanje se prijavite spodaj.</p>
                <?php 
    #chdir("netbeans/spletna_trgovina");
    #system("cd ..");
    ?>
                <h3><a href=<?php 
    echo "../get-prijava-vsi.php?&funkcija=administrator";
    ?>
>Prijava administrator</a></h3>