-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuserAuth.php
25 lines (24 loc) · 1.1 KB
/
userAuth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script>
if ($('#sslalert').text() !== "") {
alert($( "#dialog" ).text());
}
</script>
<div id="dialog" title="User Certificate Needed" style="display: none;" >WebFTS needs a valid user certificate installed in your browser.</div>
<div class="navbar-left">
<?php
if (!isset($_SERVER['SSL_CLIENT_M_SERIAL'])
|| !isset($_SERVER['SSL_CLIENT_V_END'])
|| !isset($_SERVER['SSL_CLIENT_VERIFY'])
|| $_SERVER['SSL_CLIENT_VERIFY'] !== 'SUCCESS'
|| !isset($_SERVER['SSL_CLIENT_I_DN'])
)
{
echo "<div id='sslalert'><span><strong>You are not providing a user certificate</strong></span></div>";
}
elseif (isset($_SERVER['SSL_CLIENT_S_DN_CN_2'])) {
echo "<div id='auth'><span>You are authenticated as <strong>{$_SERVER['SSL_CLIENT_S_DN_CN_2']}</strong></span></div>";
} elseif ($_SERVER['SSL_CLIENT_S_DN_CN']) {
echo "<div id ='auth'><span>You are authenticated as <strong>{$_SERVER['SSL_CLIENT_S_DN_CN']}</strong></span></div>";
}
?>
</div>