KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/abtechsci/mmc15/ezupload/cp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/abtechsci/mmc15/ezupload/cp/fm.php
<?php
session_start();
//for demo version, comment the following line and add the next lines untill "####"
//require("header.php");

error_reporting(E_ERROR  | E_PARSE);

include_once("db.class.php");
include_once("Backup_schedule.php");
//include_once("header.php");

//security module
$setting=new settings();
$temp=$setting->get();
$adminname=$temp[0]->adminname;
$adminpass=$temp[0]->adminpass;


$IsAdmin = false;

$form_setting=new form_setting();
$temp=$form_setting->get();
$uformprotect=$temp[0]->uformprotect;


//private form mode
if($uformprotect==1)
{
  
   if( $_SESSION['PU']== "" ||$_SESSION["PP"]== "")
	{	
        //not a user at all
		header("location: upload_login.php");
		exit;
	}
     $user = new user();
	 $temp = $user->get($_SESSION['PU']);
    if($temp[0]->name ==$adminname )
    {
      $IsAdmin = true;
      $reg_name= $adminname;
    
      
    }
    else
    {
    
     $IsAdmin = false;
   	 $reg_email = $temp[0]->email;
	 $reg_name = $temp[0]->name;
     
   }
}
else
{
  
  if($_SESSION["U"] == "" || $_SESSION["P"]== "" )
  {
	header("location: login.php");
     exit;
   }
  if($_SESSION["U"] != $adminname || $_SESSION["P"] != crypt($adminpass,"AF") )
    {

	header("location: login.php");
	exit;
    }

}
$sysdt= date('Y-m-d',time());
$sysdtonly= date('Y-m-d-H-i-s');


//Allow no cache to the browser//
if (!headers_sent())
{
    header( "Cache-Control: no-cache, must-revalidate" );
    header( "Pragma: no-cache" );
}

#############################################################

$page=$_POST["page"];
if(empty($page)) $page = $_GET['page'];
$query = $_GET['query'];
if(empty($query)) $query=$_POST["query"];
$search_value = $_POST['search_value'];

$submit=trim($_POST["submit"]);

$title=$_POST["title"];
$content=$_POST["content"];

//vars
$is_next =1;
$is_prev =1; 
$paging_size = 15;
	
if($submit != "" )
{
	if( $submit == "Email All Uploaders" )
	{	
		$setting=new settings();
		$temp=$setting->get();
		$adminemail=$temp[0]->adminemail;
		
		$emailbrowser=new browser();
		$temp=$emailbrowser->get_emaillist() ;
		for( $e=0; $e < count($temp) ; $e++ )
		{				
			$email=$temp[$e]->email;

			$postoffice=new postoffice() ;
			$postoffice->from=$adminemail;
			$postoffice->to=$email;
			$postoffice->subject=$title;
			$postoffice->email_body=$content;
			$emailstatus=$postoffice->send();
			
		}
			
		if($emailstatus==1)
		{
			//echo "<font color=red ><b>The email was successfully sent!</b></font>";  
			$title="" ;
			$content="";
		} 
		else 
		{  
			//echo "<font color=red ><b>Sorry but the email could not be sent. Please go back and try again!</b></font>" ;  
		}
		
	}
	else
	{		
		if($submit=="Search" )
		{	$page=1;
			$query = $search_value;			
		}
		if($submit =="Show All")
		{
			$page =1;
			unset($query);
			unset($search_value);
		}
		elseif($submit=="Next" )
		{	$page=$page + 1;
		}
		elseif($submit=="Prev" )
		{	$page=$page - 1 ;
		}
		elseif($submit=="Delete ALL Uploads" )
		{	
			//header("location: upload_cleaner_all.php");				
			//exit;			

			$upload_setting=new upload_setting();
			$temp=$upload_setting->get();

			$root=$temp[0]->upload_dir;
			$autodel_files=$temp[0]->autodel_files;

			$root_dir = opendir($root);
			while($file_file = readdir($root_dir))
			{
				if($file_file != '.' && $file_file != '..' )
				{
					unlink( $root .'/'.$file_file );			
				}
			}


			$uploads=new uploads();
			$uploads->delete_all_upload();	

			$error= "All Uploads have been cleared";


			//

		}
	}
	
}


//***************************** paging section *******************************//
if($page < 1 ) { $page=1 ;}
$start = ( $page-1 ) * $paging_size ;

$browser=new browser();
$count = $browser->get_uploads_count($query);


if($start ==0) //first page
{
	$is_prev = 0;	
}

if($count <= $start+$paging_size ) //last page
{
	$is_next =0;
}

if($count ==0) //no rows
{
	$is_next =0;
	$is_prev =0;
}

//enable and disabled 'show all' button
if(empty($query))
{
	$show_all_disabled = 1;
}
else
{
	$show_all_disabled = 0;
}


//get sql statment

if($query == "" ){
 
  if($IsAdmin==false)
  {
  
   $temp=$browser->get( $start , $paging_size,$reg_name,false );
   }
  else
  {
  
	$temp=$browser->get( $start , $paging_size );
	}
}
else{
    if($IsAdmin==false)
	$temp=$browser->search( $query, $start , $paging_size,$reg_name,false );
	else
	$temp=$browser->search( $query, $start , $paging_size);
}

//***************************** end paging section *******************************//
?>
<HTML><HEAD><TITLE>Control Panel</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<!--For help tooltips-->
<SCRIPT language="JavaScript1.2" src="f_files/help_tips/main.js" type="text/javascript"></SCRIPT> 

