Skip to content
admin_blacklist.php 12.4 KiB
Newer Older
Seblu's avatar
Seblu committed
<?php

function dispAdminBlacklist () {


if ($_SESSION["user_right"] < $GLOBALS["EPTV"] )
{
	return("T'es ouf");
}

	get_time();


$result = getAllBlacklist();


$str = '
Seblu's avatar
Seblu committed
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
		<td bgcolor="#000000">
		<table width="100%" border="0" cellspacing="1" cellpadding="2">
			<tr>
			<td>
				<b>
				<font color="#ffffff">
				&nbsp a l l &nbsp b l a c k l i s t e d
				</font>
Seblu's avatar
Seblu committed
				</b>
Seblu's avatar
Seblu committed
			';
				if ($_SESSION["user_right"] == $GLOBALS["ROOT"]) {
					$str .= '
Seblu's avatar
Seblu committed
						<FORM name="new_user" method="post" action="index.php?html=AdminHome&section_admin=AdminAddBlacklist">
Seblu's avatar
Seblu committed
						<INPUT class="button" TYPE="submit" NAME="action" VALUE="  NOUVEAU BOULET  "><BR> </TD>
						</FORM>
					';
				}
		$str .= '
			</td>
			</tr>
Seblu's avatar
Seblu committed
			<tr>
Seblu's avatar
Seblu committed
			<td bgcolor="#303030">
Seblu's avatar
Seblu committed
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
				<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="4">

				<TR>
				<td></td>
				<td><b>Login</b></td>
				<td><b>Pseudo</b></td>
				<td><b>Mail</b></td>
				<td><b>Try</b></td>
				</TR>

			<TR>
	';
			$cpt = 1;
			while ($blacklist = mysql_fetch_array($result)) {
Seblu's avatar
Seblu committed
				$element_id = $blacklist["blacklist_id"];

				$str .=	'
				<TD>
					<small><b>'.$cpt.'</b></small>
				</TD>
				<TD>

					'.$blacklist["blacklist_login"].'
Seblu's avatar
Seblu committed
				</TD>

				<TD>
					'.$blacklist["blacklist_pseudo"].'
				</TD>

				<TD>
					<small>
					'.$blacklist["blacklist_reason"].'
					</small>
				</TD>

				<TD>
					<small>
					'.$blacklist["blacklist_try"].'
					</small>
				</TD>
			';

				if ($_SESSION["user_right"] == $GLOBALS["ROOT"]) {
					$str .= '
						<TD width=10% align=right>
Seblu's avatar
Seblu committed
							<FORM name="update_member" method="post" action="index.php?html=AdminHome&section_admin=AdminModifBlacklist&element_id='.$element_id.'">
							<INPUT class="button" TYPE="submit" NAME="action" VALUE="  MODIFIER  ">
Seblu's avatar
Seblu committed
							</FORM>
						</TD>
						<TD width=10% align=right>
Seblu's avatar
Seblu committed
							<FORM name="supp_member" method="post" action="index.php?html=AdminHome&section_admin=AdminDelBlacklist&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
							<INPUT class="button" TYPE="submit" NAME="action" VALUE="  SUPPRIMER  ">
						</FORM>
						</TD>
					';
				}
		$str .= '
			</TR>';
			$cpt++;
			}

		$str .= '
				</table>
				</td>
				</tr>
			</table>
			</td>
			</tr>
		</table>
		</td>
		</tr>
	';


	/////// BEGIN SPACE ///////
	$str .= '<tr><td><BR></td></tr>';


	$str .= '
		<tr>
		<td bgcolor="#000000">
		<table width="100%" border="0" cellspacing="1" cellpadding="2">

			<tr>
			<td>
				<b>
				<font color="#ffffff">
				&nbsp a l l &nbsp s i t e &nbsp; f o r &nbsp; b l a c k l i s t e d
				</font>
Seblu's avatar
Seblu committed
				</b>
Seblu's avatar
Seblu committed
			</td>
			</tr>
Seblu's avatar
Seblu committed

			<FORM name="new_news" method="post" action="index.php?html=AdminHome&section_admin=AdminAddBlacksite">
Seblu's avatar
Seblu committed
   			<TR>
  			<TD><INPUT class="button" TYPE="submit" NAME="action" VALUE="  NOUVELLE SITE POUR LA BLACKLIST  "><BR> </TD>
			</TR>
 			</FORM>
Seblu's avatar
Seblu committed
			<tr>
Seblu's avatar
Seblu committed
			<td bgcolor="#303030">
Seblu's avatar
Seblu committed
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
				<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="4">
				';

			$result = getAllBlacksite();

			while ($blacksite = mysql_fetch_array($result)) {
Seblu's avatar
Seblu committed
				$element_id = $blacksite["blacksite_id"];

				$str .=	'
					<TR>
					<TD>
Seblu's avatar
Seblu committed
						<A HREF='.$blacksite["blacksite_adress"].'>'.$blacksite["blacksite_adress"].'</A>
Seblu's avatar
Seblu committed
					</TD>

Seblu's avatar
Seblu committed
					<TD width=10% align=right>
Seblu's avatar
Seblu committed
						<FORM name="update_member" method="post" action="index.php?html=AdminHome&section_admin=AdminModifBlacksite&element_id='.$element_id.'">
						<INPUT class="button" TYPE="submit" NAME="action" VALUE="  MODIFIER  ">
Seblu's avatar
Seblu committed
						</FORM>
					</TD>
					<TD width=10% align=right>
Seblu's avatar
Seblu committed
						<FORM name="supp_member" method="post" action="index.php?html=AdminHome&section_admin=AdminDelBlacksite&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
						<INPUT class="button" TYPE="submit" NAME="action" VALUE="  SUPPRIMER  ">
					</FORM>
					</TD>
					</TR>

				';
			}

			$str .= '
				</table>
				</td>
				</tr>
			</table>
			</td>
			</tr>
		</table>
		</td>
		</tr>



	</table>
Seblu's avatar
Seblu committed
	';


return $str;


}




function	dispAdminAddBlacklist() {

 $date = get_date();

Seblu's avatar
Seblu committed
 $str = '
Seblu's avatar
Seblu committed
<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td bgcolor="#000000">
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
		<tr>
		<td>
			<b>
			<font color="#ffffff">
			&nbsp a d d &nbsp b l a c k l i s t &nbsp t o &nbsp d a t a b a s e
			</font>
Seblu's avatar
Seblu committed
			</b>
Seblu's avatar
Seblu committed
		</td>
Seblu's avatar
Seblu committed
		</tr>
Seblu's avatar
Seblu committed
	<tr>
Seblu's avatar
Seblu committed
	<td bgcolor="#303030">
Seblu's avatar
Seblu committed
	<table cellpadding="0" cellspacing="0" width="100%">
Seblu's avatar
Seblu committed
		<tr>
		    <form name="saisie" method="post" action="index.php?html=AdminHome&section_admin=AddBlacklist">
Seblu's avatar
Seblu committed
		    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
			    <TR><TD> Login: </TD>
			    <TD> <INPUT TYPE="text" NAME="blacklist_get_login" VALUE="" SIZE="20" MAXLENGTH="20"> </TD>
			    </TR>
Seblu's avatar
Seblu committed
			    <TR><TD> Pseudo: </TD>
			    <TD> <INPUT TYPE="text" NAME="blacklist_get_pseudo" VALUE="" SIZE="20" MAXLENGTH="20"> </TD>
			    </TR>

			    <TR><TD> Mail: </TD>
			    <TD> <INPUT TYPE="text" NAME="blacklist_get_mail" VALUE="" SIZE="30" MAXLENGTH="30"> </TD>
			    </TR>

			    <TR><TD> Date d entree: </TD>
			    <TD> <INPUT TYPE="text" NAME="blacklist_get_date" VALUE="'.$date.'" SIZE="8" MAXLENGTH="10"> </TD>
			    </TR>

			    <TR><TD>Reason: </TD>
			    <TD>
			    <TEXTAREA rows="3" cols="38" name="blacklist_get_reason" ONFOCUS=""></textarea>
			    </TD>
			    </TR>

			    <TR>
				    <TD> </TD>
				    <TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  INSCRIPTION  "> </TD>
			    </TR>
			    <TR>
			 	   <TD> </TD>
				   <TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
			    </TR>
		    </TABLE>
		</FORM>
		</TR>
	</TABLE>
	</TD>
	</TR>
</TABLE>
';

return $str;

}


