Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
14f8a638
Commit
14f8a638
authored
Sep 29, 2018
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FileManager Add File chmod(php)
parent
f04c6f66
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
2 deletions
+63
-2
filemanager.js
source/core/custom/template/filemanager.js
+1
-1
filemanager.js
source/core/php/template/filemanager.js
+7
-0
en.js
source/language/en.js
+7
-0
zh.js
source/language/zh.js
+7
-0
files.js
source/modules/filemanager/files.js
+3
-0
index.js
source/modules/filemanager/index.js
+38
-1
No files found.
source/core/custom/template/filemanager.js
View file @
14f8a638
...
...
@@ -38,7 +38,7 @@ module.exports = () => ({
upload_file
:
{
_
:
'U'
,
'z1'
:
'#{path}'
,
'z2'
:
'#{
hex
::content}'
'z2'
:
'#{
buffer
::content}'
},
rename
:
{
...
...
source/core/php/template/filemanager.js
View file @
14f8a638
...
...
@@ -62,6 +62,13 @@ module.exports = (arg1, arg2, arg3) => ({
[
arg2
]:
"#{base64::time}"
},
chmod
:
{
_
:
`$m=get_magic_quotes_gpc();$FN=base64_decode(m?stripslashes($_POST["
${
arg1
}
"]):$_POST["
${
arg1
}
"]);$mode=base64_decode(m?stripslashes($_POST["
${
arg2
}
"]):$_POST["
${
arg2
}
"]);echo(chmod($FN,octdec($mode))?"1":"0");`
,
[
arg1
]:
"#{base64::path}"
,
[
arg2
]:
"#{base64::mode}"
},
mkdir
:
{
_
:
`$m=get_magic_quotes_gpc();$f=base64_decode($m?stripslashes($_POST["
${
arg1
}
"]):$_POST["
${
arg1
}
"]);echo(mkdir($f)?"1":"0");`
,
...
...
source/language/en.js
View file @
14f8a638
...
...
@@ -219,6 +219,12 @@ module.exports = {
success
:
(
path
)
=>
antSword
.
noxss
(
`Retime file success!\n
${
path
}
`
),
error
:
(
path
,
err
)
=>
antSword
.
noxss
(
`Retime file [
${
path
}
] failed!
${
err
?
'
\
n'
+
err
:
''
}
`
)
},
chmod
:
{
title
:
'Chmod File'
,
check
:
'Input should be octal numbers, eg: 0644'
,
success
:
(
path
)
=>
antSword
.
noxss
(
`Chmod file success!\n
${
path
}
`
),
error
:
(
path
,
err
)
=>
antSword
.
noxss
(
`Chmod file [
${
path
}
] failed!
${
err
?
'
\
n'
+
err
:
''
}
`
)
},
wget
:
{
title
:
'Wget File'
,
check
:
'URL is not correct!'
,
...
...
@@ -303,6 +309,7 @@ module.exports = {
upload
:
'Upload'
,
download
:
'Download'
,
modify
:
'Modify the file time'
,
chmod
:
'Chmod'
,
copy
:
{
title
:
'Copy'
,
warning
:
(
id
)
=>
antSword
.
noxss
(
`Already add to clipboard!\n
${
id
}
`
),
...
...
source/language/zh.js
View file @
14f8a638
...
...
@@ -220,6 +220,12 @@ module.exports = {
success
:
(
path
)
=>
antSword
.
noxss
(
`更改文件时间成功!\n
${
path
}
`
),
error
:
(
path
,
err
)
=>
antSword
.
noxss
(
`更改文件时间 [
${
path
}
] 失败!
${
err
?
'
\
n'
+
err
:
''
}
`
)
},
chmod
:
{
title
:
'更改权限'
,
check
:
"输入应为八进制数表示的权限, eg: 0644"
,
success
:
(
path
)
=>
antSword
.
noxss
(
`更改文件权限成功!\n
${
path
}
`
),
error
:
(
path
,
err
)
=>
antSword
.
noxss
(
`更改文件权限 [
${
path
}
] 失败!
${
err
?
'
\
n'
+
err
:
''
}
`
)
},
wget
:
{
title
:
'Wget下载文件'
,
check
:
'URL地址不正确!'
,
...
...
@@ -304,6 +310,7 @@ module.exports = {
upload
:
'上传文件'
,
download
:
'下载文件'
,
modify
:
'更改文件时间'
,
chmod
:
'更改权限'
,
copy
:
{
title
:
'复制文件'
,
warning
:
(
id
)
=>
antSword
.
noxss
(
`已经添加到剪贴板!\n
${
id
}
`
),
...
...
source/modules/filemanager/files.js
View file @
14f8a638
...
...
@@ -323,6 +323,9 @@ class Files {
// manager.retimeFile(id, this.rowsAr[id]['cells'][2].innerText);
manager
.
retimeFile
(
id
,
this
.
getRowAttribute
(
_ids
[
0
],
'data'
)[
2
]);
}
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'chmod'
],
icon
:
'fa fa-users'
,
disabled
:
!
id
||
ids
.
length
>
1
,
action
:
()
=>
{
manager
.
chmodFile
(
id
,
this
.
getRowAttribute
(
_ids
[
0
],
'data'
)[
4
]);
}
},
{
divider
:
true
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'create'
][
'title'
],
icon
:
'fa fa-plus-circle'
,
subMenu
:
[
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'create'
][
'folder'
],
icon
:
'fa fa-folder-o'
,
action
:
manager
.
createFolder
.
bind
(
manager
)
},
...
...
source/modules/filemanager/index.js
View file @
14f8a638
...
...
@@ -473,6 +473,43 @@ class FileManager {
})
}
// 设置文件和目录权限
chmodFile(name, oldmod) {
layer.prompt({
value: oldmod,
title: `<i class="fa fa-users"></i> ${LANG['
chmod
']['
title
']} (${antSword.noxss(name)})`,
}, (value, i, e) => {
if(!value.match(/^[0-7]{4}$/)){
toastr.error(LANG['
chmod
']['
check
'], LANG_T['
error
']);
return
}
this.files.cell.progressOn();
let path = this.path;
if (this.isWin) {
path = path.replace(/
\
//g, '
\\
')
}
// http request
this.core.request(
this.core.filemanager.chmod({
path: path + name,
mode: value
})
).then((res) => {
let ret = res['
text
'];
this.files.cell.progressOff();
if (ret === '
1
') {
this.files.refreshPath();
toastr.success(LANG['
chmod
']['
success
'](name), LANG_T['
success
']);
}else{
toastr.error(LANG['
chmod
']['
error
'](name, ret === '
0
' ? false : ret), LANG_T['
error
']);
}
}).catch((err) => {
toastr.error(LANG['
chmod
']['
error
'](name, err), LANG_T['
error
']);
});
layer.close(i);
});
}
// 预览文件(图片、视频)
previewFile(name, size) {
let that = this;
...
...
@@ -490,7 +527,7 @@ class FileManager {
let down_size = 0;
this.core.download(
savepath
,this.core.filemanager.
re
ad_file({path: remote_path})
,this.core.filemanager.
downlo
ad_file({path: remote_path})
, (_size) => {
down_size += _size;
let down_progress = parseInt(parseFloat(down_size / size).toFixed(2) * 100);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment