bug 827 restriced yellow marker <2006-09-1
[cacert-devel.git] / pages / gpg / 2.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 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
19 <tr>
20 <td colspan="5" class="title"><?=_("OpenPGP Keys")?></td>
21 </tr>
22 <tr>
23 <td class="DataTD"><?=_("Status")?></td>
24 <td class="DataTD"><?=_("Email Address")?></td>
25 <td class="DataTD"><?=_("Expires")?></td>
26 <td class="DataTD"><?=_("Key ID")?></td>
27
28 <?
29 $query = "select UNIX_TIMESTAMP(`issued`) as `issued`,
30 UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() as `timeleft`,
31 UNIX_TIMESTAMP(`expire`) as `expired`,
32 `expire` as `expires`, `id`, `level`,
33 `email`,`keyid` from `gpg` where `memid`='".intval($_SESSION['profile']['id'])."'
34 ORDER BY `issued` desc";
35 $res = mysql_query($query);
36 if(mysql_num_rows($res) <= 0)
37 {
38 ?>
39 <tr>
40 <td colspan="5" class="DataTD"><?=_("No OpenPGP keys are currently listed.")?></td>
41 </tr>
42 <? } else {
43 while($row = mysql_fetch_assoc($res))
44 {
45 if($row['timeleft'] > 0)
46 $verified = _("Valid");
47 if($row['timeleft'] < 0)
48 $verified = _("Expired");
49 if($row['expired'] == 0)
50 $verified = _("Pending");
51 ?>
52 <tr>
53 <? if($verified == _("Valid")) { ?>
54 <td class="DataTD"><?=$verified?></td>
55 <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=$row['id']?>"><?=$row['email']?></a></td>
56 <? } else if($verified == _("Pending")) { ?>
57 <td class="DataTD"><?=$verified?></td>
58 <td class="DataTD"><?=$row['email']?></td>
59 <? } else { ?>
60 <td class="DataTD"><?=$verified?></td>
61 <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=$row['id']?>"><?=$row['email']?></a></td>
62 <? } ?>
63 <td class="DataTD"><?=$row['expires']?></td>
64 <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=$row['id']?>"><?=$row['keyid']?></a></td>
65
66 </tr>
67 <? } ?>
68 <? } ?>
69 </table>
70 <input type="hidden" name="oldid" value="<?=$id?>">
71 </form>