-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcert.php
45 lines (44 loc) · 1004 Bytes
/
cert.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* This file is similar to auth.php but has been pre_configured to use client
* side certs.
*
* @package phpMyID
* @author Ben Olive <[email protected]>
* @copyright 2010
* @license http://www.gnu.org/licenses/gpl.html GNU Public License
* @version 1.0
*/
session_name('phpMyID_Server');
@session_start();
if ($_SESSION['auth_url']) {
if (isset ($_SERVER['REMOTE_USER'])) {
$_SESSION['cert_cn'] = $_SERVER['REMOTE_USER'];
?>
<html>
<head>
<script type="text/javascript">
window.top.location = "<?= $_SESSION['auth_url'] ?>";
</script>
<head>
</html>
<?php
exit(0);
} else {
// If we got to this page without authenticating, it is not a
// valid auth form and we can skip it.
?>
<html>
<head>
<script type="text/javascript">
window.top.location = "<?= $_SESSION['auth_url'] ?>&skip_cert=true";
</script>
<head>
</html>
<?php
exit(0);
}
} else {
die('You may not access this mode directly.');
}
?>