From: justdave%syndicomm.com <> Date: Wed, 30 May 2001 04:25:02 +0000 (+0000) Subject: Fix for bug 65290: can now edit user-regexps for system groups X-Git-Tag: bugzilla-2.14~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2133713f71bf87c833ba666bbf9d129b25a624d9;p=thirdparty%2Fbugzilla.git Fix for bug 65290: can now edit user-regexps for system groups --- diff --git a/editgroups.cgi b/editgroups.cgi index 79d448c472..a08eb5ff90 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -133,7 +133,6 @@ unless ($action) { print "\n"; print ""; print "\n"; - print "\n"; print "
"; print "Name is what is used with the UserInGroup() function in any @@ -147,31 +146,41 @@ to others in the same group.
"; grant membership to this group to anyone creating a new account with an email address that matches this regular expression.
"; print "In addition, the following groups that determine user privileges -exist. You can not edit these, but you need to know they are here, because -you can't duplicate the Names of any of them in your user groups either.
"; +exist. You can only edit the User rexexp on these groups. You should also take +care not to duplicate the Names of any of them in your user groups.
"; + print "Also please note that both of the Submit Changes buttons on this page +will submit the changes in both tables. There are two buttons simply for the +sake of convience.
"; print "
Bit | "; print "Name | "; print "Description | "; + print "User RegExp | "; print "
---|---|---|---|
$bit | \n"; print "$name | \n"; + print "\n"; + print "\n"; print "$desc | \n"; + print "\n"; + print "\n"; print " |
\n";
+ print "\n";
+ print "\n";
PutFooter();
exit;
@@ -523,10 +532,18 @@ if ($action eq 'update') {
SendSQL("SELECT name FROM groups WHERE name=" .
SqlQuote($::FORM{"name-$v"}));
if (!FetchOneColumn()) {
- SendSQL("UPDATE groups SET name=" .
- SqlQuote($::FORM{"name-$v"}) .
- " WHERE bit=" . SqlQuote($v));
- print "Group $v name updated.
\n";
+ SendSQL("SELECT name FROM groups WHERE name=" .
+ SqlQuote($::FORM{"oldname-$v"}) .
+ " && isbuggroup = 0");
+ if (FetchOneColumn()) {
+ ShowError("You cannot update the name of a " .
+ "system group. Skipping $v");
+ } else {
+ SendSQL("UPDATE groups SET name=" .
+ SqlQuote($::FORM{"name-$v"}) .
+ " WHERE bit=" . SqlQuote($v));
+ print "Group $v name updated.
\n";
+ }
} else {
ShowError("Duplicate name '" . $::FORM{"name-$v"} .
"' specified for group $v.
" .