Commit 22880e38f8505213551ec05d483a2914efd3ad0a
1 parent
25b5d0ef
#3519 system administrators can filter by unit, unit administrators only see their unit
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2789 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
16 additions
and
9 deletions
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php
| ... | ... | @@ -37,7 +37,13 @@ require_once("listGroupsUI.inc"); |
| 37 | 37 | |
| 38 | 38 | if (checkSession()) { |
| 39 | 39 | $oPatternCustom = & new PatternCustom(); |
| 40 | - $oPatternCustom->setHtml(getPage($fUnitID)); | |
| 40 | + // #3519 unit administrators only see their unit. | |
| 41 | + if (Permission::userIsUnitAdministrator()) { | |
| 42 | + $iUnitID = User::getUnitID($_SESSION["userID"]); | |
| 43 | + $oPatternCustom->setHtml(getPage($iUnitID)); | |
| 44 | + } else { | |
| 45 | + $oPatternCustom->setHtml(getPage($fUnitID)); | |
| 46 | + } | |
| 41 | 47 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 42 | 48 | $main->setCentralPayload($oPatternCustom); |
| 43 | 49 | $main->setFormAction($_SERVER['PHP_SELF']); | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc
| ... | ... | @@ -29,15 +29,16 @@ |
| 29 | 29 | function getUnitDisplay($iUnitID) { |
| 30 | 30 | global $default; |
| 31 | 31 | |
| 32 | - if (Permission::userIsUnitAdministrator()) { | |
| 33 | - $iUnitID = User::getUnitID($_SESSION["userID"]); | |
| 32 | + // #3519 only allow unit filters for system administrators | |
| 33 | + // unit administrators only see their unit. | |
| 34 | + if (Permission::userIsSystemAdministrator()) { | |
| 35 | + $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID"); | |
| 36 | + $oPatternListBox->setPostBackOnChange(true); | |
| 37 | + if ($iUnitID != 0) { | |
| 38 | + $oPatternListBox->setSelectedValue($iUnitID); | |
| 39 | + } | |
| 40 | + return "<table><tr><td><b>Filter By Unit </b></td><td>" . $oPatternListBox->render() . "</td></tr></table>"; | |
| 34 | 41 | } |
| 35 | - $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID"); | |
| 36 | - $oPatternListBox->setPostBackOnChange(true); | |
| 37 | - if ($iUnitID != 0) { | |
| 38 | - $oPatternListBox->setSelectedValue($iUnitID); | |
| 39 | - } | |
| 40 | - return "<table><tr><td><b>Filter By Unit </b></td><td>" . $oPatternListBox->render() . "</td></tr></table>"; | |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | function getGroups($fUnitID) { | ... | ... |