First commit of tag changes. bug-1444
[cacert-devel.git] / pages / account / 23.php
1 <?php /*
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 <?php $certid = 0; if(array_key_exists('cert',$_REQUEST)) $certid=intval($_REQUEST['cert']);
19
20 $query = "select * from `orgdomaincerts`,`org` where `orgdomaincerts`.`id`='$certid' and
21 `org`.`memid`='".intval($_SESSION['profile']['id'])."' and
22 `org`.`orgid`=`orgdomaincerts`.`orgid`";
23 $res = mysql_query($query);
24 if(mysql_num_rows($res) <= 0)
25 {
26 echo _("No such certificate attached to your account.");
27 showfooter();
28 exit;
29 }
30 $row = mysql_fetch_assoc($res);
31 $crtname=escapeshellarg($row['crt_name']);
32 $cert = shell_exec("/usr/bin/openssl x509 -in $crtname");
33 ?>
34 <h3><?php echo _("Below is your Server Certificate")?></h3>
35 <pre>
36 <?php echo $cert?>
37 </pre>