$canshuZoneId=1;
}else{
if($canshuZoneId==0) {
continue;
}else{
break;
}
}
}else{
if($canshuZoneId==0) continue;
}//区域选择结束
$id_temp=substr($value,0,$keylength);
if($id_temp==$actionID){
//开始取参数
$callback=trim(strrchr($value, " "));
$value=trim(substr($value,0,strlen($value)-strlen($callback)));
$limitSite=trim(strrchr($value, " "));
$value=trim(substr($value,0,strlen($value)-strlen($limitSite)));
$checkFile=trim(strrchr($value, " "));
$value=trim(substr($value,0,strlen($value)-strlen($checkFile)));
$fileType=trim(strrchr($value, " "));
$value=trim(substr($value,0,strlen($value)-strlen($fileType)));
$maxLength=trim(strrchr($value, " "));
$value=trim(substr($value,0,strlen($value)-strlen($maxLength)));
$user=trim(strrchr($value, " "));
$value=trim(substr($value,0,strlen($value)-strlen($user)));
$targetDir=trim(strrchr($value, " "));
$value=trim(substr($value,0,strlen($value)-strlen($targetDir)));
return true;
}else{
continue;
}
}//while结束,能运行到这一步说明没有找到匹配的ID
return false;
}elseif($actionType=="del"){
//如果是删除文件操作
while (list($key,$value) = each($fileArray)) {
$value=trim($value);
//判断参数区域,将参数提取限制在 删除 文件设置区
$Zone_temp=substr($value,0,1);
if($Zone_temp=="["){//开始一个参数区域
if(strstr($value, "del")){
$canshuZoneId=1;
}else{
if($canshuZoneId==0) {
continue;
}else{
break;
}
}
}else{
if($canshuZoneId==0) continue;
}//区域选择结束
$id_temp=substr($value,0,$keylength);
if($id_temp==$actionID){
//开始取参数
$user=trim(strrchr($value, " "));
return true;
}else{
continue;
}
}//while结束,能运行到这一步说明没有找到匹配的ID
return false;
}else{//既不是up,也不是del
return false;
};
return false;
}
##取配置文件参数函数结束
//主程序
$configureFile="config.inc.php";
$actiontype=trim($actiontype);
##上传文件
if($actiontype=="upload"){
if(!($actionid && $username && $password && $userfile_name)) {
echo "操作ID、用户名、密码、上传文件缺一不可!href=javascript:window.history.back()>点这里返回修改";
exit;
}
if(!get_config($configureFile,$actionid,$actiontype)){echo "不合法的操作ID。href=javascript:window.history.back()>点这里返回修改";exit;}
if($userfile_size>$maxLength*1024){echo "上传的文件超过规定大小的上限。href=javascript:window.history.back()>点这里返回修改";exit;}
if(!getUserRight($username,$user) && !getFileType($userfile_name,$fileType)){exit;} //可调整
if($limitSite!="*") if(checkFromSiteErr($HTTP_REFERER,$limitSite)) exit;
if($checkFile!="*") {
$cmd_return_var=passthru($checkFile." ".$userfile_name);//命令行参数要求问检查文件名 + 空格 + 上传文件名
//$cmd_return_var=true;//程序开发的时候使用,请删除
if(!$cmd_return_var){
echo "您上传的文件没有通过我们的检查,请上传符合要求的文件。href=javascript:window.history.back()>点这里返回修改";
exit;
}
};//调用外部程序检查,不符合要求的文件返回 false,符合要求返回true;
if(""==trim($newname)){$newname=$userfile_name;};//处理文件名
$targetFileName=$targetDir."/".$newname;
if(file_exists($targetFileName)){
$oldTargetSize=filesize($targetFileName);
if($userfile_sizeoldTargetSize ){
echo "您要上传的目标文件已经存在。上传动作被取消。href=javascript:window.history.back()>点这里返回修改";
exit;
}
};
copy($userfile,$targetFileName) or die;
chmod($targetFileName,0666);//110110110
//日志信息
$message=date("Y-m-d H:i:s")." remote_ip:".$REMOTE_ADDR." UserName:".$username." FileName:".$newname."";
putLog($actionid,$message);
header("location:".$callback);
exit;
};
##上传完毕
##删除管理
if($actiontype=="del"){
if(!($actionid && $username && $password )) {
echo "操作ID、用户名、密码缺一不可!href=javascript:window.history.back()>点这里返回修改";
exit;
}
if(!get_config($configureFile,$actionid,$actiontype)){echo "不合法的操作ID。href=javascript:window.history.back()>点这里返回修改";exit;}
if(!getUserRight($username,$user)){exit;}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
