b974c5db5535e7512a2bbce1202fe15ece74c752
[cacert-devel.git] / pages / wot / 9.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 $res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'");
20 if(mysql_num_rows($res) <= 0)
21 {
22 echo _("Sorry, I was unable to locate that user, the person doesn't wish to be contacted, or isn't an assurer.");
23 } else {
24
25 $user = mysql_fetch_array($res);
26 $userlang = $user['language'];
27 $points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary`
28 where `to`='".$user['id']."' group by `to` HAVING SUM(`points`) > 0"));
29 if($points <= 0)
30 {
31 echo _("Sorry, I was unable to locate that user.");
32 } else {
33
34 $_SESSION['_config']['pagehash'] = md5(date("U"));
35 ?>
36 <? if($_SESSION['_config']['error'] != "") { ?><font color="#ff0000" size="+1">ERROR: <?=$_SESSION['_config']['error']?></font><? unset($_SESSION['_config']['error']); } ?>
37 <form method="post" action="wot.php">
38 <input type="hidden" name="userid" value="<?=$user['id']?>">
39 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
40 <tr>
41 <td colspan="2" class="title"><?=_("Contact Assurer")?></td>
42 </tr>
43 <tr>
44 <td class="DataTD"><?=_("To")?>:</td>
45 <td class="DataTD" align="left"><?=$user['fname']?> <?=substr($user['lname'], 0, 1)?></td>
46 </tr>
47 <? if($userlang != "") { ?>
48 <tr>
49 <td class="DataTD"><?=_("Language")?>:</td>
50 <td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), $user['fname'], $_SESSION['_config']['translations'][$userlang]) ?></td>
51 </tr>
52 <? } ?>
53 <?
54 $query = "select * from `addlang` where `userid`='".$user['id']."'";
55 $res = mysql_query($query);
56 while($row = mysql_fetch_assoc($res))
57 {
58 $lang = mysql_fetch_assoc(mysql_query("select * from `languages` where `locale`='${row['lang']}'"));
59 ?>
60 <tr>
61 <td class="DataTD"><?=_("Additional Language")?>:</td>
62 <td class="DataTD" align="left"><? printf(_("%s will also accept email in %s - %s"), $user['fname'], $lang['lang'], $lang['country']) ?></td>
63 </tr>
64 <? } ?>
65 <tr>
66 <td class="DataTD"><?=_("Subject")?>:</td>
67 <td class="DataTD" align="left"><input type="text" name="subject" value="<?=sanitizeHTML($_POST['subject'])?>"></td>
68 </tr>
69 <tr>
70 <td class="DataTD"><?=_("Message")?>:</td>
71 <td class="DataTD"><textarea name="message" cols="40" rows="5" wrap="virtual"><?=sanitizeHTML($_POST['message'])?></textarea></td>
72 </tr>
73 <tr>
74 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Send")?>"></td>
75 </tr>
76 </table>
77 <input type="hidden" name="pageid" value="<?=$_SESSION['_config']['pagehash']?>">
78 <input type="hidden" name="userid" value="<?=intval($_REQUEST['userid'])?>">
79 <input type="hidden" name="oldid" value="<?=$id?>">
80 </form>
81 <p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p>
82 <? } } ?>