Source code taken from cacert-20141124.tar.bz2
[cacert.git] / pages / account / 15.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 <?
19 $certid = 0; if(array_key_exists('cert',$_REQUEST)) $certid=intval($_REQUEST['cert']);
20
21 $query = "select * from `domaincerts`,`domains` where `domaincerts`.`id`='$certid' and
22 `domains`.`memid`='".intval($_SESSION['profile']['id'])."' and
23 `domains`.`id`=`domaincerts`.`domid`";
24 $res = mysql_query($query);
25 if(mysql_num_rows($res) <= 0)
26 {
27 echo _("No such certificate attached to your account.");
28 showfooter();
29 exit;
30 }
31 $row = mysql_fetch_assoc($res);
32 $crtname=escapeshellarg($row['crt_name']);
33 $cert = shell_exec("/usr/bin/openssl x509 -in $crtname");
34 ?>
35 <h3><?=_("Below is your Server Certificate")?></h3>
36 <pre>
37 <?=$cert?>
38 </pre>