修复当关闭或指定成员个人存储时能显示没有权限的文件
2024-07-17 23:53 更新
为了获取更多最新内容及功能更新,请直接访问我们的首页以查看DzzOffice笔记的最新地址。
问题描述:
当关闭或指定成员个人存储时,搜索类型能显示没有权限的文件。
修复方法:
文件:\dzz\explorer\catsearch.php
原代码:
//用户自己的文件
if($explorer_setting['useronperm']){
$or[]="(r.gid=0 and r.uid=%d)";
$param[]=$_G['uid'];
}
//我管理的群组或部门的文件
if($orgids['orgids_admin']){
$or[]="r.gid IN (%n)";
$param[]=$orgids['orgids_admin'];
}
//我参与的群组的文件
if($orgids['orgids_member']){
$or[]="(r.gid IN(%n) and ((f.perm_inherit & %d) OR (r.uid=%d and f.perm_inherit & %d)))";
$param[]=$orgids['orgids_member'];
$param[]=$powerarr['read2'];
$param[]=$_G['uid'];
$param[]=$powerarr['read1'];
}
if($or) $wheresql .=" and (".implode(' OR ',$or).")";
$data=array();
$folderids=$folderdata=array();
if($total=DB::result_first("SELECT COUNT(*) FROM %t r LEFT JOIN %t f ON r.pfid=f.fid $wheresql", $param)){
foreach(DB::fetch_all("SELECT rid FROM %t r LEFT JOIN %t f ON r.pfid=f.fid $wheresql $ordersql $limitsql", $param) as $value){
if($arr=C::t('resources')->fetch_by_rid($value['rid'])){
$data[$arr['rid']]=$arr;
$folderids[$arr['pfid']]=$arr['pfid'];
if($arr['type']=='folder') $folderids[$arr['oid']]=$arr['oid'];
}
}
//获取目录信息
foreach($folderids as $fid){
if($folder = C::t('folder')->fetch_by_fid($fid)) $folderdata[$fid] =$folder;
}
}
修改后的代码:
//用户自己的文件
if($explorer_setting['useronperm']){
$or[]="(r.gid=0 and r.uid=%d)";
$param[]=$_G['uid'];
}
//我管理的群组或部门的文件
if($orgids['orgids_admin']){
$or[]="r.gid IN (%n)";
$param[]=$orgids['orgids_admin'];
}
//我参与的群组的文件
if($orgids['orgids_member']){
$or[]="(r.gid IN(%n) and ((f.perm_inherit & %d) OR (r.uid=%d and f.perm_inherit & %d)))";
$param[]=$orgids['orgids_member'];
$param[]=$powerarr['read2'];
$param[]=$_G['uid'];
$param[]=$powerarr['read1'];
}
if($or) {
$wheresql .=" and (".implode(' OR ',$or).")";
$data=array();
$folderids=$folderdata=array();
if($total=DB::result_first("SELECT COUNT(*) FROM %t r LEFT JOIN %t f ON r.pfid=f.fid $wheresql", $param)){
foreach(DB::fetch_all("SELECT rid FROM %t r LEFT JOIN %t f ON r.pfid=f.fid $wheresql $ordersql $limitsql", $param) as $value){
if($arr=C::t('resources')->fetch_by_rid($value['rid'])){
$data[$arr['rid']]=$arr;
$folderids[$arr['pfid']]=$arr['pfid'];
if($arr['type']=='folder') $folderids[$arr['oid']]=$arr['oid'];
}
}
//获取目录信息
foreach($folderids as $fid){
if($folder = C::t('folder')->fetch_by_fid($fid)) $folderdata[$fid] =$folder;
}
}
}
以上内容是否对您有帮助:
更多建议: