Skip to content

Commit

Permalink
修复onlyoffice保存文件失败的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zyx0814 committed Sep 11, 2018
1 parent 48291fa commit 7bc7505
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
2. github地址:https://github.com/zyx0814/dzzoffice
3. 码云地址: https://gitee.com/zyx0814/dzzoffice

### DzzOffice2.01主要更新内容
### DzzOffice2.02主要更新内容

1. 缓存优化,开启内存huanc(如:memcached等)会显著提高效率;

Expand Down
2 changes: 1 addition & 1 deletion core/class/io/io_dzz.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public function setFileContent($rid, $fileContent, $force = false, $nocover = tr
'ext' => $attach['filetype'],
'dateline' => TIMESTAMP
);
$return = C::t('resources_version')->add_new_version_by_rid($icoarr['rid'], $setarr);
$return = C::t('resources_version')->add_new_version_by_rid($icoarr['rid'], $setarr,$force);
if($return['error']){
return array('error'=>$return['error']);
}
Expand Down
8 changes: 4 additions & 4 deletions core/class/table/table_resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ public function fetch_by_rid($rid, $force_from_db = false)
$data['url'] = DZZSCRIPT . '?mod=document&icoid=' . dzzencode('attach::' . $data['aid']);
$data['img'] = isset($data['img']) ? $data['img'] : geticonfromext($data['ext'], $data['type']);
} elseif ($data['type'] == 'folder') {
$contaions = self::get_contains_by_fid($data['oid'], true);
$data['contaions'] = $contaions;
//$contaions = self::get_contains_by_fid($data['oid'], true);
//$data['contaions'] = $contaions;
$relativepath = str_replace(':', '', strrchr($data['path'], ':'));
$data['position'] = substr($relativepath, 0, strlen($relativepath) - 1);
$data['fsize'] = formatsize($contaions['size']);
$data['ffsize'] = lang('property_info_size', array('fsize' => formatsize($contaions['size']), 'size' => $contaions['size']));
$data['contain'] = lang('property_info_contain', array('filenum' => $contaions['contain'][0], 'foldernum' => $contaions['contain'][1]));
// $data['ffsize'] = lang('property_info_size', array('fsize' => formatsize($contaions['size']), 'size' => $contaions['size']));
// $data['contain'] = lang('property_info_contain', array('filenum' => $contaions['contain'][0], 'foldernum' => $contaions['contain'][1]));
$data['img'] = './dzz/images/extimg/folder.png';
} else {
$data['img'] = isset($data['img']) ? $data['img'] : geticonfromext($data['ext'], $data['type']);
Expand Down
4 changes: 2 additions & 2 deletions core/class/table/table_resources_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ public function delete_by_rid($rid){
$this->clear_cache($cachekey);
}
//上传新版本
public function add_new_version_by_rid($rid,$setarr){
public function add_new_version_by_rid($rid,$setarr,$force=false){
global $_G,$documentexts;
$cachekey = 'resourcesversiondata_'.$rid;
if(!$resources = C::t('resources')->fetch_info_by_rid($rid)){
return array('error'=>lang('file_not_exist'));
}
//检测权限
if (!perm_check::checkperm_Container($resources['pfid'], 'edit2') && !( $_G['uid'] == $resources['uid'] && perm_check::checkperm_Container($resources['pfid'], 'edit1'))) {
if (!$force && !perm_check::checkperm_Container($resources['pfid'], 'edit2') && !( $_G['uid'] == $resources['uid'] && perm_check::checkperm_Container($resources['pfid'], 'edit1'))) {
return array('error'=>lang('no_privilege'));
}
//文件类型获取
Expand Down

0 comments on commit 7bc7505

Please sign in to comment.