From 2133713f71bf87c833ba666bbf9d129b25a624d9 Mon Sep 17 00:00:00 2001 From: "justdave%syndicomm.com" <> Date: Wed, 30 May 2001 04:25:02 +0000 Subject: Fix for bug 65290: can now edit user-regexps for system groups --- editgroups.cgi | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'editgroups.cgi') diff --git a/editgroups.cgi b/editgroups.cgi index 79d448c47..a08eb5ff9 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.
" .
--
cgit v1.2.3-24-g4f1b