Merge branch 'bug-1394' into testserver-stable
[cacert-devel.git] / pages / wot / 5.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 include_once("../includes/shutdown.php");
19 require_once("../includes/lib/l10n.php");
20 ?>
21 <?
22 if(array_key_exists('error',$_SESSION['_config']) && $_SESSION['_config']['error'] != "")
23 {
24 ?><span class="error_warning">
25 <? echo _("ERROR").": ".$_SESSION['_config']['error'] ?>
26 </span>
27 <?unset($_SESSION['_config']['error']);
28 }
29
30 if (!isset($_SESSION['assuresomeone']['year'])) {
31 $_SESSION['assuresomeone']['year'] = 0;
32 }
33 if (!isset($_SESSION['assuresomeone']['month'])) {
34 $_SESSION['assuresomeone']['month'] = 0;
35 }
36 if (!isset($_SESSION['assuresomeone']['day'])) {
37 $_SESSION['assuresomeone']['day'] = 0;
38 }
39 ?>
40 <? if(array_key_exists('noemailfound',$_SESSION['_config']) && $_SESSION['_config']['noemailfound'] == 1) { ?>
41 <form method="post" action="wot.php">
42 <input type="hidden" name="email" value="<?=sanitizeHTML($_POST['email'])?>"><br>
43 <select name="reminder-lang">
44 <?
45 if($_SESSION['_config']['reminder-lang'] == "")
46 $_SESSION['_config']['reminder-lang'] = L10n::get_translation();
47 foreach(L10n::$translations as $key => $val)
48 {
49 echo "<option value='$key'";
50 if($key == $_SESSION['_config']['reminder-lang'])
51 echo " selected";
52 echo ">$val</option>\n";
53 }
54 ?>
55 </select><br>
56 <input type="hidden" name="oldid" value="<?=$id?>">
57 <input type="submit" name="reminder" value="<?=_("Send reminder notice")?>">
58 </form>
59 <? unset($_SESSION['_config']['noemailfound']); } ?>
60 <form method="post" action="wot.php" name="form1">
61 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
62 <tr>
63 <td colspan="2" class="title"><?=_("Assure Someone")?></td>
64 </tr>
65 <tr>
66 <td class="DataTD"><?=_("Email")?>:</td>
67 <? if(array_key_exists('remindersent',$_SESSION['_config']) && $_SESSION['_config']['remindersent'] == 1) { unset($_SESSION['_config']['remindersent']) ?>
68 <td class="DataTD"><input type="text" name="email" id="email" value=""></td>
69 <? } else { ?>
70 <td class="DataTD"><input type="text" name="email" id="email" value="<?=array_key_exists('email',$_POST)?sanitizeHTML($_POST['email']):""?>"></td>
71 <? } ?>
72 </tr>
73 <tr>
74 <td class="DataTD">
75 <?=_("Date of Birth")?><br/>
76 (<?=_("yyyy/mm/dd")?>)</td>
77 <td class="DataTD">
78 <input type="text" name="year" value="<?=array_key_exists('year',$_SESSION['assuresomeone']) && intval($_SESSION['assuresomeone']['year']) >= 1900 ? intval($_SESSION['assuresomeone']['year']):''?>" size="4" autocomplete="off"></nobr>
79 <select name="month">
80 <?
81 for($i = 1; $i <= 12; $i++)
82 {
83 echo "<option value='$i'";
84 if(array_key_exists('month',$_SESSION['assuresomeone']) && intval($_SESSION['assuresomeone']['month']) === $i)
85 echo " selected=\"selected\"";
86 echo ">".ucwords(strftime("%B", mktime(0,0,0,$i,1,date("Y"))))." ($i)</option>\n";
87 }
88 ?>
89 </select>
90 <select name="day">
91 <?
92 for($i = 1; $i <= 31; $i++)
93 {
94 echo "<option";
95 if(array_key_exists('day',$_SESSION['assuresomeone']) && intval($_SESSION['assuresomeone']['day']) === $i)
96 echo " selected=\"selected\"";
97 echo ">$i</option>";
98 }
99 ?>
100 </select>
101 </td>
102 </tr>
103
104 <tr>
105 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td>
106 </tr>
107 </table>
108 <input type="hidden" name="oldid" value="<?=$id?>">
109 </form>
110 <SCRIPT LANGUAGE="JavaScript">
111 //<![CDATA[
112 function my_init()
113 {
114 document.getElementById("email").focus();
115 }
116
117 window.onload = my_init();
118 //]]>
119 </script>