function	dispAdminModifBlacklist() {

$element_id =$_GET['element_id'];

$result = getOneBlacklistById($element_id);

Seblu's avatar
Seblu committed
$str = '
Seblu's avatar
Seblu committed
<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td bgcolor="#000000">
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
		<tr>
		<td>
			<b>
			<font color="#ffffff">
			&nbsp m o d i f y &nbsp b l a c k l i s t e d
			</font>
Seblu's avatar
Seblu committed
			</b>
Seblu's avatar
Seblu committed
		</td>
Seblu's avatar
Seblu committed
		</tr>
Seblu's avatar
Seblu committed
	<tr>
Seblu's avatar
Seblu committed
	<td bgcolor="#303030">
Seblu's avatar
Seblu committed
	<table cellpadding="0" cellspacing="0" width="100%">
Seblu's avatar
Seblu committed
		<tr>
Seblu's avatar
Seblu committed
	';

  if (mysql_num_rows($result)){
Seblu's avatar
Seblu committed
    $blacklist = mysql_fetch_array($result);
Seblu's avatar
Seblu committed
  }

  $str .= '
Seblu's avatar
Seblu committed
    <form name="saisie" method="post" action="index.php?html=AdminHome&section_admin=ModifBlacklist&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
	    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
 		   <TR><TD> Login du Boulet: </TD>
		    <TD> <INPUT TYPE="text" NAME="blacklist_get_login" VALUE="'.$blacklist["blacklist_login"].'" SIZE="50" MAXLENGTH="52"> </TD>
		    </TR>
Seblu's avatar
Seblu committed
		    <TR><TD> Pseudo: </TD>
		    <TD>

Seblu's avatar
Seblu committed
		    <INPUT TYPE="text" NAME="blacklist_get_pseudo" VALUE="'.$blacklist["blacklist_pseudo"].'" SIZE="50" MAXLENGTH="100">
Seblu's avatar
Seblu committed

		    </TD>
		    </TR>

		    <TR><TD> Mail: </TD>
		    <TD>
Seblu's avatar
Seblu committed
		    <INPUT TYPE="text" NAME="blacklist_get_mail" VALUE="'.$blacklist["blacklist_mail"].'" SIZE="50" MAXLENGTH="100">
Seblu's avatar
Seblu committed

		    </TD>
		    </TR>

Seblu's avatar
Seblu committed
		    <TR><TD> Depuis le: </TD>
		    <TD> <INPUT TYPE="text" NAME="blacklist_get_date" VALUE="'.$blacklist["blacklist_date"].'" SIZE="8" MAXLENGTH="10"> </TD>
		    </TR>

		    <TR><TD>Reason: </TD>
		    <TD>
		    <TEXTAREA rows="3" cols="38" name="blacklist_get_reason" ONFOCUS="">'.$blacklist["blacklist_reason"].'</textarea>
		    </TD>
		    </TR>
Seblu's avatar
Seblu committed
		    <TR><TD>Essais de Connexion: </TD>
		    <TD>
		    '.$blacklist["blacklist_try"].'
		    </TD>
		    </TR>

	    </TD>
	    </TR>

	    <TR>
	    <TD> </TD>
	    <TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  UPDATE  "> </TD>
	    </TR>
	    <TR>
	    <TD> </TD>
	    <TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
	    </TR>
Seblu's avatar
Seblu committed
    	</TABLE>
	</FORM>
	</TR>
   </TABLE>
   </TD>
   </TR>
</TABLE>
Seblu's avatar
Seblu committed
';

return $str;

}


function	dispAdminDelBlacklist() {

  $element_id =$_GET['element_id'];

  $result = getOneBlacklistById($element_id);

Seblu's avatar
Seblu committed
$str = '
Seblu's avatar
Seblu committed
<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td bgcolor="#000000">
	<table width="100%" border="0" cellspacing="1" cellpadding="2">
		<tr>
		<td>
			<b>
			<font color="#ffffff">
			&nbsp d e l e t e &nbsp b l a c k l i s t e d
			</font>
Seblu's avatar
Seblu committed
			</b>
Seblu's avatar
Seblu committed
		</td>
Seblu's avatar
Seblu committed
		</tr>
Seblu's avatar
Seblu committed
	<tr>
Seblu's avatar
Seblu committed
	<td bgcolor="#303030">
Seblu's avatar
Seblu committed
	<table cellpadding="0" cellspacing="0" width="100%">
Seblu's avatar
Seblu committed
		<tr>
Seblu's avatar
Seblu committed
	';

	  if (mysql_num_rows($result)){
Seblu's avatar
Seblu committed
	    $blacklist = mysql_fetch_array($result);
Seblu's avatar
Seblu committed
	  }

	  $str .= '
Seblu's avatar
Seblu committed
	    <form name="saisie" method="post" action="index.php?html=AdminHome&section_admin=DelBlacklist&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
	    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
		    <TR><TD> Login du boulet: </TD>
		    <TD>'.$blacklist["blacklist_login"].'</TD>
		    </TR>
Seblu's avatar
Seblu committed
		    <TR>
		    <TD> Pseudo: </TD>
		    <TD>
Seblu's avatar
Seblu committed
		     ' .$blacklist["blacklist_pseudo"].'
Seblu's avatar
Seblu committed
		    </TD>
		    </TR>
Seblu's avatar
Seblu committed
		    <TR><TD> Mail: </TD>
		    <TD> '.$blacklist["blacklist_mail"].' </TD>
		    </TR>

		    <TR><TD>Date de blacklist: </TD>
		    <TD>
Seblu's avatar
Seblu committed
		    '.$blacklist["blacklist_date"].'
Seblu's avatar
Seblu committed
		    </TD>
		    </TR>

		    <TR><TD>Raison: </TD>
		    <TD>
		    '.$blacklist["blacklist_reason"].'
		    </TD>
		    </TR>

		    <TR><TD>Essais de Connexion: </TD>
		    <TD>
		    '.$blacklist["blacklist_try"].'
		    </TD>
		    </TR>

		    <TR>
		    <TD> </TD>
		    <TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  SUPPRIMER  "> </TD>
Seblu's avatar
Seblu committed
		    </TR>
Seblu's avatar
Seblu committed
    	</TABLE>
	</FORM>
	</TR>
   </TABLE>
   </TD>
   </TR>
</TABLE>

';

return $str;

}


//////////////////////////////////////////////////
//////////  All Sites For Blacklisted ////////////
//////////////////////////////////////////////////


function	dispAdminAddBlacksite() {

	/////// BEGIN TABLE UP ///////
	$str = dispTableBegin("a d d &nbsp; s i t e", "80", 1);
	$str .= '
		<tr>
		<td>
Seblu's avatar
Seblu committed
		    <FORM name="saisie" method="post" action="index.php?html=AdminHome&section_admin=AddBlacksite&blacksite_id='.blacksite_id.'">
Seblu's avatar
Seblu committed
		    <TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
Seblu's avatar
Seblu committed
			    <TR><TD> Adresse du Site: </TD>
			    <TD> <INPUT TYPE="text" NAME="blacksite_get_adress" VALUE="" SIZE="50" MAXLENGTH="150"> </TD>
			    </TR>

			    <TR>
				    <TD> </TD>
				    <TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  ADD  "> </TD>
			    </TR>
			    <TR>
			 	   <TD> </TD>
				   <TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
			    </TR>
		    </TABLE>
		    </FORM>
		</td>
		</tr>
	';

	$str .= dispTableEnd();

return $str;

}


function	dispAdminModifBlacksite() {

	$element_id =$_GET['element_id'];

	$result = getOneBlacksiteById($element_id);

	/////// BEGIN TABLE UP ///////
	$str = dispTableBegin("m o d i f &nbsp; s i t e", "80", 1);
	$str .= '
		<tr>
		<td>
Seblu's avatar
Seblu committed
		<table width="100%" border="0" cellspacing="2" cellpadding="2">
Seblu's avatar
Seblu committed
	';
	  if (mysql_num_rows($result)){
Seblu's avatar
Seblu committed
	    $blacksite = mysql_fetch_array($result);

Seblu's avatar
Seblu committed
		$str .= '
Seblu's avatar
Seblu committed
			<FORM name="saisie" method="post" action="index.php?html=AdminHome&section_admin=ModifBlacksite&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
			    <TR><TD> Adresse du Site a modifier: </TD>
			    <TD> <INPUT TYPE="text" NAME="blacksite_get_adress" VALUE="'.$blacksite["blacksite_adress"].'" SIZE="50" MAXLENGTH="150"> </TD>
			    </TR>

			    <TR>
			    <TD> </TD>
			    <TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  UPDATE  "> </TD>
			    </TR>
			    <TR>
			    <TD> </TD>
			    <TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
			    </TR>
			</FORM>
		';
	  }

	$str .= '
		</table>
		</td>
		</tr>
	';

	$str .= dispTableEnd();

return $str;

}


function	dispAdminDelBlacksite() {

	$element_id =$_GET['element_id'];

	$result = getOneBlacksiteById($element_id);

	$str = dispTableBegin("d e l e t e &nbsp; s i t e", "80", 1);
	$str .= '
		<tr>
		<td>
Seblu's avatar
Seblu committed
		<table width="100%" border="0" cellspacing="2" cellpadding="2">
Seblu's avatar
Seblu committed
	';

	  if (mysql_num_rows($result)){
Seblu's avatar
Seblu committed
	    $blacksite = mysql_fetch_array($result);
Seblu's avatar
Seblu committed

		$str .= '
Seblu's avatar
Seblu committed
			<FORM name="saisie" method="post" action="index.php?html=AdminHome&section_admin=DelBlacksite&element_id='.$element_id.'">
Seblu's avatar
Seblu committed
				<TR><TD> Site a effacer: </TD>
				<TD><A HREF='.$blacksite["blacksite_adress"].'>'.$blacksite["blacksite_adress"].'</A></TD>
				</TR>
				<TR>
				<TD> </TD>
				<TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE="  SUPPRIMER  "> </TD>
Seblu's avatar
Seblu committed
				</TR>
Seblu's avatar
Seblu committed
			</FORM>
		';
	  }

	$str .= '
		</table>
		</td>
		</tr>
	';

	$str .= dispTableEnd();

return $str;

}

?>