From 97371a948ae1d212a61c8200ce93380d39ee2fa1 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 12 Dec 2013 09:51:47 +0000 Subject: feature 1668: hide "delete" link for protected users, hide "change username" and "email address" for guest git-svn-id: http://piwigo.org/svn/trunk@25928 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/user_list.tpl | 42 ++++++++++++++++++++++------- admin/user_list.php | 11 ++++++-- 2 files changed, 42 insertions(+), 11 deletions(-) (limited to 'admin') diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl index 42cd8c36f..32462f0cc 100644 --- a/admin/themes/default/template/user_list.tpl +++ b/admin/themes/default/template/user_list.tpl @@ -24,6 +24,9 @@ var allUsers = [{$all_users}]; var selection = [{$selection}]; var pwg_token = "{$PWG_TOKEN}"; +var protectedUsers = [{$protected_users}]; +var guestUser = {$guest_user}; + var truefalse = { true:"{'Yes'|translate}", false:"{'No'|translate}", @@ -144,16 +147,30 @@ jQuery(document).ready(function() { var userDetails = '
'; userDetails += '
'; - userDetails += ''; - userDetails += ''; - userDetails += '{/literal}{'Change password'|translate|escape:javascript}{literal}'; - userDetails += '
{/literal}{'Permissions'|translate|escape:javascript}{literal}'; - userDetails += '
{/literal}{'Delete'|translate|escape:javascript}{literal}'; + + if (parseInt(userId) != guestUser) { + userDetails += ''; + userDetails += ''; + userDetails += '{/literal}{'Change password'|translate|escape:javascript}{literal}'; + userDetails += '
'; + } + + userDetails += '{/literal}{'Permissions'|translate|escape:javascript}{literal}'; + + if (protectedUsers.indexOf(parseInt(userId)) == -1) { + userDetails += '
{/literal}{'Delete'|translate|escape:javascript}{literal}'; + } + userDetails += '
'; - userDetails += ''+user.username+' {/literal}{'Change username'|translate|escape:javascript}{literal}'; - userDetails += '