require_once '../templates/header.php'; if (!$loggedin) { die("<script>window.location = 'index.php';</script>"); } // view groups if (isset($_GET['view'])) { $view = sanitizeString($_GET['view']); if (strtolower($view) == strtolower($user)) { $name = "Your"; $afterStr = "<a class='button' href='groups.php'>Join more groups</a>"; } else { $name = "{$view}'s"; $afterStr = ""; } echo "<h2 class='title'>{$name} Groups</h2><div class='display'>"; showGroups($view); echo $afterStr; die("</div></div></body></html>"); } //add or remove groups if (isset($_GET['add'])) { $add = sanitizeString($_GET['add']); addGroup($user, $add); } elseif (isset($_GET['remove'])) { $remove = sanitizeString($_GET['remove']); removeGroup($user, $remove); } // display groups $result = queryMysql("SELECT course, coursename FROM courses ORDER BY course"); $num = $result->num_rows; echo "<h2 class='title'>Groups</h2><div class='display'><ul>";
if (!$deleted) { $msg = "Database Error: {$ax['grp_not_deleted']}"; break; } $msg = $ax['grp_deleted']; } while (false); return $msg; } //Control logic if ($privs >= 4) { //manager or admin $msg = ''; if (isset($_POST['addExe'])) { $msg = addGroup($group); } elseif (isset($_POST['updExe'])) { $msg = updateGroup($group); } elseif (isset($_GET['delExe'])) { $msg = deleteGroup($group); } echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n"; if (!$mode or isset($_POST["back"])) { showGroups(); //no add / no edit } else { editGroup($group); //add or edit } echo "</div>\n</div>\n"; } else { echo "<p class='error'>{$ax['no_way']}</p>\n"; }
<?php // configuration require_once "../includes/config.php"; require "../includes/interactionService.php"; if (!isset($_SESSION["username"])) { header('Location: index.php'); } $db = new mysql_db(SERVER, USERNAME, PASSWORD, DATABASE); if (isset($_POST["groupname"])) { $groupname = $_POST["groupname"]; $topic = $_POST["topic"]; createGroup($groupname, $topic, ""); } $groups = showGroups(); render("group_template.php", ["title" => "Group", "groups" => $groups]); $db->sql_close(); ?>
$step = JRequest::getCmd('step'); $install_cb = JRequest::getCmd('install_cb'); $task = JRequest::getCmd('task'); $mode = JRequest::getCmd('mode'); $id = (int) JRequest::getCmd('id'); $install = JRequest::getVar('install'); if ($step || $install == 1) { $task = 'install'; } if ($mode == 'manage_users' && $task != 'help' && $task != 'assign_users' && $task != 'unassign_users') { $task = $mode; } switch ($task) { ##-- GROUPS ------------- case 'list_groups': showGroups($option); break; case 'group_add': editGroup(false); break; case 'group_edit': editGroup(true); break; case 'group_save': case 'group_apply': saveGroup(); break; case 'group_publish': publishItem('#__community_acl_groups', $cid, 1); break; case 'group_unpublish':
echo "<thead><tr>\n"; echo "<th>id</th>\n"; echo "<th>name</th>\n"; echo "<th>desc</th>\n"; echo "<th>delete</th>\n"; echo "</tr></thead>\n"; echo "<tbody>\n"; while ($row = @mysqli_fetch_assoc($result)) { echo "<td>" . $row['user_type_id'] . "</td>\n"; echo getTableRow($row, "user_type_name", "user_types", "user_type_id", "", ""); echo getTableRow($row, "user_type_desc", "user_types", "user_type_id", "", ""); echo "<td><a onclick='deleteRecord(\"user_types\", \"user_type_id=" . $row['user_type_id'] . "\", true)' href='javascript:void(0);'>[X]</a></td>\n"; echo "</tr>\n"; } echo "</tbody>\n"; echo "</table>\n"; } $title = "Edit User Groups"; include 'header.php'; ?> <h3><?php echo $title; ?> </h3> <hr /> <?php showGroups($con); ?> <a onclick='downloadAndRefresh("insertRecord.php?insert=true&table=user_types&user_type_name=New Type")' href='javascript:void(0);'>New Type</a><br /> <?php include 'footer.php';
protected function get_view() { ob_start(); echo '<div class="row container" id="btn-bar">'; echo '<a class="btn btn-default" href="AuthIndexPage.php">Menu</a> '; echo '<a class="btn btn-default" href="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '?detail=1">View Group</a> '; echo '<a class="btn btn-default" href="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '?new=1">Add Group</a> '; echo '<a class="btn btn-default" href="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '?remove=1">Delete Group</a> '; echo '<a class="btn btn-default" href="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '?newUser=1">Add User</a> '; echo '<a class="btn btn-default" href="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '?removeUser=1">Delete User</a> '; echo '<a class="btn btn-default" href="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '?newAuth=1">Add Auth</a> '; echo '<a class="btn btn-default" href="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '?removeAuth=1">Delete Auth</a> '; echo '</div>'; showGroups(); return ob_get_clean(); }