Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
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
ops
jumpserver
Commits
b7ad6cfe
Commit
b7ad6cfe
authored
5 years ago
by
BaiJiangJie
Committed by
老广
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 防止 XSS (#2633)
* [Bugfix] 修改管理用户列表显示bug * [Bugfix] 修复刷新批量命令页面的bug * [Update] 防止 XSS
parent
4463e754
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
27 additions
and
6 deletions
+27
-6
admin_user_assets.html
apps/assets/templates/assets/admin_user_assets.html
+1
-0
admin_user_list.html
apps/assets/templates/assets/admin_user_list.html
+1
-1
asset_list.html
apps/assets/templates/assets/asset_list.html
+1
-0
cmd_filter_list.html
apps/assets/templates/assets/cmd_filter_list.html
+1
-0
domain_list.html
apps/assets/templates/assets/domain_list.html
+1
-0
label_list.html
apps/assets/templates/assets/label_list.html
+1
-0
system_user_asset.html
apps/assets/templates/assets/system_user_asset.html
+1
-0
system_user_list.html
apps/assets/templates/assets/system_user_list.html
+1
-0
const.py
apps/common/const.py
+2
-2
command_execution_create.html
apps/ops/templates/ops/command_execution_create.html
+4
-0
asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+1
-0
_message.html
apps/templates/_message.html
+2
-1
terminal_list.html
apps/terminal/templates/terminal/terminal_list.html
+1
-0
user_granted_asset.html
apps/users/templates/users/user_granted_asset.html
+3
-1
user_group_granted_asset.html
apps/users/templates/users/user_group_granted_asset.html
+3
-1
user_group_list.html
apps/users/templates/users/user_group_list.html
+2
-0
user_list.html
apps/users/templates/users/user_list.html
+1
-0
No files found.
apps/assets/templates/assets/admin_user_assets.html
View file @
b7ad6cfe
...
...
@@ -98,6 +98,7 @@ function initTable() {
order
:
[],
columnDefs
:
[
{
targets
:
0
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=DEFAULT_PK %}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/admin_user_list.html
View file @
b7ad6cfe
...
...
@@ -91,7 +91,7 @@ $(document).ready(function(){
}}],
ajax_url
:
'{% url "api-assets:admin-user-list" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"username"
},
{
data
:
"assets_amount"
},
{
data
:
"reachable_amount"
},
{
data
:
"unreachable_amount"
},
{
data
:
"id"
},
{
data
:
"comment"
}]
{
data
:
"reachable_amount"
},
{
data
:
"unreachable_amount"
},
{
data
:
"id"
},
{
data
:
"comment"
}
,
{
data
:
"id"
}
]
};
jumpserver
.
initServerSideDataTable
(
options
)
})
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/asset_list.html
View file @
b7ad6cfe
...
...
@@ -156,6 +156,7 @@ function initTable() {
ele
:
$
(
'#asset_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
{
%
url
'assets:asset-detail'
pk
=
DEFAULT_PK
as
the_url
%
}
var
detail_btn
=
'<a href="{{ the_url }}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/cmd_filter_list.html
View file @
b7ad6cfe
...
...
@@ -40,6 +40,7 @@ function initTable() {
ele
:
$
(
'#cmd_filter_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url '
assets
:
cmd
-
filter
-
detail
' pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/domain_list.html
View file @
b7ad6cfe
...
...
@@ -41,6 +41,7 @@ function initTable() {
ele
:
$
(
'#domain_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "assets:domain-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/label_list.html
View file @
b7ad6cfe
...
...
@@ -30,6 +30,7 @@ function initTable() {
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
{
#
var
detail_btn
=
'<a href="{% url "assets:label-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
#
}
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a>'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/system_user_asset.html
View file @
b7ad6cfe
...
...
@@ -144,6 +144,7 @@ function initAssetsTable() {
order
:
[],
columnDefs
:
[
{
targets
:
0
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=DEFAULT_PK %}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/system_user_list.html
View file @
b7ad6cfe
...
...
@@ -49,6 +49,7 @@ function initTable() {
ele
:
$
(
'#system_user_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "assets:system-user-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/common/const.py
View file @
b7ad6cfe
...
...
@@ -3,7 +3,7 @@
from
django.utils.translation
import
ugettext_lazy
as
_
create_success_msg
=
_
(
"
<b>
%(name)
s</b>
was created successfully"
)
update_success_msg
=
_
(
"
<b>
%(name)
s</b>
was updated successfully"
)
create_success_msg
=
_
(
"
%(name)
s
was created successfully"
)
update_success_msg
=
_
(
"
%(name)
s
was updated successfully"
)
FILE_END_GUARD
=
">>> Content End <<<"
celery_task_pre_key
=
"CELERY_"
This diff is collapsed.
Click to expand it.
apps/ops/templates/ops/command_execution_create.html
View file @
b7ad6cfe
...
...
@@ -82,6 +82,7 @@
<script>
var
zTree
,
show
=
0
;
var
systemUserId
=
null
;
var
url
=
null
;
var
treeUrl
=
"{% url 'api-perms:my-nodes-assets-as-tree' %}?cache_policy=1"
;
function
initTree
()
{
...
...
@@ -114,6 +115,9 @@ function initTree() {
if
(
systemUserId
)
{
url
=
treeUrl
+
'&system_user='
+
systemUserId
}
else
{
url
=
treeUrl
}
$
.
get
(
url
,
function
(
data
,
status
){
$
.
fn
.
zTree
.
init
(
$
(
"#assetTree"
),
setting
,
data
);
...
...
This diff is collapsed.
Click to expand it.
apps/perms/templates/perms/asset_permission_list.html
View file @
b7ad6cfe
...
...
@@ -146,6 +146,7 @@ function initTable() {
$
(
td
).
html
(
"<i class='fa fa-angle-right'></i>"
);
}},
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "perms:asset-permission-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/templates/_message.html
View file @
b7ad6cfe
...
...
@@ -47,7 +47,8 @@
{% if messages %}
{% for message in messages %}
<div
class=
"alert alert-{{ message.tags }} help-message"
>
{{ message|safe }}
{# {{ message|safe }}#}
{{ message }}
<button
aria-hidden=
"true"
data-dismiss=
"alert"
class=
"close"
type=
"button"
style=
"outline: none;"
>
×
</button>
</div>
...
...
This diff is collapsed.
Click to expand it.
apps/terminal/templates/terminal/terminal_list.html
View file @
b7ad6cfe
...
...
@@ -50,6 +50,7 @@ function initTable() {
buttons
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "terminal:terminal-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
apps/users/templates/users/user_granted_asset.html
View file @
b7ad6cfe
...
...
@@ -77,6 +77,7 @@ function initTable() {
ele
:
$
(
'#user_assets_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
{
%
url
'assets:asset-detail'
pk
=
DEFAULT_PK
as
the_url
%
}
var
detail_btn
=
'<a href="{{ the_url }}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
...
...
@@ -91,7 +92,8 @@ function initTable() {
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
var
users
=
[];
$
.
each
(
cellData
,
function
(
id
,
data
)
{
users
.
push
(
data
.
name
);
var
name
=
htmlEscape
(
data
.
name
);
users
.
push
(
name
);
});
$
(
td
).
html
(
users
.
join
(
', '
))
}}
...
...
This diff is collapsed.
Click to expand it.
apps/users/templates/users/user_group_granted_asset.html
View file @
b7ad6cfe
...
...
@@ -77,6 +77,7 @@ function initTable() {
ele
:
$
(
'#user_assets_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
{
%
url
'assets:asset-detail'
pk
=
DEFAULT_PK
as
the_url
%
}
var
detail_btn
=
'<a href="{{ the_url }}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
...
...
@@ -91,7 +92,8 @@ function initTable() {
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
var
users
=
[];
$
.
each
(
cellData
,
function
(
id
,
data
)
{
users
.
push
(
data
.
name
);
var
name
=
htmlEscape
(
data
.
name
);
users
.
push
(
name
);
});
$
(
td
).
html
(
users
.
join
(
', '
))
}}
...
...
This diff is collapsed.
Click to expand it.
apps/users/templates/users/user_group_list.html
View file @
b7ad6cfe
...
...
@@ -28,6 +28,7 @@ $(document).ready(function() {
buttons
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "users:user-group-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
));
}},
...
...
@@ -36,6 +37,7 @@ $(document).ready(function() {
$
(
td
).
html
(
html
);
}},
{
targets
:
3
,
createdCell
:
function
(
td
,
cellData
)
{
cellData
=
htmlEscape
(
cellData
);
var
innerHtml
=
cellData
.
length
>
30
?
cellData
.
substring
(
0
,
30
)
+
'...'
:
cellData
;
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
...
...
This diff is collapsed.
Click to expand it.
apps/users/templates/users/user_list.html
View file @
b7ad6cfe
...
...
@@ -59,6 +59,7 @@ function initTable() {
ele
:
$
(
'#user_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "users:user-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
"{{ DEFAULT_PK }}"
,
rowData
.
id
));
}},
...
...
This diff is collapsed.
Click to expand it.
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