Fix tab warnings in Tinderbox
git-svn-id: svn://10.0.0.236/branches/Bugzilla_Groups_Branch@107453 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -271,7 +271,7 @@ sub ValidateBugID {
|
||||
|
||||
# Users are authorized to access bugs if they are a member of one of
|
||||
# groups to which the bug is restricted.
|
||||
# A user is also authorized to access a bug if she is the reporter,
|
||||
# A user is also authorized to access a bug if she is the reporter,
|
||||
# assignee, QA contact, or member of the cc: list of the bug and the bug
|
||||
# allows users in those roles to see the bug. The boolean fields
|
||||
# reporter_accessible, assignee_accessible, qacontact_accessible, and
|
||||
@@ -1276,13 +1276,13 @@ sub DumpBugActivity {
|
||||
|
||||
sub GetCommandMenu {
|
||||
my $loggedin = quietly_check_login();
|
||||
my $userid = 0;
|
||||
if ( $::COOKIE{'Bugzilla_login'} ) {
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
} else {
|
||||
$userid = 0;
|
||||
}
|
||||
if (!defined $::anyvotesallowed) {
|
||||
my $userid = 0;
|
||||
if ( $::COOKIE{'Bugzilla_login'} ) {
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
} else {
|
||||
$userid = 0;
|
||||
}
|
||||
if (!defined $::anyvotesallowed) {
|
||||
GetVersionTable();
|
||||
}
|
||||
my $html = qq {
|
||||
|
||||
@@ -509,7 +509,7 @@ sub insert
|
||||
# special syntax of the "open" and "exec" commands to capture the output of
|
||||
# "processmail", which "system" doesn't allow, without running the command
|
||||
# through a shell, which backticks (``) do.
|
||||
#system ("./processmail", $bugid , $::userid);
|
||||
#system ("./processmail", $bugid , $userid);
|
||||
#my $mailresults = `./processmail $bugid $::userid`;
|
||||
my $mailresults = '';
|
||||
open(PMAIL, "-|") or exec('./processmail', $::FORM{'bugid'}, $::COOKIE{'Bugzilla_login'});
|
||||
@@ -690,7 +690,7 @@ sub update
|
||||
my $quotedoldcontenttype = SqlQuote($oldcontenttype);
|
||||
my $fieldid = GetFieldID('attachments.mimetype');
|
||||
SendSQL("INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
|
||||
VALUES ($bugid, $::FORM{'id'}, $userid, NOW(), $fieldid, $quotedoldmimetype, $quotedmimetype)");
|
||||
VALUES ($bugid, $::FORM{'id'}, $userid, NOW(), $fieldid, $quotedoldcontenttype, $quotedcontenttype)");
|
||||
}
|
||||
if ($oldispatch ne $::FORM{'ispatch'}) {
|
||||
my $fieldid = GetFieldID('attachments.ispatch');
|
||||
|
||||
@@ -359,42 +359,42 @@ print "
|
||||
|
||||
if ( $userid ne 0 ) {
|
||||
# Find out which groups we are a member of and form radio buttons
|
||||
SendSQL("SELECT groups.group_id, groups.name, groups.description " .
|
||||
SendSQL("SELECT groups.group_id, groups.name, groups.description " .
|
||||
"FROM user_group_map, groups " .
|
||||
"WHERE user_group_map.group_id = groups.group_id " .
|
||||
"AND user_group_map.user_id = $userid " .
|
||||
"AND groups.isbuggroup != 0 " .
|
||||
"ORDER BY groups.group_id");
|
||||
"AND groups.isbuggroup != 0 " .
|
||||
"ORDER BY groups.group_id");
|
||||
my %usergroups;
|
||||
my %groupnames;
|
||||
my $groupFound = 0;
|
||||
while ( MoreSQLData() ) {
|
||||
my ($group_id, $name, $description) = FetchSQLData();
|
||||
$groupnames{$group_id} = $name;
|
||||
$usergroups{$group_id} = $description;
|
||||
$groupFound = 1;
|
||||
}
|
||||
my %groupnames;
|
||||
my $groupFound = 0;
|
||||
while ( MoreSQLData() ) {
|
||||
my ($group_id, $name, $description) = FetchSQLData();
|
||||
$groupnames{$group_id} = $name;
|
||||
$usergroups{$group_id} = $description;
|
||||
$groupFound = 1;
|
||||
}
|
||||
|
||||
if ( $groupFound ) {
|
||||
print "<br><b>Only users in the selected groups can view this bug:</b><br>\n";
|
||||
print "<font size=\"-1\">(Leave all boxes unchecked to make this a public bug.)</font><br><br>\n";
|
||||
|
||||
# Find out if this bug is private to any of the groups the user belongs to
|
||||
my %buggroups;
|
||||
# Find out if this bug is private to any of the groups the user belongs to
|
||||
my %buggroups;
|
||||
SendSQL("SELECT group_id FROM bug_group_map WHERE bug_id = $id");
|
||||
while (@row = FetchSQLData()) {
|
||||
$buggroups{$row[0]} = 1;
|
||||
$buggroups{$row[0]} = 1;
|
||||
}
|
||||
|
||||
foreach my $group_id ( keys %usergroups ) {
|
||||
my $checked = $buggroups{$group_id} ? "CHECKED" : "";
|
||||
print " ";
|
||||
print " ";
|
||||
print "<input type=checkbox name=\"group-$group_id\" value=1 $checked>\n";
|
||||
print "$usergroups{$group_id}<br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
# If the bug is restricted to a group, display checkboxes that allow
|
||||
|
||||
# If the bug is restricted to a group, display checkboxes that allow
|
||||
# the user to set whether or not the reporter, assignee, QA contact,
|
||||
# and cc list can see the bug even if they are not members of all
|
||||
# groups to which the bug is restricted.
|
||||
|
||||
@@ -1028,7 +1028,7 @@ at once.
|
||||
}
|
||||
} else {
|
||||
quietly_check_login();
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1015,14 +1015,14 @@ $table{dependencies} =
|
||||
# http://bugzilla.mozilla.org/show_bug.cgi?id=75482
|
||||
|
||||
$table{groups} =
|
||||
'group_id mediumint not null auto_increment primary key,
|
||||
'group_id mediumint not null auto_increment primary key,
|
||||
name varchar(255) not null,
|
||||
description text not null,
|
||||
isbuggroup tinyint not null,
|
||||
userregexp tinytext not null,
|
||||
isactive tinyint not null default 1,
|
||||
|
||||
unique(group_id),
|
||||
unique(group_id),
|
||||
unique(name)';
|
||||
|
||||
|
||||
@@ -1056,7 +1056,7 @@ $table{profiles} =
|
||||
disabledtext mediumtext not null,
|
||||
mybugslink tinyint not null default 1,
|
||||
emailflags mediumtext,
|
||||
admin tinyint not null default 0,
|
||||
admin tinyint not null default 0,
|
||||
|
||||
unique(login_name)';
|
||||
|
||||
@@ -1168,8 +1168,8 @@ $table{tokens} =
|
||||
|
||||
# This table determines the groups that a user belongs to
|
||||
$table{user_group_map} =
|
||||
'user_id mediumint not null,
|
||||
group_id mediumint not null';
|
||||
'user_id mediumint not null,
|
||||
group_id mediumint not null';
|
||||
|
||||
# This table determines which groups have permission to see a bug
|
||||
$table{bug_group_map} =
|
||||
@@ -1183,8 +1183,8 @@ $table{product_group_map} =
|
||||
|
||||
# This table determines which groups a user can put another user into
|
||||
$table{bless_group_map} =
|
||||
'user_id mediumint not null,
|
||||
group_id mediumint not null';
|
||||
'user_id mediumint not null,
|
||||
group_id mediumint not null';
|
||||
|
||||
###########################################################################
|
||||
# Create tables
|
||||
@@ -1255,9 +1255,9 @@ sub AddGroup {
|
||||
VALUES (?, ?, ?, ?)');
|
||||
$sth->execute($name, $desc, $userregexp, 0);
|
||||
|
||||
$sth = $dbh->prepare("select last_insert_id()");
|
||||
$sth->execute();
|
||||
my ($last) = $sth->fetchrow_array();
|
||||
$sth = $dbh->prepare("select last_insert_id()");
|
||||
$sth->execute();
|
||||
my ($last) = $sth->fetchrow_array();
|
||||
|
||||
return $last;
|
||||
}
|
||||
@@ -1275,16 +1275,16 @@ AddGroup 'editkeywords', 'Can create, destroy, and edit keywords.';
|
||||
|
||||
if (!GroupExists("editbugs")) {
|
||||
my $id = AddGroup('editbugs', 'Can edit all aspects of any bug.', ".*");
|
||||
my $sth = $dbh->prepare("SELECT userid FROM profiles ORDER BY userid");
|
||||
$sth->execute();
|
||||
while ( my ($userid) = $sth->fetchrow_array() ) {
|
||||
$dbh->do("INSERT INTO user_group_map VALUES ($userid, $id)");
|
||||
}
|
||||
my $sth = $dbh->prepare("SELECT userid FROM profiles ORDER BY userid");
|
||||
$sth->execute();
|
||||
while ( my ($userid) = $sth->fetchrow_array() ) {
|
||||
$dbh->do("INSERT INTO user_group_map VALUES ($userid, $id)");
|
||||
}
|
||||
}
|
||||
|
||||
if (!GroupExists("canconfirm")) {
|
||||
my $id = AddGroup('canconfirm', 'Can confirm a bug.', ".*");
|
||||
my $sth = $dbh->prepare("SELECT userid FROM profiles ORDER BY userid");
|
||||
my $sth = $dbh->prepare("SELECT userid FROM profiles ORDER BY userid");
|
||||
$sth->execute();
|
||||
while ( my ($userid) = $sth->fetchrow_array() ) {
|
||||
$dbh->do("INSERT INTO user_group_map VALUES ($userid, $id)");
|
||||
@@ -1628,27 +1628,27 @@ _End_Of_SQL_
|
||||
VALUES ($login, $realname, $cryptedpassword, 1)
|
||||
_End_Of_SQL_
|
||||
|
||||
# Put the admin in each group if not already
|
||||
my $query = "select userid from profiles where login_name = $login";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute();
|
||||
my ($userid) = $sth->fetchrow_array();
|
||||
# Put the admin in each group if not already
|
||||
my $query = "select userid from profiles where login_name = $login";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute();
|
||||
my ($userid) = $sth->fetchrow_array();
|
||||
|
||||
foreach my $group ( @groups ) {
|
||||
my $query = "select
|
||||
foreach my $group ( @groups ) {
|
||||
my $query = "select
|
||||
user_id
|
||||
from
|
||||
user_group_map
|
||||
where
|
||||
group_id = $group
|
||||
and user_id = $userid";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute();
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute();
|
||||
|
||||
if ( !$sth->fetchrow_array() ) {
|
||||
$sth = $dbh->do("insert into user_group_map values ($userid, $group)");
|
||||
}
|
||||
}
|
||||
if ( !$sth->fetchrow_array() ) {
|
||||
$sth = $dbh->do("insert into user_group_map values ($userid, $group)");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$dbh->do(<<_End_Of_SQL_);
|
||||
@@ -1657,14 +1657,14 @@ _End_Of_SQL_
|
||||
WHERE login_name=$login
|
||||
_End_Of_SQL_
|
||||
|
||||
# Put the admin in each group if not already
|
||||
my $query = "select userid from profiles where login_name = $login";
|
||||
$sth = $dbh->prepare($query);
|
||||
# Put the admin in each group if not already
|
||||
my $query = "select userid from profiles where login_name = $login";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute();
|
||||
my ($userid) = $sth->fetchrow_array();
|
||||
|
||||
foreach my $group ( @groups ) {
|
||||
my $query = "select
|
||||
foreach my $group ( @groups ) {
|
||||
my $query = "select
|
||||
user_id
|
||||
from
|
||||
user_group_map
|
||||
@@ -1678,7 +1678,6 @@ _End_Of_SQL_
|
||||
$dbh->do("insert into user_group_map values ( $userid, $group)");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
print "\n$login is now set up as the administrator account.\n";
|
||||
}
|
||||
|
||||
@@ -298,8 +298,8 @@ if ($action eq 'new') {
|
||||
$isactive . ")" );
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
SendSQL("SELECT group_id FROM groups where name = " . SqlQuote($name));
|
||||
my $id = FetchOneColumn();
|
||||
SendSQL("SELECT group_id FROM groups where name = " . SqlQuote($name));
|
||||
my $id = FetchOneColumn();
|
||||
print "Your new group was assigned id # $id.<p>";
|
||||
|
||||
# Add each user designated as an Admin to the new group
|
||||
@@ -332,7 +332,7 @@ if ($action eq 'del') {
|
||||
exit;
|
||||
}
|
||||
SendSQL("SELECT group_id FROM groups WHERE group_id = " . SqlQuote($id));
|
||||
if (!FetchOneColumn()) {
|
||||
if (!FetchOneColumn()) {
|
||||
ShowError("That group doesn't exist.<BR>" .
|
||||
"Click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
@@ -359,8 +359,8 @@ if ($action eq 'del') {
|
||||
print "<FORM METHOD=POST ACTION=editgroups.cgi>\n";
|
||||
my $cantdelete = 0;
|
||||
SendSQL("SELECT COUNT(user_id) FROM user_group_map WHERE group_id = $id");
|
||||
my $usergroupcount = FetchOneColumn();
|
||||
SendSQL("SELECT COUNT(DISTINCT user_id) FROM bless_group_map WHERE group_id = $id");
|
||||
my $usergroupcount = FetchOneColumn();
|
||||
SendSQL("SELECT COUNT(DISTINCT user_id) FROM bless_group_map WHERE group_id = $id");
|
||||
my $blessgroupcount = FetchOneColumn();
|
||||
if ($usergroupcount || $blessgroupcount) {
|
||||
$cantdelete = 1;
|
||||
|
||||
@@ -372,14 +372,14 @@ if ($action eq 'new') {
|
||||
# the bug group. As is, it was adding all users, since they all
|
||||
# matched the empty pattern.
|
||||
unless($userregexp eq "") {
|
||||
SendSQL("SELECT group_id FROM groups WHERE name = " . SqlQuote($product));
|
||||
my $groupid = FetchOneColumn();
|
||||
SendSQL("SELECT userid FROM profiles " .
|
||||
"WHERE LOWER(login_name) REGEXP LOWER(" . SqlQuote($userregexp) . ")" .
|
||||
" OR admin = 1");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
$::db->do("INSERT INTO user_group_map VALUES ($row[0], $groupid)");
|
||||
}
|
||||
SendSQL("SELECT group_id FROM groups WHERE name = " . SqlQuote($product));
|
||||
my $groupid = FetchOneColumn();
|
||||
SendSQL("SELECT userid FROM profiles " .
|
||||
"WHERE LOWER(login_name) REGEXP LOWER(" . SqlQuote($userregexp) . ")" .
|
||||
" OR admin = 1");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
$::db->do("INSERT INTO user_group_map VALUES ($row[0], $groupid)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ if ($action eq 'delete') {
|
||||
groups WRITE,
|
||||
profiles WRITE,
|
||||
milestones WRITE,
|
||||
user_group_map WRITE");
|
||||
user_group_map WRITE");
|
||||
|
||||
# According to MySQL doc I cannot do a DELETE x.* FROM x JOIN Y,
|
||||
# so I have to iterate over bugs and delete all the indivial entries
|
||||
@@ -635,7 +635,7 @@ if ($action eq 'delete') {
|
||||
|
||||
# Make sure there is a group before we try to do any deleting...
|
||||
if ($groupid) {
|
||||
SendSQL("DELETE FROM user_group_map WHERE group_id = $groupid");
|
||||
SendSQL("DELETE FROM user_group_map WHERE group_id = $groupid");
|
||||
print "Users dropped from group '$group_desc'.<BR>\n";
|
||||
|
||||
SendSQL("DELETE FROM groups " .
|
||||
@@ -837,7 +837,7 @@ if ($action eq 'update') {
|
||||
groups WRITE,
|
||||
profiles WRITE,
|
||||
milestones WRITE,
|
||||
user_group_map WRITE");
|
||||
user_group_map WRITE");
|
||||
|
||||
if ($disallownew ne $disallownewold) {
|
||||
$disallownew ||= 0;
|
||||
@@ -903,13 +903,13 @@ if ($action eq 'update') {
|
||||
# users who matched the old regexp and not the new one; that would
|
||||
# be insanely messy. Use the group administration page for that
|
||||
# instead.
|
||||
if ( !$groupid ) {
|
||||
SendSQL("SELECT group_id FROM groups WHERE name = " . SqlQuote($productold));
|
||||
$groupid = FetchOneColumn();
|
||||
}
|
||||
SendSQL("SELECT userid FROM profiles " .
|
||||
if ( !$groupid ) {
|
||||
SendSQL("SELECT group_id FROM groups WHERE name = " . SqlQuote($productold));
|
||||
$groupid = FetchOneColumn();
|
||||
}
|
||||
SendSQL("SELECT userid FROM profiles " .
|
||||
"WHERE LOWER(login_name) REGEXP LOWER(" . SqlQuote($userregexp) . ")" .
|
||||
" OR admin = 1");
|
||||
" OR admin = 1");
|
||||
my $updated_profiles = 0;
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
$::db->do("INSERT INTO user_group_map VALUES ($row[0], $groupid)");
|
||||
|
||||
@@ -43,7 +43,7 @@ sub sillyness {
|
||||
}
|
||||
|
||||
my $editall;
|
||||
my @opblessgroupset = (); # Groups that this viewer can bless someone into
|
||||
my @opblessgroupset = (); # Groups that this viewer can bless someone into
|
||||
|
||||
|
||||
# TestUser: just returns if the specified user does exists
|
||||
@@ -132,7 +132,7 @@ sub EmitFormElements ($$$$$)
|
||||
|
||||
|
||||
if($user ne "") {
|
||||
# Edit bug groups
|
||||
# Edit bug groups
|
||||
print "</TR><TR><TH VALIGN=TOP ALIGN=RIGHT>Group Access:</TH><TD><TABLE><TR>";
|
||||
SendSQL("SELECT group_id, name, description " .
|
||||
"FROM groups " .
|
||||
@@ -147,25 +147,25 @@ sub EmitFormElements ($$$$$)
|
||||
}
|
||||
while (MoreSQLData()) {
|
||||
my ($groupid, $name, $description) = FetchSQLData();
|
||||
my ($bless_checked, $group_checked);
|
||||
my $canedit = 0;
|
||||
my ($bless_checked, $group_checked);
|
||||
my $canedit = 0;
|
||||
print "</TR><TR>\n";
|
||||
if ($editall) {
|
||||
$bless_checked = (lsearch($bless_belong, $groupid) >= 0) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"bless_$name\" $bless_checked VALUE=\"$groupid\"></TD>";
|
||||
}
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
$group_checked = (lsearch($groups_belong, $groupid) >= 0) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"group_$name\" $group_checked VALUE=\"$groupid\"></TD>";
|
||||
$canedit = 1;
|
||||
}
|
||||
if ( $canedit ) {
|
||||
print "<TD><B>" . ucfirst($name) . "</B>: $description</TD>\n";
|
||||
}
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
$group_checked = (lsearch($groups_belong, $groupid) >= 0) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"group_$name\" $group_checked VALUE=\"$groupid\"></TD>";
|
||||
$canedit = 1;
|
||||
}
|
||||
if ( $canedit ) {
|
||||
print "<TD><B>" . ucfirst($name) . "</B>: $description</TD>\n";
|
||||
}
|
||||
}
|
||||
print "</TR></TABLE></TD>\n";
|
||||
|
||||
# Non non bug groups
|
||||
# Non non bug groups
|
||||
print "</TR><TR><TH VALIGN=TOP ALIGN=RIGHT>Privileges:</TH><TD><TABLE><TR>";
|
||||
SendSQL("SELECT group_id, name, description " .
|
||||
"FROM groups " .
|
||||
@@ -180,21 +180,21 @@ sub EmitFormElements ($$$$$)
|
||||
}
|
||||
while (MoreSQLData()) {
|
||||
my ($groupid, $name, $description) = FetchSQLData();
|
||||
my ($bless_checked, $group_checked);
|
||||
my $canedit = 0;
|
||||
print "</TR><TR>\n";
|
||||
my ($bless_checked, $group_checked);
|
||||
my $canedit = 0;
|
||||
print "</TR><TR>\n";
|
||||
if ($editall) {
|
||||
$bless_checked = (lsearch($bless_belong, $groupid) >= 0) ? "CHECKED" : "";
|
||||
$bless_checked = (lsearch($bless_belong, $groupid) >= 0) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"bless_$name\" $bless_checked VALUE=\"$groupid\"></TD>";
|
||||
}
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
$group_checked = (lsearch($groups_belong, $groupid) >= 0) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"group_$name\" $group_checked VALUE=\"$groupid\"></TD>";
|
||||
$canedit = 1;
|
||||
}
|
||||
if ( $canedit ) {
|
||||
print "<TD><B>" . ucfirst($name) . "</B>: $description</TD>\n";
|
||||
}
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
$group_checked = (lsearch($groups_belong, $groupid) >= 0) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"group_$name\" $group_checked VALUE=\"$groupid\"></TD>";
|
||||
$canedit = 1;
|
||||
}
|
||||
if ( $canedit ) {
|
||||
print "<TD><B>" . ucfirst($name) . "</B>: $description</TD>\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print "</TR><TR><TH ALIGN=RIGHT>Groups and<br>Priveleges:</TH><TD><TABLE><TR>";
|
||||
@@ -251,9 +251,9 @@ $editall = UserInGroup($userid, "editusers");
|
||||
|
||||
if (!$editall) {
|
||||
SendSQL("SELECT group_id FROM bless_group_map WHERE user_id = $::userid");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
push(@opblessgroupset, $row[0]);
|
||||
}
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
push(@opblessgroupset, $row[0]);
|
||||
}
|
||||
|
||||
unless ( @opblessgroupset ) {
|
||||
PutHeader("Not allowed");
|
||||
@@ -485,13 +485,13 @@ if ($action eq 'new') {
|
||||
# We also keep a list of groups the user was added to for display on the
|
||||
# confirmation page.
|
||||
my @groupidlist = ();
|
||||
my @groupnamelist = ();
|
||||
my @groupnamelist = ();
|
||||
SendSQL("select group_id, name, userregexp from groups where userregexp != ''");
|
||||
while (MoreSQLData()) {
|
||||
my @row = FetchSQLData();
|
||||
if ($user =~ m/$row[2]/i) {
|
||||
push(@groupidlist, $row[0]);
|
||||
push(@groupnamelist, $row[1]);
|
||||
push(@groupnamelist, $row[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,12 +506,12 @@ if ($action eq 'new') {
|
||||
|
||||
#+++ send e-mail away
|
||||
|
||||
# grab userid and place user in each of the groups they need to be
|
||||
SendSQL("select userid from profiles where login_name = " . SqlQuote($user));
|
||||
my $userid = FetchOneColumn();
|
||||
foreach my $groupid ( @groupidlist ) {
|
||||
SendSQL("insert into user_group_map values ($userid, $groupid)");
|
||||
}
|
||||
# grab userid and place user in each of the groups they need to be
|
||||
SendSQL("select userid from profiles where login_name = " . SqlQuote($user));
|
||||
my $userid = FetchOneColumn();
|
||||
foreach my $groupid ( @groupidlist ) {
|
||||
SendSQL("insert into user_group_map values ($userid, $groupid)");
|
||||
}
|
||||
|
||||
print "OK, done.<br>\n";
|
||||
if($#groupidlist > -1) {
|
||||
@@ -555,7 +555,7 @@ if ($action eq 'del') {
|
||||
|
||||
# display some data about the user
|
||||
SendSQL("SELECT realname FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
my $realname = FetchOneColumn();
|
||||
$realname ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
|
||||
@@ -576,8 +576,8 @@ if ($action eq 'del') {
|
||||
print " <TD VALIGN=\"top\">Group set:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">";
|
||||
SendSQL("SELECT name
|
||||
FROM groups
|
||||
ORDER BY isbuggroup, name");
|
||||
FROM groups
|
||||
ORDER BY isbuggroup, name");
|
||||
my $found = 0;
|
||||
while ( MoreSQLData() ) {
|
||||
my ($name) = FetchSQLData();
|
||||
@@ -709,29 +709,29 @@ if ($action eq 'edit') {
|
||||
|
||||
# get data of user
|
||||
SendSQL("SELECT userid, realname, disabledtext
|
||||
FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
my ($userid, $realname, $disabledtext) = FetchSQLData();
|
||||
|
||||
# find out which groups belong to
|
||||
my $groups_belong = [];
|
||||
SendSQL("select group_id from user_group_map where user_id = $userid");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
push (@{$groups_belong}, $row[0]);
|
||||
}
|
||||
|
||||
# find out which groups belong to
|
||||
my $groups_belong = [];
|
||||
SendSQL("select group_id from user_group_map where user_id = $userid");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
push (@{$groups_belong}, $row[0]);
|
||||
}
|
||||
|
||||
# find out when groups this person can bless others into
|
||||
# find out when groups this person can bless others into
|
||||
my $bless_belong = [];
|
||||
SendSQL("select group_id from bless_group_map where user_id = $userid");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
push (@{$bless_belong}, $row[0]);
|
||||
}
|
||||
|
||||
#print "Groups: " . join(', ', @{$groups_belong}) . "<br>\n";
|
||||
#print "Bless: " . join(', ', @{$bless_belong}) . "<br>\n";
|
||||
#print "OpBless: " . join(', ', @opblessgroupset) . "<br>\n";
|
||||
|
||||
#print "Groups: " . join(', ', @{$groups_belong}) . "<br>\n";
|
||||
#print "Bless: " . join(', ', @{$bless_belong}) . "<br>\n";
|
||||
#print "OpBless: " . join(', ', @opblessgroupset) . "<br>\n";
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
|
||||
print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements($user, $realname, $disabledtext, $groups_belong, $bless_belong);
|
||||
@@ -767,27 +767,27 @@ if ($action eq 'update') {
|
||||
my $disabledtext = trim($::FORM{disabledtext} || '');
|
||||
my $disabledtextold = trim($::FORM{disabledtextold} || '');
|
||||
|
||||
my @groupset = ();
|
||||
my @blessgroupset = ();
|
||||
my @groupset = ();
|
||||
my @blessgroupset = ();
|
||||
|
||||
foreach (keys %::FORM) {
|
||||
next unless /^group_/;
|
||||
#print "$_=$::FORM{$_}<br>\n";
|
||||
push(@groupset, $::FORM{$_});
|
||||
next unless /^group_/;
|
||||
#print "$_=$::FORM{$_}<br>\n";
|
||||
push(@groupset, $::FORM{$_});
|
||||
}
|
||||
foreach (keys %::FORM) {
|
||||
next unless /^bless_/;
|
||||
#print "$_=$::FORM{$_}<br>\n";
|
||||
push(@blessgroupset, $::FORM{$_});
|
||||
next unless /^bless_/;
|
||||
#print "$_=$::FORM{$_}<br>\n";
|
||||
push(@blessgroupset, $::FORM{$_});
|
||||
}
|
||||
|
||||
# print "Groups: " . join(', ', @groupset) . "<br>\n";
|
||||
# print "Groups: " . join(', ', @groupset) . "<br>\n";
|
||||
# print "Bless: " . join(', ', @blessgroupset) . "<br>\n";
|
||||
|
||||
CheckUser($userold);
|
||||
|
||||
SendSQL("SELECT userid, admin FROM profiles WHERE login_name = " . SqlQuote($userold));
|
||||
my ($userid, $admin) = FetchSQLData();
|
||||
SendSQL("SELECT userid, admin FROM profiles WHERE login_name = " . SqlQuote($userold));
|
||||
my ($userid, $admin) = FetchSQLData();
|
||||
# if ($groupset ne $groupsetold) {
|
||||
# SendSQL("SELECT groupset FROM profiles WHERE login_name=" .
|
||||
# SqlQuote($userold));
|
||||
@@ -821,25 +821,25 @@ if ($action eq 'update') {
|
||||
# }
|
||||
# }
|
||||
|
||||
if ( !$admin ) {
|
||||
SendSQL("DELETE FROM user_group_map WHERE user_id = $userid");
|
||||
foreach my $groupid ( @groupset ) {
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
if ( !$admin ) {
|
||||
SendSQL("DELETE FROM user_group_map WHERE user_id = $userid");
|
||||
foreach my $groupid ( @groupset ) {
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
SendSQL("insert into user_group_map values ($userid, $groupid)");
|
||||
}
|
||||
}
|
||||
print "Updated permissions<br>\n";
|
||||
}
|
||||
}
|
||||
print "Updated permissions<br>\n";
|
||||
|
||||
SendSQL("DELETE FROM bless_group_map WHERE user_id = $userid");
|
||||
SendSQL("DELETE FROM bless_group_map WHERE user_id = $userid");
|
||||
foreach my $groupid ( @blessgroupset ) {
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
SendSQL("INSERT INTO bless_group_map VALUES ($userid, $groupid)");
|
||||
}
|
||||
if ( $editall || (lsearch(\@opblessgroupset, $groupid) >= 0) ) {
|
||||
SendSQL("INSERT INTO bless_group_map VALUES ($userid, $groupid)");
|
||||
}
|
||||
}
|
||||
print "Updated ability to tweak permissions of other users.<br>\n";
|
||||
} else {
|
||||
print "Cannot change permissions of a superuser.<br>\n";
|
||||
}
|
||||
print "Updated ability to tweak permissions of other users.<br>\n";
|
||||
} else {
|
||||
print "Cannot change permissions of a superuser.<br>\n";
|
||||
}
|
||||
|
||||
# Update the database with the user's new password if they changed it.
|
||||
if ( !Param('useLDAP') && $editall && $password ) {
|
||||
|
||||
@@ -58,7 +58,7 @@ sub sillyness {
|
||||
my $userid = 0;
|
||||
if (Param("usebuggroupsentry")) {
|
||||
confirm_login();
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
}
|
||||
|
||||
if (!defined $::FORM{'product'}) {
|
||||
@@ -455,7 +455,7 @@ print "
|
||||
if ($userid ne '0') {
|
||||
SendSQL("SELECT groups.group_id, name, description FROM groups, user_group_map " .
|
||||
"WHERE groups.group_id = user_group_map.group_id " .
|
||||
"AND user_group_map.user_id = $userid " .
|
||||
"AND user_group_map.user_id = $userid " .
|
||||
"AND isbuggroup != 0 AND isactive = 1 ORDER BY description");
|
||||
# We only print out a header bit for this section if there are any
|
||||
# results.
|
||||
|
||||
@@ -1263,10 +1263,10 @@ sub UserInGroup {
|
||||
return 0;
|
||||
}
|
||||
ConnectToDatabase();
|
||||
SendSQL("SELECT user_id FROM user_group_map, groups
|
||||
WHERE user_group_map.group_id = groups.group_id
|
||||
AND groups.name = '$groupname'
|
||||
AND user_id = $userid");
|
||||
SendSQL("SELECT user_id FROM user_group_map, groups
|
||||
WHERE user_group_map.group_id = groups.group_id
|
||||
AND groups.name = '$groupname'
|
||||
AND user_id = $userid");
|
||||
my $result = FetchOneColumn();
|
||||
if ($result) {
|
||||
return 1;
|
||||
@@ -1278,10 +1278,10 @@ sub BugInGroup {
|
||||
my ($bugid, $groupname) = (@_);
|
||||
my $groupid = GroupNameToId($groupname);
|
||||
PushGlobalSQLState();
|
||||
SendSQL("SELECT bug_id FROM bug_group_map
|
||||
WHERE bug_group_map.group_id = groups.group_id
|
||||
AND groups.name = '$groupname'
|
||||
AND bug_id = $bugid");
|
||||
SendSQL("SELECT bug_id FROM bug_group_map
|
||||
WHERE bug_group_map.group_id = groups.group_id
|
||||
AND groups.name = '$groupname'
|
||||
AND bug_id = $bugid");
|
||||
my $bugingroup = FetchOneColumn();
|
||||
PopGlobalSQLState();
|
||||
return $bugingroup;
|
||||
|
||||
@@ -959,7 +959,7 @@ foreach my $id (@idlist) {
|
||||
"profiles $write, dependencies $write, votes $write, " .
|
||||
"keywords $write, longdescs $write, fielddefs $write, " .
|
||||
"keyworddefs READ, groups READ, attachments READ, products READ, " .
|
||||
"user_group_map READ, bug_group_map READ");
|
||||
"user_group_map READ, bug_group_map READ");
|
||||
my @oldvalues = SnapShotBug($id);
|
||||
my %oldhash;
|
||||
my $i = 0;
|
||||
|
||||
@@ -192,7 +192,7 @@ Status("Checking groups");
|
||||
my %legal_groups = ();
|
||||
SendSQL("select group_id from groups order by group_id");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
$legal_groups{$row[0]} = 1;
|
||||
$legal_groups{$row[0]} = 1;
|
||||
}
|
||||
SendSQL("select distinct group_id from user_group_map order by group_id");
|
||||
while ( my @row = FetchSQLData() ) {
|
||||
|
||||
@@ -27,11 +27,9 @@ require "CGI.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
my $userid = 0;
|
||||
quietly_check_login();
|
||||
|
||||
# More warning suppression silliness.
|
||||
$::userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
$::usergroupset = $::usergroupset;
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
|
||||
######################################################################
|
||||
# Begin Data/Security Validation
|
||||
@@ -125,8 +123,7 @@ node [URL="${urlbase}show_bug.cgi?id=\\N", style=filled, color=lightgrey]
|
||||
my $stat;
|
||||
if ($::FORM{'showsummary'}) {
|
||||
SendSQL(SelectVisible("select bug_status, short_desc from bugs where bug_id = $k",
|
||||
$::userid,
|
||||
$::usergroupset));
|
||||
$userid));
|
||||
($stat, $summary) = (FetchSQLData());
|
||||
$stat = "NEW" if !defined $stat;
|
||||
$summary = "" if !defined $summary;
|
||||
@@ -134,9 +131,9 @@ node [URL="${urlbase}show_bug.cgi?id=\\N", style=filled, color=lightgrey]
|
||||
SendSQL("select bug_status from bugs where bug_id = $k");
|
||||
$stat = FetchOneColumn();
|
||||
}
|
||||
if ( !ValidateBugID($k, $userid) ) {
|
||||
next;
|
||||
}
|
||||
if ( !ValidateBugID($k, $userid) ) {
|
||||
next;
|
||||
}
|
||||
my @params;
|
||||
# print DOT "$k [URL" . qq{="${urlbase}show_bug.cgi?id=$k"};
|
||||
if ($summary ne "") {
|
||||
|
||||
@@ -32,11 +32,9 @@ use vars %::FORM;
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
my $userid = 0;
|
||||
quietly_check_login();
|
||||
|
||||
# More warning suppression silliness.
|
||||
$::userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
$::usergroupset = $::usergroupset;
|
||||
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
|
||||
|
||||
######################################################################
|
||||
# Begin Data/Security Validation
|
||||
@@ -130,16 +128,16 @@ sub DumpKids {
|
||||
my ($bugid, $stat, $milestone) = ("", "", "");
|
||||
my ($userid, $short_desc) = ("", "");
|
||||
if (Param('usetargetmilestone')) {
|
||||
SendSQL(SelectVisible("select bugs.bug_id, bug_status, target_milestone, assigned_to, short_desc from bugs where bugs.bug_id = $kid", $::userid, $::usergroupset));
|
||||
SendSQL(SelectVisible("select bugs.bug_id, bug_status, target_milestone, assigned_to, short_desc from bugs where bugs.bug_id = $kid", $userid));
|
||||
($bugid, $stat, $milestone, $userid, $short_desc) = (FetchSQLData());
|
||||
} else {
|
||||
SendSQL(SelectVisible("select bugs.bug_id, bug_status, assigned_to, short_desc from bugs where bugs.bug_id = $kid", $::userid, $::usergroupset));
|
||||
SendSQL(SelectVisible("select bugs.bug_id, bug_status, assigned_to, short_desc from bugs where bugs.bug_id = $kid", $userid));
|
||||
($bugid, $stat, $userid, $short_desc) = (FetchSQLData());
|
||||
|
||||
}
|
||||
#if ( !ValidateBugID($kid, $userid) ) {
|
||||
# next;
|
||||
#}
|
||||
#if ( !ValidateBugID($kid, $userid) ) {
|
||||
# next;
|
||||
#}
|
||||
if (! defined $bugid) { next; }
|
||||
my $opened = IsOpenedState($stat);
|
||||
if ($hide_resolved && ! $opened) { next; }
|
||||
|
||||
@@ -507,7 +507,7 @@ sub ShowPermissions {
|
||||
my $found = 0;
|
||||
SendSQL("SELECT description FROM groups, user_group_map " .
|
||||
"WHERE groups.group_id = user_group_map.group_id " .
|
||||
"AND user_group_map.user_id = $userid " .
|
||||
"AND user_group_map.user_id = $userid " .
|
||||
"ORDER BY description");
|
||||
while (MoreSQLData()) {
|
||||
my ($description) = (FetchSQLData());
|
||||
@@ -518,23 +518,23 @@ sub ShowPermissions {
|
||||
print "<LI>(No extra permission bits have been set).\n";
|
||||
}
|
||||
print "</UL>\n";
|
||||
SendSQL("SELECT COUNT(group_id) FROM bless_group_map WHERE user_id = $userid");
|
||||
my $blessgroupset = FetchOneColumn();
|
||||
if ( $blessgroupset ) {
|
||||
print "And you can turn on or off the following bits for\n";
|
||||
print qq{<A HREF="editusers.cgi">other users</A>:\n};
|
||||
print "<P><UL>\n";
|
||||
SendSQL("SELECT description FROM groups, bless_group_map " .
|
||||
"WHERE groups.group_id = bless_group_map.group_id " .
|
||||
"AND bless_group_map.user_id = $userid " .
|
||||
"ORDER BY description");
|
||||
while (MoreSQLData()) {
|
||||
my ($description) = (FetchSQLData());
|
||||
print "<LI>$description\n";
|
||||
}
|
||||
SendSQL("SELECT COUNT(group_id) FROM bless_group_map WHERE user_id = $userid");
|
||||
my $blessgroupset = FetchOneColumn();
|
||||
if ( $blessgroupset ) {
|
||||
print "And you can turn on or off the following bits for\n";
|
||||
print qq{<A HREF="editusers.cgi">other users</A>:\n};
|
||||
print "<P><UL>\n";
|
||||
SendSQL("SELECT description FROM groups, bless_group_map " .
|
||||
"WHERE groups.group_id = bless_group_map.group_id " .
|
||||
"AND bless_group_map.user_id = $userid " .
|
||||
"ORDER BY description");
|
||||
while (MoreSQLData()) {
|
||||
my ($description) = (FetchSQLData());
|
||||
print "<LI>$description\n";
|
||||
}
|
||||
print "</UL>\n";
|
||||
}
|
||||
print "</TR></TD>\n";
|
||||
}
|
||||
print "</TR></TD>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user