} else { $Query = sprintf("select group_name from " . TABLE_PREFIX . "groups where group_id=" . $group_id . " and password='******'"); //echo($Query . "<br>\n"); $dbResult = $dblink->query($Query); $check = 0; while ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) { $check++; } if ($check == 1) { //Insert member into the gsubscriptions table $Query = "INSERT INTO " . TABLE_PREFIX . "gsubscriptions ( Group_ID , Name , Date_Join , Priv ) VALUES ('{$group_id}', '{$username}', now(), '1')"; //echo($Query . "<br>\n"); $AffectedRows = $dblink->exec($Query); if ($AffectedRows == 1) { //Create the folder under the member's Groups folder with the Group name and description of the group $success = createMemberGroupFolder($username, returnGroupName($group_id), returnGroupDesc($group_id)); if ($success == 1) { $success = true; echo "<p class=\"success\">" . T_("Your are now a member of this group") . ".</p><p><b>" . T_("Details of the group") . "</b><br><br>"; include 'includes/gdetails_body.php'; } else { echo "<p class=\"error\">" . T_("A problem occured when creating the folder of this group") . ".</p>"; } } else { echo "<p class=\"error\">" . T_("A problem occured when adding you to this group") . ".</p>"; } } else { echo "<p class=\"error\">" . T_("The password you entered is invalid") . ".</p>"; } } }
} else { $btnPriv = "orderButtonSelected"; } } } else { $btnUsername = "******"; $strOrderBy = "name"; } $user = new User(); $username = $user->getUsername(); // Check if manager joined include 'includes/groups_functions.php'; $partOf = checkIfManager($group_id, $username); $isMember = checkIfMember($group_id, $username); /* Retrieve the name of the group */ $rec_name = returnGroupName($group_id); echo "<b>" . T_("Members of group") . " " . $rec_name . "</b><br><br>\n"; if (!$partOf && !$isMember) { echo "<p class=\"error\">" . T_("You must be the manager of this group") . ".</p>"; } else { if (isset($_POST['aname'])) { //Change the user's priv $aname = $_POST['aname']; $newPriv = $_POST['newPriv']; changeMemberPriv($aname, $newPriv); } //Retrieve the list of members $Query = "select name, date_join AS formatted_time, priv from " . TABLE_PREFIX . "gsubscriptions where (group_id = '{$group_id}') order by " . $strOrderBy; //echo($Query . "<br>\n"); $dbResult = $dblink->query($Query); echo "<table cellpadding=\"2\">\n";
function returnGroupFolderWithID($group_id, $membername) { include 'conn.php'; $group_name = returnGroupName($group_id); $Query = "select id from " . TABLE_PREFIX . "folders where (pid = '-1' and title = '" . $group_name . "' and name = '" . $membername . "')"; //echo($Query . "<br>\n"); $dbResult = $dblink->query($Query); if ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) { $rec_id = "{$row["id"]}"; } return $rec_id; }