form fix for ralf

pull/1/head
root 20 years ago
parent 2f92ab9aba
commit d3b729f0b7

@ -63,28 +63,24 @@
if(intval($_GET['ccid']) <= 0)
{
echo "<ul>\n";
$query = "select * from `countries` order by `long`";
$res = mysql_query($query);
$res = mysql_query("select distinct `ccid`,`countries`.`long` from `users`,`notary`,`countries` where `listme`='1' and `ccid` > 0 and
`users`.`id`=`notary`.`to` and `ccid`=`countries`.`id` group by `notary`.`to` HAVING SUM(`points`) >= 100
order by `countries`.`long`");
while($row = mysql_fetch_assoc($res))
{
$listed = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and
`ccid`='".$row['id']."' and `users`.`id`=`notary`.`to`
group by `notary`.`to` HAVING SUM(`points`) >= 100"));
if($listed > 0)
echo "<li><a href='wot.php?id=1&ccid=$row[id]'>$row[long] ("._("Listed").": $listed)</a></li>\n";
echo "<li><a href='wot.php?id=1&ccid=$row[ccid]'>$row[long] ("._("Listed").": $listed)</a></li>\n";
}
echo "</ul>\n</li>\n</ul>\n<br>\n";
} elseif(intval($_GET['ccid']) > 0 && intval($_GET['regid']) <= 0 && intval($_GET['locid']) <= 0) {
echo "<ul>\n";
$query = "select * from `regions` where `ccid`='".$_GET['ccid']."' order by `long`";
$query = "select distinct `regid`,`regions`.`long` from `users`,`notary`,`regions` where `listme`='1' and `users`.`id`=`notary`.`to` and
`regid`=`regions`.`id` and `users`.`ccid`='".$_GET['ccid']."' group by `notary`.`to`
HAVING SUM(`points`) >= 100 order by `regions`.`long`";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
$listed = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and
`regid`='".$row['id']."' and `users`.`id`=`notary`.`to`
group by `notary`.`to` HAVING SUM(`points`) >= 100"));
if($listed > 0)
echo "<li><a href='wot.php?id=1&regid=$row[id]'>$row[long] ("._("Listed").": $listed)</a></li>\n";
echo "<li><a href='wot.php?id=1&regid=$row[regid]'>$row[long] ("._("Listed").": $listed)</a></li>\n";
}
echo "</ul>\n</li>\n</ul>\n</li>\n</ul>\n<br>\n";
} elseif(intval($_GET['regid']) > 0 && intval($_GET['locid']) <= 0) {

@ -13,6 +13,13 @@
PARTICULAR PURPOSE. See the License for more details.
*/ ?>
<? if($_SESSION['_config']['error'] != "") { ?><div color="orange">ERROR: <?=$_SESSION['_config']['error']?></div><? unset($_SESSION['_config']['error']); } ?>
<? if($_SESSION['_config']['noemailfound'] == 1) { ?>
<form method="post" action="wot.php">
<input type="hidden" name="email" value="<?=$_POST['email']?>">
<input type="hidden" name="oldid" value="<?=$id?>">
<input type="submit" name="reminder" value="<?=_("Send reminder notice")?>">
</form>
<? unset($_SESSION['_config']['noemailfound']); } ?>
<form method="post" action="wot.php">
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
@ -20,7 +27,11 @@
</tr>
<tr>
<td class="DataTD"><?=_("Email")?>:</td>
<? if($_SESSION['_config']['remindersent'] == 1) { unset($_SESSION['_config']['remindersent']) ?>
<td class="DataTD"><input type="text" name="email" value=""></td>
<? } else { ?>
<td class="DataTD"><input type="text" name="email" value="<?=$_POST['email']?>"></td>
<? } ?>
</tr>
<tr>
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td>

@ -37,8 +37,24 @@
$id = 5;
}
if($oldid == 5 && $_POST['reminder'] != "")
{
$body = "This is a short reminder that you filled out forms to become trusted with CAcert.org, and ".$_SESSION['profile']['fname']." (".$_SESSION['profile']['email'].") has attempted to issue you points. Please create your account at http://www.cacert.org as soon as possible and then notify ".$_SESSION['profile']['fname']." so that the points can be issued.\n\n";
$body .= "Best regards"."\n";
$body .= "CAcert Support Team";
sendmail($_POST['email'], "[CAcert.org] Reminder Notice", $body, "support@cacert.org", "returns@cacert.org", "", "CAcert Website");
$_SESSION['_config']['remindersent'] = 1;
$_SESSION['_config']['error'] = _("A reminder notice has been sent.");
$id = $oldid;
unset($oldid);
}
if($oldid == 5)
{
$_SESSION['_config']['noemailfound'] = 0;
$query = "select * from `users` where `email`='".mysql_escape_string(stripslashes($_POST['email']))."'";
$res = mysql_query($query);
if(mysql_num_rows($res) != 1)
@ -46,6 +62,8 @@
$id = $oldid;
unset($oldid);
$_SESSION['_config']['error'] = _("I'm sorry, there was no email matching what you entered in the system. Please double check your information.");
if(maxpoints() >= 150)
$_SESSION['_config']['noemailfound'] = 1;
} else {
$_SESSION['_config']['notarise'] = mysql_fetch_assoc($res);
}

Loading…
Cancel
Save