function show_team_user_filter_search(){ global $baseurl_short,$lang,$group,$find; $groups=get_usergroups(true); ?> <div class="BasicsBox"> <form method="post" action="<?php echo $baseurl_short?>pages/team/team_user.php"> <div class="Question"> <label for="group"><?php echo $lang["group"]; ?></label> <?php if (!hook('replaceusergroups')) { ?> <div class="tickset"> <div class="Inline"> <select name="group" id="group" onChange="this.form.submit();"> <option value="0"<?php if ($group == 0) { echo " selected"; } ?>><?php echo $lang["all"]; ?></option> <?php for($n=0;$n<count($groups);$n++){ ?> <option value="<?php echo $groups[$n]["ref"]; ?>"<?php if ($group == $groups[$n]["ref"]) { echo " selected"; } ?>><?php echo $groups[$n]["name"]; ?></option> <?php } ?> </select> </div> </div> <?php } ?> <div class="clearerleft"> </div> </div> </form> </div> <div class="BasicsBox"> <form method="post" action="<?php echo $baseurl_short?>pages/team/team_user.php"> <div class="Question"> <label for="find"><?php echo $lang["searchusers"]?></label> <div class="tickset"> <div class="Inline"><input type=text name="find" id="find" value="<?php echo $find?>" maxlength="100" class="shrtwidth" /></div> <div class="Inline"><input name="Submit" type="submit" value=" <?php echo $lang["searchbutton"]?> " /></div> </div> <div class="clearerleft"> </div> </div> </form> </div> <?php }
field_value = \'%s\' WHERE id = \'%s\'; ', $user_id_row, $user_group_row, $field_row, $field_value_row, $id_row); sql_query($save_query); } // Delete map if (getval('delete', '') !== '') { $delete_query = sprintf(' DELETE FROM assign_request_map WHERE id = \'%s\'; ', $id_row); sql_query($delete_query); } include '../../../include/header.php'; // Get information to populate options later on $user_groups = get_usergroups(); $fields = sql_query('SELECT ref, title FROM resource_type_field ORDER BY title, name;'); $users = get_users(); // Get maps $rows = sql_query('SELECT id, user_id, user_group_id, field_id, field_value FROM assign_request_map;'); ?> <div class="BasicsBox">
/** * @param string $name * @param array $current Current selected values (eg. array(1, 3) for Admins and Super admins user groups selected) * @param int $size How many options to show before user has to scroll */ function render_user_group_multi_select($name, array $current = array(), $size = 10, $style = '') { ?> <select id="<?php echo $name; ?> " name="<?php echo $name; ?> []" multiple="multiple" size="<?php echo $size; ?> " style="<?php echo $style; ?> "> <?php foreach (get_usergroups() as $usergroup) { ?> <option value="<?php echo $usergroup['ref']; ?> "<?php echo in_array($usergroup['ref'], $current) ? ' selected' : ''; ?> ><?php echo $usergroup['name']; ?> </option> <?php } ?> </select> <?php }
<?php } ?> </select> <div class="clearerleft"> </div> </div> <?php } ?> <?php if (checkperm("x")) { # Allow the selection of a user group to inherit permissions from for this share (the default is to use the current user's user group). ?> <div class="Question"> <label for="groupselect"><?php echo $lang["externalshare_using_permissions_from_user_group"] ?></label> <select id="groupselect" name="usergroup" class="stdwidth"> <?php $grouplist=get_usergroups(true); foreach ($grouplist as $group) { ?> <option value="<?php echo $group["ref"] ?>" <?php if ($usergroup==$group["ref"]) { ?>selected<?php } ?>><?php echo $group["name"] ?></option> <?php } ?> </select> <div class="clearerleft"> </div> </div> <?php } ?> <?php hook("resourceemailafterexternal");?> <?php if ($email_from_user && !$always_email_from_user){?>
if ($getrefs) { ?> , "ref": "<?php echo $groups[$n]["ref"]; ?> "<?php } ?> }<?php } } } } if ($attach_user_smart_groups) { if (!isset($groups)) { $groups = get_usergroups(true, $find); } for ($n = 0; $n < count($groups) && $n <= 20; $n++) { $show = true; if (checkperm("E") && $groups[$n]["ref"] != $usergroup && $groups[$n]["parent"] != $usergroup && $groups[$n]["ref"] != $usergroupparent) { $show = false; } if ($show) { $users = get_users($groups[$n]["ref"]); $ulist = ""; for ($m = 0; $m < count($users); $m++) { if ($ulist != "") { $ulist .= ", "; } $ulist .= $users[$m]["username"]; }
</p> <?php if (isset($error)) { ?> <div class="FormError">!! <?php echo $error; ?> !!</div><?php } ?> <?php # Fetch rows $users = get_users($group, $find, $order_by, true, $offset + $per_page); $groups = get_usergroups(true); $results = count($users); $totalpages = ceil($results / $per_page); $curpage = floor($offset / $per_page) + 1; $url = $baseurl_short . "pages/team/team_user.php?group=" . $group . "&order_by=" . $order_by . "&find=" . urlencode($find); $jumpcount = 1; # Create an a-z index $atoz = "<div class=\"InpageNavLeftBlock\">"; if ($find == "") { $atoz .= "<span class='Selected'>"; } $atoz .= "<a href=\"" . $baseurl . "/pages/team/team_user.php?order_by=u.username&group=" . $group . "&find=\" onClick=\"return CentralSpaceLoad(this);\">" . $lang["viewall"] . "</a>"; if ($find == "") { $atoz .= "</span>"; } $atoz .= " ";
* * @package ResourceSpace * @subpackage Pages_Team * @author Dan Huby */ include "../../include/db.php"; include "../../include/general.php"; include "../../include/authenticate.php"; if (!checkperm("a")) { exit("Permission denied."); } $plugin = getvalescaped("plugin", ""); # Fetch current access level $access = sql_value("select enabled_groups value from plugins where name='{$plugin}'", ""); # Fetch user groups $groups = get_usergroups(); # Save group activation options if (getval("save", "") != "") { $access = ""; if (getval("access", "") == "some") { foreach ($groups as $group) { if (getval("group_" . $group["ref"], "") != "") { if ($access != "") { $access .= ","; } $access .= $group["ref"]; } } } # Update database sql_query("update plugins set enabled_groups='{$access}' where name='{$plugin}'", "");
</div> <div class="widget-content"> <table class="table table-bordered table-striped"> <thead> <tr> <th>Group ID</th> <th>Group Name</th> <th>Total Users</th> <th>Actions</th> </tr> </thead> <tbody> <?php get_usergroups(); ?> </tbody> </table> </div> <!-- .widget-content --> </div> <!-- .widget --> <div class="actions"> <button onclick="window.location='create_group.php';" class="btn btn-quaternary"><span class="icon-plus"></span>Create New Group </button> </div> <!-- .actions -->
/** * Generate an html multi-select block for selecting from among RS user groups. * * An array consisting of the group keys (i.e., values from the "ref" column of the usergroup table) for the * selected groups is the value posted. * * @param string $name the name of the select block. Usually the name of the config variable being set. * @param string $label the user text displayed to label the select block. Usually a $lang string. * @param integer array $current the current value of the config variable being set. * @param integer $width the width of the input field in pixels. Default: 300. */ function config_multi_group_select($name, $label, $current = array(), $width = 300) { global $lang; ?> <div class="Question"> <label for="<?php echo $name; ?> " title="<?php echo str_replace('%cvn', $name, $lang['plugins-configvar']); ?> "><?php echo $label; ?> </label> <select name="<?php echo $name; ?> []" id="<?php echo $name; ?> " multiple="multiple" size="7" style="width:<?php echo $width; ?> px"> <?php $usergroups = get_usergroups(); foreach ($usergroups as $usergroup) { echo ' <option value="' . $usergroup['ref'] . '"' . (in_array($usergroup['ref'], $current) ? ' selected' : '') . '>' . $usergroup['name'] . '</option>'; } ?> </select> </div> <div class="clearerleft"></div> <?php }