//获取文件目录列表,该方法返回数组
function getDir($dir=”) {
$dir=empty($dir) ? getcwd() : $dir;
$dirArray[]=NULL;
if (false != ($handle = opendir ( $dir ))) {
$i=0;
while ( false !== ($file = readdir ( $handle )) ) {
//去掉”“.”、“..”以及带“.xxx”后缀的文件
if ($file != “.” && $file != “..”&&!strpos($file,”.”)) {
$dirArray[$i]=$file;
$i++;
}
}
//关闭句柄
closedir ( $handle );
}
return $dirArray;
}
?>
目录权限批量设置
if(empty($_POST)){
?>
}else{
$directorys=@$_POST['directory'];
$Perm=trim(@$_POST['Perm']);
$User=trim(@$_POST['User']);
?>
@echo off
$BASE_DIR=getcwd();
if(is_array($directorys)){
foreach($directorys as $directory ){
echo <<
echo Y|cacls {$BASE_DIR}{$directory} /T /E /C /G {$User}:{$Perm}
EOF;
}
}
?>
pause
}
?>
|