Merge remote-tracking branch 'origin/bug-985' into release
[cacert-devel.git] / pages / account / 41.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 require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
20 ?>
21
22 <form method="post" action="account.php">
23 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
24 <tr>
25 <td colspan="2" class="title"><?=_("My Language Settings")?></td>
26 </tr>
27 <tr>
28 <td class="DataTD"><?=_("My prefered language")?>:</td>
29 <td class="DataTD"><select name="lang">
30 <?
31 foreach(L10n::$translations as $key => $val)
32 {
33 echo "<option value='$key'";
34 if($key == L10n::get_translation())
35 echo " selected";
36 echo ">$val</option>\n";
37 }
38 ?>
39 </select>
40 </td>
41 </tr>
42 <tr>
43 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Update")?>"></td>
44 </tr>
45 </table>
46 <input type="hidden" name="oldid" value="<?=$id?>">
47 <input type="hidden" name="action" value="default">
48 <input type="hidden" name="csrf" value="<?=make_csrf('mainlang')?>" />
49 </form>
50 <form method="post" action="account.php">
51 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
52 <tr>
53 <td colspan="2" class="title"><?=_("Additional Language Preferences")?></td>
54 </tr>
55 <?
56 $query = "select * from `addlang` where `userid`='".intval($_SESSION['profile']['id'])."'";
57 $res = mysql_query($query);
58 while($row = mysql_fetch_assoc($res))
59 {
60 $lang = mysql_fetch_assoc(mysql_query("select * from `languages` where `locale`='".mysql_escape_string($row['lang'])."'"));
61 ?>
62 <tr>
63 <td class="DataTD"><?=_("Additional Language")?>:</td>
64 <td class="DataTD" align="left"><? echo "${lang['lang']} - ${lang['country']}"; ?>
65 <a href="account.php?oldid=41&amp;action=dellang&amp;remove=<?=$row['lang']?>&amp;csrf=<?=make_csrf('seclang')?>"><?=_("Delete")?></a></td>
66 </tr>
67 <? } ?>
68 <tr>
69 <td class="DataTD"><?=_("Secondary languages")?>:</td>
70 <td class="DataTD"><select name="addlang">
71 <?
72 $query = "select * from `languages` order by `locale`";
73 $res = mysql_query($query);
74 while($row = mysql_fetch_assoc($res))
75 {
76 echo "<option value='".sanitizeHTML($row['locale'])."'";
77 echo ">".$row['country']." - ".$row['lang']."</option>\n";
78 }
79 ?>
80 </select>
81 </td>
82 </tr>
83 <tr>
84 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Add")?>"></td>
85 </tr>
86 </table>
87 <input type="hidden" name="oldid" value="<?=$id?>">
88 <input type="hidden" name="action" value="addsec">
89 <input type="hidden" name="csrf" value="<?=make_csrf('seclang')?>" />
90 </form>