Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
2e8577da
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2e8577da
编写于
8月 15, 2022
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、修复目录遍历问题
2、个人信息修改限制修改名称、工号、唯一编码
上级
6f28e7b6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
42 addition
and
27 deletion
+42
-27
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionEdit.java
...ganization/assemble/personal/jaxrs/person/ActionEdit.java
+2
-8
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/BaseAction.java
...ganization/assemble/personal/jaxrs/person/BaseAction.java
+2
-2
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionOpen.java
...in/java/com/x/program/center/jaxrs/config/ActionOpen.java
+8
-3
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionOpenRuntimeConfig.java
.../program/center/jaxrs/config/ActionOpenRuntimeConfig.java
+4
-4
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionSave.java
...in/java/com/x/program/center/jaxrs/config/ActionSave.java
+8
-7
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ConfigAction.java
.../java/com/x/program/center/jaxrs/config/ConfigAction.java
+1
-1
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ExceptionIllegalFileName.java
...program/center/jaxrs/config/ExceptionIllegalFileName.java
+13
-0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/module/ActionDispatchResource.java
...x/program/center/jaxrs/module/ActionDispatchResource.java
+4
-2
未找到文件。
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionEdit.java
浏览文件 @
2e8577da
...
...
@@ -38,9 +38,7 @@ class ActionEdit extends BaseAction {
/** 从内存中pick出来的无法作为实体保存 */
person
=
emc
.
find
(
person
.
getId
(),
Person
.
class
);
Wi
.
copier
.
copy
(
wi
,
person
);
this
.
checkName
(
business
,
person
.
getName
(),
person
.
getId
());
this
.
checkMobile
(
business
,
person
.
getMobile
(),
person
.
getId
());
this
.
checkEmployee
(
business
,
person
.
getEmployee
(),
person
.
getId
());
this
.
checkMail
(
business
,
person
.
getMail
(),
person
.
getId
());
/** 不能更新person的superior 和 controllerList */
emc
.
beginTransaction
(
Person
.
class
);
...
...
@@ -61,17 +59,13 @@ class ActionEdit extends BaseAction {
private
static
final
long
serialVersionUID
=
1571810726944802231L
;
// static WrapCopier<Wi, Person> copier = WrapCopierFactory.wi(Wi.class, Person.class, null,
// ListTools.toList(JpaObject.FieldsUnmodify, "icon", "iconMdpi", "iconLdpi", "pinyin", "pinyinInitial",
// "password", "passwordExpiredTime", "lastLoginTime", "lastLoginAddress", "lastLoginClient",
// "superior", "controllerList"));
static
WrapCopier
<
Wi
,
Person
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Person
.
class
,
null
,
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Person
.
icon_FIELDNAME
,
Person
.
iconMdpi_FIELDNAME
,
Person
.
iconLdpi_FIELDNAME
,
Person
.
pinyin_FIELDNAME
,
Person
.
pinyinInitial_FIELDNAME
,
Person
.
password_FIELDNAME
,
Person
.
passwordExpiredTime_FIELDNAME
,
Person
.
lastLoginTime_FIELDNAME
,
Person
.
lastLoginAddress_FIELDNAME
,
Person
.
lastLoginClient_FIELDNAME
,
Person
.
superior_FIELDNAME
,
Person
.
controllerList_FIELDNAME
,
Person
.
ipAddress_FIELDNAME
));
Person
.
controllerList_FIELDNAME
,
Person
.
ipAddress_FIELDNAME
,
Person
.
name_FIELDNAME
,
Person
.
unique_FIELDNAME
,
Person
.
employee_FIELDNAME
));
}
public
static
class
Wo
extends
WoId
{
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/BaseAction.java
浏览文件 @
2e8577da
...
...
@@ -120,7 +120,7 @@ abstract class BaseAction extends StandardJaxrsAction {
protected
void
checkEmployee
(
Business
business
,
String
employee
,
String
excludeId
)
throws
Exception
{
if
(
StringUtils
.
isNotEmpty
(
employee
))
{
if
(
StringUtils
.
isEmpty
(
employee
)
||
(!
StringTools
.
isSimply
(
employee
)
))
{
if
(
!
StringTools
.
isSimply
(
employee
))
{
throw
new
ExceptionInvalidEmployee
(
employee
);
}
if
(
StringUtils
.
isNotEmpty
(
business
.
person
().
getWithEmployee
(
employee
,
excludeId
)))
{
...
...
@@ -140,4 +140,4 @@ abstract class BaseAction extends StandardJaxrsAction {
}
}
}
\ No newline at end of file
}
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionOpen.java
浏览文件 @
2e8577da
...
...
@@ -6,6 +6,7 @@ import java.util.Date;
import
javax.servlet.http.HttpServletRequest
;
import
com.x.base.core.project.tools.StringTools
;
import
org.apache.commons.io.FileUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -19,8 +20,12 @@ import com.x.base.core.project.logger.LoggerFactory;
import
com.x.base.core.project.tools.DefaultCharset
;
import
org.apache.commons.lang3.StringUtils
;
/**
* 获取配置文件
* @author sword
*/
public
class
ActionOpen
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionOpen
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionOpen
.
class
);
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
...
...
@@ -30,8 +35,8 @@ public class ActionOpen extends BaseAction {
if
(
StringUtils
.
isBlank
(
fileName
))
{
throw
new
ExceptionNameEmpty
();
}
if
(
fileName
.
indexOf
(
SLASH
)
>
-
1
){
throw
new
Exception
(
"名称不能包含'/'!"
);
if
(
!
StringTools
.
isFileName
(
fileName
)
){
throw
new
Exception
IllegalFileName
(
fileName
);
}
File
file
=
new
File
(
Config
.
base
(),
"config/"
+
fileName
);
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionOpenRuntimeConfig.java
浏览文件 @
2e8577da
...
...
@@ -9,10 +9,10 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DefaultCharset
;
import
com.x.base.core.project.tools.StringTools
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.File
;
/**
...
...
@@ -20,7 +20,7 @@ import java.io.File;
* @author sword
*/
public
class
ActionOpenRuntimeConfig
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionOpenRuntimeConfig
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionOpenRuntimeConfig
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
...
...
@@ -30,8 +30,8 @@ public class ActionOpenRuntimeConfig extends BaseAction {
if
(
StringUtils
.
isBlank
(
fileName
))
{
throw
new
ExceptionNameEmpty
();
}
if
(
fileName
.
indexOf
(
SLASH
)
>
-
1
){
throw
new
Exception
(
"名称不能包含'/'!"
);
if
(
!
StringTools
.
isFileName
(
fileName
)
){
throw
new
Exception
IllegalFileName
(
fileName
);
}
File
file
=
new
File
(
Config
.
base
(),
"config/"
+
fileName
);
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionSave.java
浏览文件 @
2e8577da
...
...
@@ -13,6 +13,7 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
com.x.base.core.project.tools.StringTools
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.google.gson.Gson
;
...
...
@@ -35,9 +36,9 @@ import org.apache.commons.lang3.StringUtils;
* @author sword
*/
public
class
ActionSave
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionSave
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionSave
.
class
);
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
...
...
@@ -48,8 +49,8 @@ public class ActionSave extends BaseAction {
if
(
StringUtils
.
isBlank
(
fileName
))
{
throw
new
ExceptionNameEmpty
();
}
if
(
fileName
.
indexOf
(
SLASH
)
>
-
1
){
throw
new
IllegalAccessException
(
"名称不能包含'/'!"
);
if
(
!
StringTools
.
isFileName
(
fileName
)
){
throw
new
ExceptionIllegalFileName
(
fileName
);
}
String
data
=
wi
.
getFileContent
();
...
...
@@ -80,7 +81,7 @@ public class ActionSave extends BaseAction {
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
this
.
configFlush
(
effectivePerson
);
...
...
@@ -124,11 +125,11 @@ public class ActionSave extends BaseAction {
dos
.
write
(
bytes
,
0
,
length
);
dos
.
flush
();
}
logger
.
info
(
"同步文件{}到节点{}完成......."
,
syncFilePath
,
nodeName
);
LOGGER
.
info
(
"同步文件{}到节点{}完成......."
,
syncFilePath
,
nodeName
);
}
syncFileFlag
=
true
;
}
catch
(
Exception
ex
)
{
logger
.
warn
(
"同步文件{}到节点{}异常:{}"
,
syncFilePath
,
nodeName
,
ex
.
getMessage
());
LOGGER
.
warn
(
"同步文件{}到节点{}异常:{}"
,
syncFilePath
,
nodeName
,
ex
.
getMessage
());
syncFileFlag
=
false
;
}
return
syncFileFlag
;
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ConfigAction.java
浏览文件 @
2e8577da
...
...
@@ -318,7 +318,7 @@ public class ConfigAction extends StandardJaxrsAction {
ActionResult
<
ActionSave
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionSave
().
execute
(
request
,
effectivePerson
,
jsonElement
);
result
=
new
ActionSave
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ExceptionIllegalFileName.java
0 → 100644
浏览文件 @
2e8577da
package
com.x.program.center.jaxrs.config
;
import
com.x.base.core.project.exception.LanguagePromptException
;
class
ExceptionIllegalFileName
extends
LanguagePromptException
{
private
static
final
long
serialVersionUID
=
-
8324509965998709044L
;
public
ExceptionIllegalFileName
(
String
name
)
{
super
(
"无效的文件名称:{}."
,
name
);
}
}
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/module/ActionDispatchResource.java
浏览文件 @
2e8577da
...
...
@@ -2,6 +2,7 @@ package com.x.program.center.jaxrs.module;
import
java.io.File
;
import
com.x.base.core.project.tools.StringTools
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.glassfish.jersey.media.multipart.FormDataContentDisposition
;
...
...
@@ -34,8 +35,9 @@ class ActionDispatchResource extends BaseAction {
if
(
StringUtils
.
isEmpty
(
file
))
{
file
=
this
.
fileName
(
disposition
);
}
if
((
file
.
indexOf
(
"/"
)
>
-
1
)
||
(!
file
.
toLowerCase
().
endsWith
(
".zip"
)
&&
StringUtils
.
isEmpty
(
filePath
))
||
(
bytes
==
null
||
bytes
.
length
==
0
))
{
boolean
flag
=
(!
StringTools
.
isFileName
(
file
))
||
(!
file
.
toLowerCase
().
endsWith
(
".zip"
)
&&
StringUtils
.
isEmpty
(
filePath
))
||
(
bytes
==
null
||
bytes
.
length
==
0
);
if
(
flag
)
{
throw
new
ExceptionIllegalFile
(
file
);
}
if
(
StringUtils
.
isNotEmpty
(
filePath
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录