dzzoffice/admin/cloud/space.php
小胡 77979b6ed5
更新至V2.3.2版本,离线升级的用户需要执行升级程序 (#278)
* 优化百度编辑器,修复编辑器插入的图片不能预览问题

* 处理系统异常时登录无反应问题

* 更新至V2.3.1版本,离线升级的用户需要执行升级程序
2025-01-16 21:17:09 +08:00

60 lines
1.9 KiB
PHP

<?php
/*
* @copyright Leyun internet Technology(Shanghai)Co.,Ltd
* @license http://www.dzzoffice.com/licenses/license.txt
* @package DzzOffice
* @link http://www.dzzoffice.com
* @author zyx(zyx@dzz.cc)
*/
if(!defined('IN_DZZ') || !defined('IN_ADMIN')) {
exit('Access Denied');
}
$cloud=DB::fetch_first("select * from %t where bz='dzz'",array('connect'));
$navtitle=$cloud['name'].' - '.lang('space_management').' - '.lang('cloud_set');
if($_GET['do']=='checkspace'){
$remoteid=intval($_GET['remoteid']);
if($arr=C::t('local_storage')->update_sizecount_by_remoteid($remoteid)){
$arr['fusesize']=formatsize($arr['usesize']);
if ($arr['totalsize'])
$arr['ftotalsize'] = formatsize($arr['totalsize']);
else
$arr['ftotalsize'] = lang('unlimited');
}
echo json_encode($arr);
exit();
}elseif($_GET['do']=='delete'){
$remoteid=intval($_GET['remoteid']);
$re=C::t('local_storage')->delete_by_remoteid($remoteid);
if($re['error']) showmessage($re['error'],dreferer());
showmessage('do_success',dreferer());
}else{
if(submitcheck('cloudsubmit')){
$isdefault=intval($_GET['isdefault']);
foreach($_GET['name'] as $remoteid => $value){
$setarr=array(
'disp'=>intval($_GET['disp'][$remoteid]),
'isdefault'=>($remoteid==$isdefault)?1:0
);
if(!empty($value)) $setarr['name']=getstr($value);
C::t('local_storage')->update($remoteid,$setarr);
}
showmessage('do_success',dreferer());
}else{
$list=array();
foreach(C::t('local_storage')->fetch_all_orderby_disp() as $key=>$value){
if($arr=C::t('local_storage')->update_sizecount_by_remoteid($value['remoteid'])){
$value['fusesize']=formatsize($value['usesize']);
if ($value['totalsize'])
$value['ftotalsize'] = formatsize($value['totalsize']);
else
$value['ftotalsize'] = lang('unlimited');
}
$list[]=$value;
}
}
include template('space');
}
?>