Web-admin for ...
http://freebsd-r16.narod.ru/freebsd/greylist.html
----------------
replace
< -> <
----------------
<?php
$host="localhost";
$user="greylist";
$pass="tsilyerg";
# >null
$i ="";
$s ="";
$ba="";
$bd="";
$o ="";
mysql_connect($host,$user,$pass);
echo '<html><head><style type="text/css">';
echo '.w { font-size: 14px; font-family: Arial; text-align: center; color: #000000; }';
echo '.b { font-size: 14px; font-family: Arial; text-align: center; color: #FFFFFF; }';
echo '.g { padding: 0.1px 0.1px 0.1px 0.1px; border: 1px; }';
echo 'body { font-size: 14px; background-color: #CCFFFF; font-family: Tahoma; }';
echo '</style></head><body>';
echo '<div align="right">Greylisting Web-Admin. v.0.1</div>';
echo '<div align="right">make in JSC Fort Dialog</div><br>';
### GLOBAL ####################################################################################################################################################################################
echo '<table border="0" width="99%">';
echo '<tr><td width="33%" class="w"><b>WHITELIST</b></td><td width="33%" class="w"><b>TEMP-GREY</b></td><td width="33%" class="w"><b>TEMP-BLACK (auto-deleting after 15 day\'s)</b></td></tr>';
echo '<tr><td valign="top">';
### WHITE #####################################################################################################################
echo '<table align="center" border="1" width="100%" bgcolor="#FFFFFF">';
echo '<tr><td width="45%" class="w"><b>ip</td><td width="50%" class="w"><b>sender</td><td width="5%" class="w"><b>-</td></tr>';
$qW="
SELECT mail,comment
FROM dbgreylist.whitelist
GROUP BY mail
ORDER BY comment ASC
";
$result=mysql_query($qW);
while ($mas=mysql_fetch_array($result)) {
# ---------------------------- button +->
$i=$mas['mail'];
$s=$mas['comment'];
$bd=str_replace('.', '', $mas['mail']);
echo '<form metod="GET" action="index.php">';
# +++------------------------------------------------+
echo '<tr><td class="w">'.$i.'</td><td class="w">'.$s;
# +++------------------------------------------------+
echo '</td><td class="w">';
echo '<input type="submit" name="'.$bd.'" value="d" class="g">';
echo '</form>';
if ($_GET[$bd]) {
mysql_query("DELETE FROM dbgreylist.whitelist WHERE mail = '".$i."' AND comment = '".$s."'");
echo '<script>document.location.href = \'index.php\';</script>';
}
# ------------------------------------------------------------------------------------- button +>
# +++------------+
echo '</td></tr>';
# +++------------+
}
echo '</table>';
### WHITE #####################################################################################################################
echo '</td><td valign="top">';
### TEMP-GREY ###################################################################################################################################################
echo '<table align="center" border="1" width="100%" bgcolor="#CCCCCC">';
echo '<tr><td width="40%" class="w"><b>ip</td><td width="50%" class="w"><b>sender</td><td width="5%" class="w"><b>+</td><td width="5%" class="w"><b>-</td></tr>';
$qW="
SELECT ip,sender
FROM dbgreylist.greylist
WHERE n != '1'
GROUP BY ip
ORDER BY sender ASC
";
$result=mysql_query($qW);
while ($mas=mysql_fetch_array($result)) {
# ---------------------------- button +->
$i=$mas['ip'];
$s=$mas['sender'];
$ba=str_replace('.', '', $mas['ip']);
$bd=strrev(str_replace('.', '', $mas['ip']));
$o=substr($s, strpos($s,'@')+1);
echo '<form metod="GET" action="index.php">';
# +++------------------------------------------------+
echo '<tr><td class="w">'.$i.'</td><td class="w">'.$s;
# +++------------------------------------------------+
echo '</td><td class="w">';
echo '<input type="submit" name="'.$ba.'" value="a" class="g">';
echo '</td><td class="w">';
echo '<input type="submit" name="'.$bd.'" value="d" class="g">';
echo '</form>';
if ($_GET[$ba]) {
mysql_query("INSERT INTO dbgreylist.whitelist (mail,comment) VALUES('".$i."','".$o."');");
mysql_query("DELETE FROM dbgreylist.greylist WHERE ip = '".$i."' AND sender = '".$s."'");
echo '<script>document.location.href = \'index.php\';</script>';
}
if ($_GET[$bd]) {
mysql_query("DELETE FROM dbgreylist.greylist WHERE ip = '".$i."' AND sender = '".$s."'");
echo '<script>document.location.href = \'index.php\';</script>';
}
# ---------------------------------------------------------------------------------- button +>
# +++------------+
echo '</td></tr>';
# +++------------+
}
echo '</table>';
### TEMP-GREY ###################################################################################################################################################
echo '</td><td valign="top">';
### TEMP-BLACK ##################################################################################################################################################
echo '<table align="center" border="1" width="100%" bgcolor="#000000">';
echo '<tr><td width="40%" class="b"><b>ip</td><td width="50%" class="b"><b>sender</td><td width="5%" class="b"><b>+</td><td width="5%" class="b"><b>-</td></tr>';
$qW="
SELECT ip,sender
FROM dbgreylist.greylist
WHERE n = '1'
GROUP BY ip
ORDER BY sender ASC
";
$result=mysql_query($qW);
while ($mas=mysql_fetch_array($result)) {
# ---------------------------- button +->
$i=$mas['ip'];
$s=$mas['sender'];
$ba=str_replace('.', '', $mas['ip']);
$bd=strrev(str_replace('.', '', $mas['ip']));
$o=substr($s, strpos($s,'@')+1);
echo '<form metod="GET" action="index.php">';
# +++------------------------------------------------+
echo '<tr><td class="b">'.$i.'</td><td class="b">'.$s;
# +++------------------------------------------------+
echo '</td><td class="b">';
echo '<input type="submit" name="'.$ba.'" value="a" class="g">';
echo '</td><td class="b">';
echo '<input type="submit" name="'.$bd.'" value="d" class="g">';
echo '</form>';
if ($_GET[$ba]) {
mysql_query("INSERT INTO dbgreylist.whitelist (mail,comment) VALUES('".$i."','".$o."');");
mysql_query("DELETE FROM dbgreylist.greylist WHERE ip = '".$i."' AND sender = '".$s."'");
echo '<script>document.location.href = \'index.php\';</script>';
}
if ($_GET[$bd]) {
mysql_query("DELETE FROM dbgreylist.greylist WHERE ip = '".$i."' AND sender = '".$s."'");
echo '<script>document.location.href = \'index.php\';</script>';
}
# ---------------------------------------------------------------------------------- button +>
# +++------------+
echo '</td></tr>';
# +++------------+
}
echo '</table>';
### TEMP-BLACK ##################################################################################################################################################
echo '</td></tr></table>';
### GLOBAL ####################################################################################################################################################################################
echo '</body></html>';
mysql_close();
?>