分离目录和文件的层数;添加umask

This commit is contained in:
wlx 2012-09-18 06:29:28 +00:00
parent 3e95a555f6
commit 1669857d02
1 changed files with 6 additions and 3 deletions

View File

@ -170,8 +170,10 @@ class SubmitController extends Zend_Controller_Action
$row1 = $sth->fetch();
if(!empty($row1['passwd']))
{
$this->chmodr($row1['homedir'],0444);
{
$old=umask(0);
$this->chmodr($row1['homedir'],0444);
umask($old);
}
$path = $row1['homedir'];
@ -208,7 +210,8 @@ class SubmitController extends Zend_Controller_Action
$filename = mb_substr($v,mb_strlen($path)+1);
$filesize = filesize($v);
$isdir=is_dir($v)?1:0;
$depth=substr_count($filename,"/");
$depth=substr_count($filename,"/")+1;
if (substr($filename,-1,1)=='/') $depth--;
//$this->chmodr($path.$v,0444);
$sql = "INSERT INTO datafile (dsid,filename,filesize,isdir,depth) VALUES (?,?,?,?,?)";
$sth = $this->db->prepare($sql);