source code taken from cacert-20100805.tar.bz2
[cacert-devel.git] / pages / gpg / 3.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 = intval($_REQUEST['cert']);
20 $query = "select * from `gpg` where `id`='$certid' and `memid`='".intval($_SESSION['profile']['id'])."'";
21 $res = mysql_query($query);
22 if(mysql_num_rows($res) <= 0)
23 {
24 echo _("No such OpenPGP key attached to your account.");
25 showfooter();
26 exit;
27 }
28 $row = mysql_fetch_assoc($res);
29 ?>
30 <h3><?=_("Below is your OpenPGP key")?></h3>
31 <pre>
32 <? readfile($row['crt']); ?>
33 </pre>