Index: buglist.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v
retrieving revision 1.154
diff -u -r1.154 buglist.cgi
--- buglist.cgi 2001/11/17 21:04:37 1.154
+++ buglist.cgi 2001/12/20 09:23:54
@@ -897,13 +898,20 @@
PutFooter();
exit();
};
- /^asnamed$/ && do {
+ /^(asnamed|asglobal)$/ && do {
confirm_login();
my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
+ /^asglobal$/ && do {
+ if (UserInGroup("canaddquery")) {
+ $userid = 0;
+ } else {
+ Error("Insufficient Rights\n");
+ }
+ };
print "Content-type: text/html\n\n";
my $name = trim($::FORM{'newqueryname'});
if ($name eq "" || $name =~ /[<>&]/) {
- PutHeader("Please pick a valid name for your new query");
+ PutHeader("Please pick a valid name for the new query");
print "Click the Back button and type in a valid name\n";
print "for this query. (Query names should not contain unusual\n";
print "characters.)\n";
Index: template/default/query/query.atml
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/default/query/query.atml,v
retrieving revision 1.2
diff -u -r1.2 query.atml
--- template/default/query/query.atml 2001/11/21 19:56:28 1.2
+++ template/default/query/query.atml 2001/12/20 09:23:54
@@ -624,6 +630,11 @@
Remember this as my default query
+ [% IF UserInGroup('canaddquery') %]
+
+
+ Remember this as a global query, and name it:
+ [% END %]
Remember this query, and name it:
Index: query.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/query.cgi,v
retrieving revision 1.93
diff -u -r1.93 query.cgi
--- query.cgi 2001/11/18 22:23:19 1.93
+++ query.cgi 2001/12/20 09:25:50
@@ -93,6 +94,7 @@
# Function for processing global parameters that contain references
# to other global parameters.
'PerformSubsts' => \&PerformSubsts,
+ 'UserInGroup' => \&UserInGroup,
# Function to search an array for a value
'lsearch' => \&lsearch,
@@ -421,6 +424,14 @@
# Add in the defaults.
$vars->{'default'} = \%default;
+
+if($::userid) {
+ SendSQL("SELECT blessgroupset FROM profiles " .
+ "WHERE userid = $::userid");
+ my ($blessgroupset) = (FetchSQLData());
+ $vars->{'userid'} = $::userid;
+ $vars->{'blessgroupset'} = $blessgroupset;
+}
# Generate and return the UI (HTML page) from the appropriate template.
print "Content-type: text/html\n\n";
Index: checksetup.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v
retrieving revision 1.112
diff -u -r1.112 checksetup.pl
--- checksetup.pl 2001/12/12 22:41:04 1.112
+++ checksetup.pl 2001/12/20 09:27:30
@@ -1330,8 +1347,11 @@
my $id = AddGroup('canconfirm', 'Can confirm a bug.', ".*");
$dbh->do("UPDATE profiles SET groupset = groupset | $id");
}
-
+if (!GroupExists("canaddquery")) {
+ my $id = AddGroup('canaddquery', 'Can add a system query.', ".*");
+ $dbh->do("UPDATE profiles SET groupset = groupset | $id");
+}
Index: CGI.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/CGI.pl,v
retrieving revision 1.125
diff -u -r1.125 CGI.pl
--- CGI.pl 2001/12/09 15:56:23 1.125
+++ CGI.pl 2001/12/20 09:43:51
@@ -1313,6 +1313,7 @@
bug \#
| Reports
+| Queries
};
if ($loggedin) {
if ($::anyvotesallowed) {