Commit ed3b47f3 authored by Penom Nom's avatar Penom Nom
Browse files

admin and manager can delete any user from a project

parent eb967476
......@@ -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}
......
......@@ -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(){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment