bug 1394: applied text changes according to bug description
[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 <form method="post" action="gpg.php">
19 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
20 <tr>
21 <td colspan="6" class="title"><?=_("OpenPGP Keys")?></td>
22 </tr>
23 <tr>
24 <td class="DataTD"><?=_("Status")?></td>
25 <td class="DataTD"><?=_("Email Address")?></td>
26 <td class="DataTD"><?=_("Expires")?></td>
27 <td class="DataTD"><?=_("Key ID")?></td>
28 <td colspan="2" class="DataTD"><?=_("Comment *")?></td>
29 <?
30 $query = "select UNIX_TIMESTAMP(`issued`) as `issued`,
31 UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() as `timeleft`,
32 UNIX_TIMESTAMP(`expire`) as `expired`,
33 `expire`, `id`, `level`,
34 `email`,`keyid`,`description` from `gpg` where `memid`='".intval($_SESSION['profile']['id'])."'
35 ORDER BY `issued` desc";
36 $res = mysql_query($query);
37 if(mysql_num_rows($res) <= 0)
38 {
39 ?>
40 <tr>
41 <td colspan="6" class="DataTD"><?=_("No OpenPGP keys are currently listed.")?></td>
42 </tr>
43 <? } else {
44 while($row = mysql_fetch_assoc($res))
45 {
46 $verified = '';
47 if($row['timeleft'] > 0)
48 $verified = _("Valid");
49 if($row['timeleft'] < 0)
50 $verified = _("Expired");
51 if($row['expired'] == 0)
52 $verified = _("Pending");
53 ?>
54 <tr>
55 <? if($verified == _("Valid")) { ?>
56 <td class="DataTD"><?=$verified?></td>
57 <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=intval($row['id'])?>"><?=sanitizeHTML($row['email'])?></a></td>
58 <? } else if($verified == _("Pending")) { ?>
59 <td class="DataTD"><?=$verified?></td>
60 <td class="DataTD"><?=sanitizeHTML($row['email'])?></td>
61 <? } else { ?>
62 <td class="DataTD"><?=$verified?></td>
63 <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=intval($row['id'])?>"><?=sanitizeHTML($row['email'])?></a></td>
64 <? } ?>
65 <td class="DataTD"><?=$row['expire']?></td>
66 <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=intval($row['id'])?>"><?=sanitizeHTML($row['keyid'])?></a></td>
67 <td class="DataTD"><input name="comment_<?=intval($row['id'])?>" type="text" value="<?=htmlspecialchars($row['description'])?>" /></td>
68 <td class="DataTD"><input type="checkbox" name="check_comment_<?=intval($row['id'])?>" /></td>
69 </tr>
70 <? } ?>
71 <? } ?>
72 <tr>
73 <td class="DataTD" colspan="6">
74 <?=_('* Comment is NOT included in the certificate as it is intended for your personal reference only. To change the comment tick the checkbox and hit "Change Settings".')?>
75 </td>
76 </tr>
77 <tr>
78 <td class="DataTD" colspan="6"><input type="submit" name="change" value="<?=_("Change settings")?>" /> </td>
79 </tr>
80 </table>
81 <input type="hidden" name="oldid" value="<?=intval($id)?>" />
82 </form>