All mysql_-statments replaced by their corresponding mysqli_-statements
[cacert-devel.git] / pages / account / 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="account.php">
19 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
20 <tr>
21 <td colspan="4" class="title"><?=_("Email Accounts")?></td>
22 </tr>
23 <tr>
24 <td class="DataTD"><?=_("Default")?></td>
25 <td class="DataTD"><?=_("Status")?></td>
26 <td class="DataTD"><?=_("Delete")?></td>
27 <td class="DataTD"><?=_("Address")?></td>
28
29 <?
30 $query = "select * from `email` where `memid`='".intval($_SESSION['profile']['id'])."' and `deleted`=0";
31 $res = mysqli_query($_SESSION['mconn'], $query);
32 while($row = mysqli_fetch_assoc($res))
33 {
34 if($row['hash'] == "")
35 $verified = _("Verified");
36 else
37 $verified = _("Unverified");
38 ?>
39 <tr>
40 <td class="DataTD"><? if($row['hash'] == "") { ?><input type="radio" name="emailid" value="<?=$row['id']?>"
41 <? if($row['email'] == $_SESSION['profile']['email']) echo " checked"; ?>><? } else { echo "&nbsp;"; } ?></td>
42 <td class="DataTD"><?=$verified?></td>
43 <? if($row['email'] == $_SESSION['profile']['email']) { ?>
44 <td class="DataTD"><?=_("N/A")?></td>
45 <? } else { ?>
46 <td class="DataTD"><input type="checkbox" name="delid[]" value="<?=$row['id']?>"></td>
47 <? } ?>
48 <td class="DataTD"><?=sanitizeHTML($row['email'])?></td>
49 </tr>
50 <? } ?>
51 <tr>
52 <td class="DataTD" colspan="2"><input type="submit" name="makedefault" value="<?=_("Make Default")?>"></td>
53 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Delete")?>"></td>
54 </tr>
55 </table>
56 <input type="hidden" name="oldid" value="<?=$id?>">
57 <input type="hidden" name="csrf" value="<?=make_csrf('chgdef')?>" />
58 </form>
59 <p>
60 <?=_("Please Note: You can not set an unverified account as a default account, and you can not remove a default account. To remove the default account you must set another verified account as the default.")?>
61 </p>