cacert-webdb/pages/wot/9.php

85 lines
3.7 KiB
PHP
Raw Normal View History

2004-10-16 00:28:17 +00:00
<? /*
2008-04-06 19:45:09 +00:00
LibreSSL - CAcert web application
Copyright (C) 2004-2008 CAcert Inc.
2004-10-16 00:28:17 +00:00
2008-04-06 19:45:09 +00:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
2004-10-16 00:28:17 +00:00
2008-04-06 19:45:09 +00:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
2004-10-16 00:28:17 +00:00
2008-04-06 19:45:09 +00:00
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
2006-02-03 18:45:23 +00:00
$res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'");
2004-10-16 00:28:17 +00:00
if(mysql_num_rows($res) <= 0)
{
2006-02-03 18:45:23 +00:00
echo _("Sorry, I was unable to locate that user, the person doesn't wish to be contacted, or isn't an assurer.");
2004-10-16 00:28:17 +00:00
} else {
$user = mysql_fetch_array($res);
$userlang = L10n::normalise_translation($user['language']);
2004-10-16 00:28:17 +00:00
$points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary`
where `to`='".intval($user['id'])."' and `deleted`=0 group by `to` HAVING SUM(`points`) > 0"));
if($points <= 0) {
2004-10-16 00:28:17 +00:00
echo _("Sorry, I was unable to locate that user.");
} else {
2006-02-03 18:45:23 +00:00
$_SESSION['_config']['pagehash'] = md5(date("U"));
2004-10-16 00:28:17 +00:00
?>
2008-10-06 21:26:48 +00:00
<? if($_SESSION['_config']['error'] != "") { ?><font color="#ff0000" size="+1">ERROR: <?=$_SESSION['_config']['error']?></font><? unset($_SESSION['_config']['error']); } ?>
2004-10-16 00:28:17 +00:00
<form method="post" action="wot.php">
<input type="hidden" name="userid" value="<?=intval($user['id'])?>">
2004-10-16 00:28:17 +00:00
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
2004-10-24 01:46:49 +00:00
<td colspan="2" class="title"><?=_("Contact Assurer")?></td>
2004-10-16 00:28:17 +00:00
</tr>
<tr>
<td class="DataTD"><?=_("To")?>:</td>
<td class="DataTD" align="left"><?=sanitizeHTML(trim($user['fname'].' '.substr($user['lname'], 0, 1)))?></td>
2004-10-16 00:28:17 +00:00
</tr>
2004-10-16 15:14:46 +00:00
<? if($userlang != "") { ?>
<tr>
<td class="DataTD"><?=_("Language")?>:</td>
<td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), sanitizeHTML($user['fname']), L10n::$translations[$userlang]) ?></td>
2004-10-16 15:14:46 +00:00
</tr>
2006-08-15 22:24:21 +00:00
<? } ?>
<?
$query = "select * from `addlang` where `userid`='".intval($user['id'])."'";
2006-08-15 22:24:21 +00:00
$res = mysql_query($query);
2006-08-15 23:00:25 +00:00
while($row = mysql_fetch_assoc($res))
2006-08-15 22:24:21 +00:00
{
$lang = mysql_fetch_assoc(mysql_query("select * from `languages` where `locale`='".mysql_real_escape_string($row['lang'])."'"));
2006-08-15 22:24:21 +00:00
?>
<tr>
<td class="DataTD"><?=_("Additional Language")?>:</td>
<td class="DataTD" align="left"><? printf(_("%s will also accept email in %s - %s"), sanitizeHTML($user['fname']), $lang['lang'], $lang['country']) ?></td>
2006-08-15 22:24:21 +00:00
</tr>
2004-10-16 15:14:46 +00:00
<? } ?>
2004-10-16 00:28:17 +00:00
<tr>
<td class="DataTD"><?=_("Subject")?>:</td>
2007-07-03 19:59:53 +00:00
<td class="DataTD" align="left"><input type="text" name="subject" value="<?=sanitizeHTML($_POST['subject'])?>"></td>
2004-10-16 00:28:17 +00:00
</tr>
<tr>
<td class="DataTD"><?=_("Message")?>:</td>
2007-07-03 19:59:53 +00:00
<td class="DataTD"><textarea name="message" cols="40" rows="5" wrap="virtual"><?=sanitizeHTML($_POST['message'])?></textarea></td>
2004-10-16 00:28:17 +00:00
</tr>
<tr>
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Send")?>"></td>
</tr>
</table>
2006-02-03 18:45:23 +00:00
<input type="hidden" name="pageid" value="<?=$_SESSION['_config']['pagehash']?>">
2007-07-03 19:59:53 +00:00
<input type="hidden" name="userid" value="<?=intval($_REQUEST['userid'])?>">
<input type="hidden" name="oldid" value="<?=intval($id)?>">
2004-10-16 00:28:17 +00:00
</form>
2009-05-31 16:50:38 +00:00
<p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p>
2004-10-16 00:28:17 +00:00
<? } } ?>