File size: 3.92Kb
<?php
// YANG HACK JANGAN HILANGKAN LISENSI INI
// HTTP://INDWAP.COM
// DAMAI SELALU TAK PERNAH JAIL KARENA TIDAK BISA APA-APA
// SCRIPT BY ULOKI.COM
// REMODIF BY ANTOQ
// HTTP://FACEBOOK.COM/WWW.INDWAP.ORG
require("../include/init.php");
if($group[$user->groupid]['type'] < 3)
{
forward("index.php");
}
include "../include/header.php";
echo '<div class="phdr">E-mail Banning</div>';
?>
<table class="smalltable">
<tr style="background-color:#cccccc;"><td><a href="emailban.php?do=new">Add Email</a></td></tr>
</table>
<?php
if($group[$user->groupid]['type'] == 3)
{
err_msg("Admin CP","You dont have this right to perform this section.","</td></tr></table>");
}
if(isset($_GET['do']))
$do=$_GET['do'];
else
$do="";
if($do=="new")
{
if(isset($_POST['save']))
{
$bemail=$_POST['bemail'];
if(strlen($bemail) == 0)
{
err_msg("Admin CP","Email which you want to ban was not here.","</td></tr></table>");
}
$db->insert_data("INSERT INTO b_banemail(email) VALUES('$bemail')");
err_msg("Admin CP","Email is banned and cant register now. <a href=\"emailban.php\">Click here</a>","</td></tr></table>");
}
else
{
?>
<form action="emailban.php?do=new" method="POST">
<table class="smalltable">
<tr><td>Email Address: <br/><input type="text" name="bemail" value=""/></td> </tr>
<tr><td>
You can provide full or partial email id. If you<br/>write <i><u>rediff</u></i> then all rediffmail.com email id will<br/> be banned and
it may also ban other id who<br/>have rediff in there email id like<br/>e.g. umarediff@yahoo.co.in, If you want to ban<br/>only rediffmail ids then write rediffmail.com
</td> </tr>
<tr><td> <input type="submit" name="save" value="Add Email"/> </td> </tr>
</table>
</form>
<?php
}
}
else if($do=="edit")
{
$id=$_GET['id'];
$em=$db->get_row("SELECT * FROM b_banemail WHERE emailid='$id'");
if(isset($_POST['save']))
{
$bemail=$_POST['bemail'];
if(strlen($bemail) == 0)
{
err_msg("Admin CP","Provide email id which is to be banned.","</td></tr></table>");
}
$db->update_data("UPDATE b_banemail SET email='$bemail' WHERE emailid='$id'");
err_msg("Admin CP","Email edited. <a href=\"emailban.php\">Click here</a>","</td></tr></table>");
}
else
{
?>
<form action="emailban.php?do=edit&id=<?php echo $id; ?>" method="POST">
<table class="smalltable">
<tr><td>IP Address: <br/><input type="text" name="bemail" value="<?php echo $em->email; ?>"/> </td> </tr>
<tr><td> <input type="submit" name="save" value="Save"/> </td> </tr>
</table>
</form>
<?php
}
}
else if($do=="delete")
{
$id=$_GET['id'];
$em=$db->get_row("SELECT * FROM b_banemail WHERE emailid='$id'");
if(isset($_POST['yes']))
{
$db->delete_data("DELETE FROM b_banemail WHERE emailid='$id'");
err_msg("Admin CP","Banned email or term removed from banned list. <a href=\"emailban.php\">Click here</a>","</td></tr></table>");
}
else
{
?>
<form action="emailban.php?do=delete&id=<?php echo $id; ?>" method="POST">
Are you sure that you have to remove this Email from ban list ?<br/>
<br/> <input type="submit" name="yes" value="Yes"/> | <a href="javascript:history.back();">Back</a>
</form>
<?php
}
}
else
{
?>
<table class="smalltable">
<?php
$emaillist=$db->select("SELECT * FROM b_banemail");
if($emaillist)
{ print "<tr style=\"background-color:#cccccc;\"><td><b>Banned Email or Term</b></td></tr>";
foreach($emaillist as $em)
print "<tr style=\"background-color:#cccccc;\"><td>".$em->email."</td><td width=\"60\"><a href=\"emailban.php?do=edit&id=".$em->emailid."\">Edit</a></td><td width=\"60\"><a href=\"emailban.php?do=delete&id=".$em->emailid."\">Delete</a></td></tr>";
}
else
{
print "<tr class=\"forumrow2\"><td><center>No Email / Domain is banned from registering forum.</center></td></tr>";
}
?>
</table>
<?php
}
echo '<div class="phdr"><a href="index.php">Admin Panel</a> | <a href="emailban.php">Kembali</a></div>';
include "../include/footer.php";
?>