bug 1131: Updated Policies based on new versions send by Policy Officer
[cacert-devel.git] / stamp / certdet.php
1 <? /*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 $org = $invalid = 0;
19 $tz = intval($_REQUEST['tz']);
20 $now = date("Y-m-d", gmmktime("U") + ($tz * 3600));
21
22 $arr = explode("//", mysql_real_escape_string(trim($_REQUEST['refer'])), 2);
23 $arr = explode("/", $arr['1'], 2);
24 $ref = $arr['0'];
25
26 $arr = explode("//", mysql_real_escape_string(trim($_SERVER['HTTP_REFERER'])), 2);
27 $arr = explode("/", $arr['1'], 2);
28 $siteref = $arr['0'];
29
30 if($siteref != "")
31 $siterefer = $_SERVER['HTTP_REFERER'];
32 else
33 $siterefer = $_REQUEST['refer'];
34
35 if($ref == "" || ($ref != $siteref && $siteref != ""))
36 {
37 $invalid = 2;
38 } else {
39 if($_SESSION['_stamp']['ref'] == "")
40 $_SESSION['_stamp']['ref'] = $siterefer;
41 list($invalid, $info) = checkhostname($ref);
42 }
43 ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
44 <html>
45 <head>
46 <title>CAcert.org Certificate Details!</title>
47 <link rel="stylesheet" href="style.css" type="text/css">
48 </head>
49 <body>
50 <div id="pagecell1">
51 <div id="pageName"><br>
52 <h2><a href="http<? if($_SERVER['HTTPS']=="on") { echo "s"; } ?>://www.cacert.org">
53 <img src="http<? if($_SERVER['HTTPS']=="on") { echo "s"; } ?>://www.cacert.org/images/cacert3.png" border="0" alt="CAcert.org logo"></a></h2>
54 <? if($_SERVER['HTTPS']!="on") { ?>
55 <div id="googlead"><br><script type="text/javascript"><!--
56 google_ad_client = "pub-0959373285729680";
57 google_alternate_color = "ffffff";
58 google_ad_width = 234;
59 google_ad_height = 60;
60 google_ad_format = "234x60_as";
61 google_ad_type = "text";
62 google_ad_channel = "";
63 //--></script>
64 <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>
65 <? } ?>
66 </div>
67 <div id="content">
68 <div class="story">
69 <h3>SSL Certificate Details for <?=$ref?></h3>
70 <? if($invalid == 0) { ?>
71 <p>
72 Status: Valid<br />
73 Valid From: <?=$info['issued']?> GMT<br />
74 Valid To: <?=$info['expire']?> GMT<br />
75 Subject: <a href="#" title="<?=$info['subject']?>" onClick="return false;"><?=substr($info['subject'],0,80)?></a><br />
76 Organisation: <? if($info['org'] == 0) { ?>N/A<? } else { echo $info['O'].", ".$info['L']." ".$info['ST']." ".$info['C']; } ?><br />
77 Verification: <? if($info['points'] >= 50) { echo "Person had been assured at time of issue with at least 50 points."; }
78 else if($info['org'] == 1) { ?>This organisation was assured at the time the certificate was issued.<? } ?></p>
79 <? } else { ?>
80 <p style="color:red">This site has potentially abused CAcert logos and Copyrights, please report it so we may further investigate.</p>
81 <? } ?>
82 <p><a href="report.php">Problem with this site? Please report it</a></p>
83 </div>
84 </div>
85 </body>
86 </html>