diff --git a/pages/groups.php b/pages/groups.php index 92789f6..1be9789 100644 --- a/pages/groups.php +++ b/pages/groups.php @@ -25,19 +25,13 @@ $table = '%%ENTRY%%
NameGrĂ¼nderAktionen
'; - $statementMembership = $RUNTIME['PDO']->prepare("SELECT GroupID FROM os_groups_membership WHERE PrincipalID = ? ORDER BY GroupID ASC"); - $statementMembership->execute(array($_SESSION['UUID'])); + $statementGroups = $RUNTIME['PDO']->prepare("SELECT Name,FounderID,os_groups_membership.GroupID FROM os_groups_groups JOIN os_groups_membership ON os_groups_groups.GroupID = os_groups_membership.GroupID WHERE PrincipalID = ?"); + $statementGroups->execute(array($_SESSION['UUID'])); - while($rowMembership = $statementMembership->fetch()) + while($rowGroups = $statementGroups->fetch()) { - $statementGroups = $RUNTIME['PDO']->prepare("SELECT Name,FounderID,GroupID FROM os_groups_groups WHERE GroupID = ? LIMIT 1"); - $statementGroups->execute(array($rowMembership['GroupID'])); - - while($rowGroups = $statementGroups->fetch()) - { - $entry = ''.htmlspecialchars($rowGroups['Name']).''.htmlspecialchars($opensim->getUserName($rowGroups['FounderID'])).'
%%CSRF%%
'; - $table = str_replace("%%ENTRY%%", $entry."%%ENTRY%%", $table); - } + $entry = ''.htmlspecialchars($rowGroups['Name']).''.htmlspecialchars($opensim->getUserName($rowGroups['FounderID'])).'
%%CSRF%%
'; + $table = str_replace("%%ENTRY%%", $entry."%%ENTRY%%", $table); } $table = str_replace("%%ENTRY%%", "", $table);