Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
ed3b47f3
Commit
ed3b47f3
authored
Dec 02, 2014
by
Penom Nom
Browse files
admin and manager can delete any user from a project
parent
eb967476
Changes
2
Hide whitespace changes
Inline
Side-by-side
ui/nG6/pi1/project_view.tpl
View file @
ed3b47f3
...
...
@@ -135,9 +135,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<tr
id=
"tr_user_
{
$user_values.id
}
"
class=
"
{
$emphasis
}
"
>
{
if
(
$user_values.cruser_id
==
$user_id
)
||
(
$user_values.cruser_id
!=
$user_id
&&
$user_values.id
==
$user_id
&&
(
$projects
[
key
(
$projects
)].
is_admin
||
$projects
[
key
(
$projects
)].
is_manager
)
)
||
(
$user_values.id
==
$user_id
)
}
<td><center><input
type=
"checkbox"
id=
"chk_user_
{
$user_values.id
}
"
value=
"user_
{
$user_values.id
}
"
/></center></td>
||
$projects
[
key
(
$projects
)].
is_admin
||
$projects
[
key
(
$projects
)].
is_manager
||
(
$user_values.id
==
$user_id
)
}
<td><center><input
type=
"checkbox"
id=
"chk_user_
{
$user_values.id
}
"
value=
"user_
{
$user_values.id
}
"
/></center>
<input
type=
"hidden"
id=
"chk_cruser_
{
$user_values.id
}
"
value=
"
{
$user_values.cruser_id
}
"
/></td>
{
else
}
<td></td>
{/
if
}
...
...
ui/nG6/res/js/tx_nG6_pi1.js
View file @
ed3b47f3
...
...
@@ -1260,6 +1260,21 @@ function updateUsersButtonStatus() {
});
$
(
"
.nou-selection-btn
"
).
each
(
function
(){
$
(
this
).
removeAttr
(
'
disabled
'
);
});
// Disable update user if this is not the user or the creator
$
(
'
#update_user
'
).
each
(
function
(){
if
(
$
(
"
:checked[id^=chk_user_]
"
).
size
()
==
1
)
{
var
user_id
=
$
(
'
#user_id
'
).
val
();
var
checked_user_id
=
$
(
"
:checked[id^=chk_user_]
"
).
val
().
split
(
"
_
"
,
2
)[
1
];
var
cruser_id
=
$
(
"
#chk_cruser_
"
+
checked_user_id
).
val
();
if
(
user_id
==
checked_user_id
||
user_id
==
cruser_id
){
$
(
this
).
removeAttr
(
'
disabled
'
);
}
else
{
$
(
this
).
attr
(
'
disabled
'
,
'
disabled
'
);
}
}
});
}
function
updateButtonStatus
(){
...
...
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