<LINK href="f_files/global.css" type=text/css rel=stylesheet>
<script language="javascript" type="text/javascript" src="js/main.js"></script>
</HEAD>

<BODY <?php if($error !=""){ echo "onLoad=\"alert('$error')\"" ; }  ?> >
<!--For help tooltips-->
<DIV id="TipLayer" style="visibility:hidden;position:absolute;z-index:1000;top:-100;"></DIV>
<SCRIPT language="JavaScript1.2" src="f_files/help_tips/style.js" type="text/javascript"></SCRIPT> 

<div align="center">
	<table border="1" cellpadding="0" cellspacing="0" width="100" bordercolor="#000000" id="table1">
		<tr>
			<td>
		<?php echo "<form method=\"post\" action=" .  $_SERVER['PHP_SELF'] .">" ?>				  			
<TABLE width="770" height="511" align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF" class="main_table" id="table2">
	<TR>
   <TD vAlign=top height=150 width="341">
		<img border="0" src="f_files/header_home.jpg">
    </TD>
</TR>
<?php require("upload_login_status.php"); ?>
<TR>
	<TD width="744" height=13 bgcolor="#C1D1FF" class="normal_td">
	<a href="upload_form.php"><B>       Upload More Files</B></a>
    </TD>
</TR>
<tr>
	<td>

    </td>
</tr>
	<tr>
      <TD height=259 align="center" bgcolor="#FFFFFF">        <div align="center">
        <br>
        <a href="" onMouseOver="stm(fm[0],Style);" onClick="return false;" onMouseOut="htm()"><img src="f_files/help_icon_small.jpg" alt="" width="40" height="40" border="0"></a><br>
<table border="0" cellpadding="0" cellspacing="0" width="748" id="table3" height="347">
					<tr>
					  <td height="18" align="right" valign="top">&nbsp;</td>
					  <td align="left" valign="top">&nbsp;</td>
				  </tr>
					<tr>
                      <td width="363" height="37" align="right" valign="top"><input name="search_value" type="text" id="search_value" size="15" value="<?php echo $search_value?>"></td>
					  <td width="385" align="left" valign="top">&nbsp;
                          <input name="submit" type="submit" class="button" id="submit" value="Search">
                          <input name="submit" type="submit" class="button" id="submit" value="Show All" <?php if($show_all_disabled==1) echo "disabled" ?>>
                          <input name="query" type="hidden" id="query" value="<?php echo $query?>"></td>
				  </tr>
					<tr>
						<td height="146" colspan="2" valign="top">
						  <table width="402" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#8FABFF" class="main_table" id="table4">
						    <tr>
						      <td colspan="4" valign="middle" bgcolor="#C1D1FF" class="t_header"><div class="div_1">File Manager</div></td>
						    </tr>
						    <tr>
						      <td align="center" bgcolor="#EAEFFF" class="t_sub_header">Uploaded by</td>
							    <td align="center" bgcolor="#EAEFFF" class="t_sub_header"> Number of files</td>
							    <td align="center" bgcolor="#EAEFFF" class="t_sub_header">Date</td>
							    <td align="center" bgcolor="#EAEFFF" class="t_sub_header">Action</td>
						    </tr>
						    
						    <?php
						for( $a=0; $a < count($temp) && $a < 10 ; $a++ )
						{
						$id=$temp[$a]->id;
						$name=$temp[$a]->name;
						$dt=$temp[$a]->dt;
						$desc=$temp[$a]->desc;
					?>
						    
						    <tr onClick="window.location.href='fd.php?uid=<?php echo "$id&page=$page&query=$query" ; ?>'"   onMouseOver="this.style.cursor='hand';tplTrOver(this);" onMouseOut="tplTrOut(this)" >
						      <td width="78" valign="middle" class="td_1"><?php echo $name ; ?></td>
                        <td width="98" valign="middle" class="td_2"><?php echo $desc ; ?>
                          Files</td>
                        <td width="146" valign="middle" class="td_1"><?php echo $dt ; ?></td>
					    <td width="70" align="center" valign="middle" class="td_2">					      <A href="fd.php?uid=<?php echo "$id&page=$page&query=$query" ; ?>">View</A>	     				      </td>
					  </tr>
						    <?php
						}
					?>
					      </table>
					  <p></td></tr>

					<TR>
                      <TD colspan="2" >
                        <TABLE border="0" cellpadding="0" cellspacing="0" align=center bordercolor="#8FABFF" >
						  <INPUT type=hidden value="<?php echo $page ; ?>" name=page >
                          <TBODY>
                          <TR>
                            <TD align=left>
							<INPUT name=submit type=submit class="button" onClick="return confirm(&quot;Are you sure you want to delete Uploads permanently?&quot;);" value="Delete ALL Uploads" >
							&nbsp;&nbsp;&nbsp;							</TD>
                            <TD align=right>
							<INPUT name=submit type=submit class="button" value="  Prev  " <?php if($is_prev==0) echo "disabled" ?>>
					    <INPUT name=submit type=submit class="button" value="  Next  " <?php if($is_next==0) echo "disabled" ?> >						</TD></TR></TBODY></TABLE>			  </TD></FORM>	
					</TR>

<tr>
						<td colspan="2">
						<p align="center">&nbsp;</p></form>
						<br>
&nbsp;</td>
		    </tr>
	    </TABLE>		</td>
	  </tr>
	  <?php include("footer.php"); ?>
	</table>
</BODY>
</HTML>

Anon7 - 2021