diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index 76acc41ca..84cd85593 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -81,7 +81,11 @@ sub www_editGroup { $f->text("groupName",WebGUI::International::get(84),$group{groupName}); $f->textarea("description",WebGUI::International::get(85),$group{description}); $f->integer("expireAfter",WebGUI::International::get(367),$group{expireAfter}); - $f->integer("karmaThreshold",WebGUI::International::get(538),$group{karmaThreshold}); + if ($session{setting}{useKarma}) { + $f->integer("karmaThreshold",WebGUI::International::get(538),$group{karmaThreshold}); + } else { + $f->hidden("karmaThreshold",$group{karmaThreshold}); + } $f->submit; $output .= $f->print; unless ($session{form}{gid} eq "new") { diff --git a/lib/WebGUI/Privilege.pm b/lib/WebGUI/Privilege.pm index 8c9e188ac..631979569 100644 --- a/lib/WebGUI/Privilege.pm +++ b/lib/WebGUI/Privilege.pm @@ -137,11 +137,13 @@ sub isInGroup { ### Get data for auxillary checks. tie %group, 'Tie::CPHash'; %group = WebGUI::SQL->quickHash("select karmaThreshold from groups where groupId='$gid'"); - tie %user, 'Tie::CPHash'; - %user = WebGUI::SQL->quickHash("select karma from users where userId='$uid'"); ### Check karma levels. - if ($user{karma} >= $group{karmaThreshold}) { - return 1; + if ($session{setting}{useKarma}) { + tie %user, 'Tie::CPHash'; + %user = WebGUI::SQL->quickHash("select karma from users where userId='$uid'"); + if ($user{karma} >= $group{karmaThreshold}) { + return 1; + } } ### Admins can do anything! if ($gid != 3) {