Commit d6ec0f7096aa71e63cc4364b815af0f3ee13ba99

Authored by kevin_fourie
1 parent 430f8dcf

Merged in from DEV trunk...

KTS-3342
""Resolved permissions per user" shows all users in the system (i.e. not only users which have permissions assigned) in version 3.5.2 (SUP-638)"
Fixed. Replaced the array of all users with only active users when displaying them in the template.

Committed by: Megan Watson
Reviewed by: Jonathan Byrne

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.2c-Release-Branch@8438 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktcore/folder/Permissions.php
... ... @@ -218,6 +218,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
218 218 if ($everyone || ($authenticated && $oUser->isAnonymous()) ||
219 219 KTPermissionUtil::userHasPermissionOnItem($oUser, $oPermission, $this->oFolder)){
220 220 $aMapPermissionUser[$iPermissionID][$oUser->getId()] = true;
  221 + $aActiveUsers[$oUser->getId()] = $oUser->getName();
221 222 }
222 223 }
223 224 }
... ... @@ -227,7 +228,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
227 228 $groups = array();
228 229 $roles = array(); // should _always_ be empty, barring a bug in permissions::updatePermissionLookup
229 230  
230   - $users = $aUsers;
  231 + $users = $aActiveUsers;
231 232 asort($users); // ascending, per convention.
232 233  
233 234 $bEdit = false;
... ...
templates/ktcore/folder/resolved_permissions_user.smarty
... ... @@ -30,9 +30,8 @@ this folder.{/i18n}</p>
30 30 </thead>
31 31 <tbody>
32 32  
33   -{ foreach item=oUser from=$users }
34   -<td><span class="descriptiveText">{i18n}User: {/i18n}</span> {$oUser->getName()}</td>
35   - { assign var=iUserId value=$oUser->getId() }
  33 +{ foreach item=sUserName key=iUserId from=$users }
  34 +<td><span class="descriptiveText">{i18n}User: {/i18n}</span> {$sUserName}</td>
36 35 { foreach item=oPerm from=$permissions }
37 36 { assign var=iPermId value=$oPerm->getId() }
38 37 { assign var=bHasPerm value=$aMapPermissionUser[$iPermId][$iUserId] }
... ...