summaryrefslogtreecommitdiffstats
path: root/userprefs.cgi
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2002-09-23 02:14:48 +0200
committerbugreport%peshkin.net <>2002-09-23 02:14:48 +0200
commit65d3dc0ec33fd76229dc02536a74ccac5408876b (patch)
treebcacbb27e99c73f9548e92408fadb2e369f0543b /userprefs.cgi
parentcf9b4ba2e757925eeb18bb63411ae30c8600c643 (diff)
downloadbugzilla-65d3dc0ec33fd76229dc02536a74ccac5408876b.tar.gz
bugzilla-65d3dc0ec33fd76229dc02536a74ccac5408876b.tar.xz
bug 157756 - Groups_20020716_Branch Tracking : > 55 groups now supported
r=bbaetz, gerv
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-xuserprefs.cgi28
1 files changed, 14 insertions, 14 deletions
diff --git a/userprefs.cgi b/userprefs.cgi
index 808aebf40..369c681ca 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -33,7 +33,6 @@ use RelationSet;
sub sillyness {
my $zz;
$zz = $::defaultqueryname;
- $zz = $::usergroupset;
}
# Use global template variables.
@@ -331,21 +330,22 @@ sub SaveFooter {
sub DoPermissions {
my (@has_bits, @set_bits);
- SendSQL("SELECT description FROM groups " .
- "WHERE bit & $::usergroupset != 0 " .
- "ORDER BY bit");
+ SendSQL("SELECT DISTINCT name, description FROM groups, user_group_map " .
+ "WHERE user_group_map.group_id = groups.id " .
+ "AND user_id = $::userid " .
+ "AND isbless = 0 " .
+ "ORDER BY name");
while (MoreSQLData()) {
- push(@has_bits, FetchSQLData());
+ my ($nam, $desc) = FetchSQLData();
+ push(@has_bits, {"desc" => $desc, "name" => $nam});
}
-
- SendSQL("SELECT blessgroupset FROM profiles WHERE userid = $userid");
- my $blessgroupset = FetchOneColumn();
- if ($blessgroupset) {
- SendSQL("SELECT description FROM groups " .
- "WHERE bit & $blessgroupset != 0 " .
- "ORDER BY bit");
- while (MoreSQLData()) {
- push(@set_bits, FetchSQLData());
+ my @set_ids = ();
+ SendSQL("SELECT DISTINCT name, description FROM groups " .
+ "ORDER BY name");
+ while (MoreSQLData()) {
+ my ($nam, $desc) = FetchSQLData();
+ if (UserCanBlessGroup($nam)) {
+ push(@set_bits, {"desc" => $desc, "name" => $nam});
}
}