take enableusersview into account (currently disabled)

This commit is contained in:
Uwe Steinmann 2024-03-22 10:04:59 +01:00
parent 637476f0a9
commit 78afbe8699
2 changed files with 8 additions and 6 deletions

View File

@ -70,6 +70,7 @@ $(document).ready( function() {
$folder = $this->params['folder']; $folder = $this->params['folder'];
$document = $this->params['document']; $document = $this->params['document'];
$sortusersinlist = $this->params['sortusersinlist']; $sortusersinlist = $this->params['sortusersinlist'];
$enableusersview = $this->params['enableusersview'];
$notifyList = $document->getNotifyList(0, true); $notifyList = $document->getNotifyList(0, true);
@ -151,7 +152,7 @@ $(document).ready( function() {
} else { } else {
print "<table class=\"table table-condensed table-sm mt-4\">\n"; print "<table class=\"table table-condensed table-sm mt-4\">\n";
foreach ($notifyList["users"] as $userNotify) { foreach ($notifyList["users"] as $userNotify) {
if ($user->isAdmin() || $user->getID() == $userNotify->getID()) { if ($user->isAdmin() || /*$enableusersview || */$user->getID() == $userNotify->getID()) {
print "<tr>"; print "<tr>";
print "<td><i class=\"fa fa-user\"></i></td>"; print "<td><i class=\"fa fa-user\"></i></td>";
print "<td>" . htmlspecialchars($userNotify->getLogin() . " - " . $userNotify->getFullName()) . "</td>"; print "<td>" . htmlspecialchars($userNotify->getLogin() . " - " . $userNotify->getFullName()) . "</td>";
@ -168,7 +169,8 @@ $(document).ready( function() {
} }
} }
foreach ($notifyList["groups"] as $groupNotify) { foreach ($notifyList["groups"] as $groupNotify) {
if ($user->isAdmin() || $groupNotify->isMember($user,true)) { /* admins and members of a group may see exiting notifications */
if ($user->isAdmin() || /*$enableusersview || */$groupNotify->isMember($user,false)) {
print "<tr>"; print "<tr>";
print "<td><i class=\"fa fa-group\"></i></td>"; print "<td><i class=\"fa fa-group\"></i></td>";
print "<td>" . htmlspecialchars($groupNotify->getName()) . "</td>"; print "<td>" . htmlspecialchars($groupNotify->getName()) . "</td>";

View File

@ -67,9 +67,8 @@ $(document).ready(function() {
$dms = $this->params['dms']; $dms = $this->params['dms'];
$user = $this->params['user']; $user = $this->params['user'];
$folder = $this->params['folder']; $folder = $this->params['folder'];
$allUsers = $this->params['allusers'];
$allGroups = $this->params['allgroups'];
$sortusersinlist = $this->params['sortusersinlist']; $sortusersinlist = $this->params['sortusersinlist'];
$enableusersview = $this->params['enableusersview'];
$notifyList = $folder->getNotifyList(0, true); $notifyList = $folder->getNotifyList(0, true);
@ -151,7 +150,7 @@ $(document).ready(function() {
} else { } else {
print "<table class=\"table table-condensed table-sm\">\n"; print "<table class=\"table table-condensed table-sm\">\n";
foreach ($notifyList["users"] as $userNotify) { foreach ($notifyList["users"] as $userNotify) {
if ($user->isAdmin() || $user->getID() == $userNotify->getID()) { if ($user->isAdmin() || /*$enableusersview || */$user->getID() == $userNotify->getID()) {
print "<tr>"; print "<tr>";
print "<td><i class=\"fa fa-user\"></i></td>"; print "<td><i class=\"fa fa-user\"></i></td>";
print "<td>" . htmlspecialchars($userNotify->getLogin() . " - " . $userNotify->getFullName()) . "</td>"; print "<td>" . htmlspecialchars($userNotify->getLogin() . " - " . $userNotify->getFullName()) . "</td>";
@ -168,7 +167,8 @@ $(document).ready(function() {
} }
} }
foreach ($notifyList["groups"] as $groupNotify) { foreach ($notifyList["groups"] as $groupNotify) {
if ($user->isAdmin() || $groupNotify->isMember($user,true)) { /* admins and members of a group may see exiting notifications */
if ($user->isAdmin() || /*$enableusersview || */$groupNotify->isMember($user,false)) {
print "<tr>"; print "<tr>";
print "<td><i class=\"fa fa-group\"></i></td>"; print "<td><i class=\"fa fa-group\"></i></td>";
print "<td>" . htmlspecialchars($groupNotify->getName()) . "</td>"; print "<td>" . htmlspecialchars($groupNotify->getName()) . "</td>";