summaryrefslogtreecommitdiff
path: root/cacert/stamp/certdet.php
blob: a43d2a086b42161cb3cf12639cb63264457e22ca (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<? /*
    LibreSSL - CAcert web application
    Copyright (C) 2004-2008  CAcert Inc.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; version 2 of the License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/
	$org = $invalid = 0;
	$tz = intval($_REQUEST['tz']);
	$now = date("Y-m-d", gmmktime("U") + ($tz * 3600));

	$arr = explode("//", mysql_real_escape_string(trim($_REQUEST['refer'])), 2);
	$arr = explode("/", $arr['1'], 2);
	$ref = $arr['0'];

        $arr = explode("//", mysql_real_escape_string(trim($_SERVER['HTTP_REFERER'])), 2);
        $arr = explode("/", $arr['1'], 2);
        $siteref = $arr['0'];

	if($siteref != "")
		$siterefer = $_SERVER['HTTP_REFERER'];
	else
		$siterefer = $_REQUEST['refer'];

        if($ref == "" || ($ref != $siteref && $siteref != ""))
        {
		$invalid = 2;
        } else {
		if($_SESSION['_stamp']['ref'] == "")
			$_SESSION['_stamp']['ref'] = $siterefer;
		list($invalid, $info) = checkhostname($ref);
	}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>CAcert.org Certificate Details!</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
 <div id="pagecell1">
  <div id="pageName"><br>
    <h2><a href="http<? if($_SERVER['HTTPS']=="on") { echo "s"; } ?>://www.cacert.org">
	<img src="http<? if($_SERVER['HTTPS']=="on") { echo "s"; } ?>://www.cacert.org/images/cacert3.png" border="0" alt="CAcert.org logo"></a></h2>
<? if($_SERVER['HTTPS']!="on") { ?>
<div id="googlead"><br><script type="text/javascript"><!--
google_ad_client = "pub-0959373285729680";
google_alternate_color = "ffffff";
google_ad_width = 234;
google_ad_height = 60;
google_ad_format = "234x60_as";
google_ad_type = "text";
google_ad_channel = "";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>
<? } ?>
  </div>
  <div id="content">
    <div class="story">
      <h3>SSL Certificate Details for <?=$ref?></h3>
<? if($invalid == 0) { ?>
      <p>
	Status: Valid<br />
	Valid From: <?=$info['issued']?> GMT<br />
	Valid To: <?=$info['expire']?> GMT<br />
	Subject: <a href="#" title="<?=$info['subject']?>" onClick="return false;"><?=substr($info['subject'],0,80)?></a><br />
	Organisation: <? if($info['org'] == 0) { ?>N/A<? } else { echo $info['O'].", ".$info['L']." ".$info['ST']." ".$info['C']; } ?><br />
	Verification: <? if($info['points'] >= 50) { echo "Person had been assured at time of issue with at least 50 points."; } 
		else if($info['org'] == 1) { ?>This organisation was assured at the time the certificate was issued.<? } ?></p>
<? } else { ?>
	<p style="color:red">This site has potentially abused CAcert logos and Copyrights, please report it so we may further investigate.</p>
<? } ?>
	<p><a href="report.php">Problem with this site? Please report it</a></p>
    </div>
   </div>
</body>
</html>