Commit ee4d3250 authored by cyeh%bluemartini.com's avatar cyeh%bluemartini.com

front end fix for 31456: Editing a superuser clears their access flags

patch by jmrobin@tgix.com
parent 39166470
...@@ -746,6 +746,11 @@ if ($action eq 'update') { ...@@ -746,6 +746,11 @@ if ($action eq 'update') {
SendSQL("SELECT groupset FROM profiles WHERE login_name=" . SendSQL("SELECT groupset FROM profiles WHERE login_name=" .
SqlQuote($userold)); SqlQuote($userold));
$groupsetold = FetchOneColumn(); $groupsetold = FetchOneColumn();
# Updated, 5/7/00, Joe Robins
# We don't want to change the groupset of a superuser.
if($groupsetold eq $::superusergroupset) {
print "Cannot change permissions of superuser.\n";
} else {
SendSQL("UPDATE profiles SendSQL("UPDATE profiles
SET groupset = SET groupset =
groupset - (groupset & $opblessgroupset) + $groupset groupset - (groupset & $opblessgroupset) + $groupset
...@@ -768,6 +773,7 @@ if ($action eq 'update') { ...@@ -768,6 +773,7 @@ if ($action eq 'update') {
} }
print "Updated permissions.\n"; print "Updated permissions.\n";
} }
}
if ($editall && $blessgroupset ne $blessgroupsetold) { if ($editall && $blessgroupset ne $blessgroupsetold) {
SendSQL("UPDATE profiles SendSQL("UPDATE profiles
......
...@@ -77,6 +77,10 @@ $::defaultqueryname = "(Default query)"; ...@@ -77,6 +77,10 @@ $::defaultqueryname = "(Default query)";
$::unconfirmedstate = "UNCONFIRMED"; $::unconfirmedstate = "UNCONFIRMED";
$::dbwritesallowed = 1; $::dbwritesallowed = 1;
# Adding a global variable for the value of the superuser groupset.
# Joe Robins, 7/5/00
$::superusergroupset = "9223372036854775807";
sub ConnectToDatabase { sub ConnectToDatabase {
my ($useshadow) = (@_); my ($useshadow) = (@_);
if (!defined $::db) { if (!defined $::db) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment