diff --git a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php
index 1ccfc04..14169a3 100644
--- a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php
+++ b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php
@@ -37,7 +37,13 @@ require_once("listGroupsUI.inc");
if (checkSession()) {
$oPatternCustom = & new PatternCustom();
- $oPatternCustom->setHtml(getPage($fUnitID));
+ // #3519 unit administrators only see their unit.
+ if (Permission::userIsUnitAdministrator()) {
+ $iUnitID = User::getUnitID($_SESSION["userID"]);
+ $oPatternCustom->setHtml(getPage($iUnitID));
+ } else {
+ $oPatternCustom->setHtml(getPage($fUnitID));
+ }
require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
$main->setCentralPayload($oPatternCustom);
$main->setFormAction($_SERVER['PHP_SELF']);
diff --git a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc
index d1e2e23..8bc7695 100644
--- a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc
+++ b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc
@@ -29,15 +29,16 @@
function getUnitDisplay($iUnitID) {
global $default;
- if (Permission::userIsUnitAdministrator()) {
- $iUnitID = User::getUnitID($_SESSION["userID"]);
+ // #3519 only allow unit filters for system administrators
+ // unit administrators only see their unit.
+ if (Permission::userIsSystemAdministrator()) {
+ $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID");
+ $oPatternListBox->setPostBackOnChange(true);
+ if ($iUnitID != 0) {
+ $oPatternListBox->setSelectedValue($iUnitID);
+ }
+ return "
| Filter By Unit | " . $oPatternListBox->render() . " |
";
}
- $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID");
- $oPatternListBox->setPostBackOnChange(true);
- if ($iUnitID != 0) {
- $oPatternListBox->setSelectedValue($iUnitID);
- }
- return "| Filter By Unit | " . $oPatternListBox->render() . " |
";
}
function getGroups($fUnitID) {