Adding karma.

This commit is contained in:
JT Smith 2002-06-23 22:37:24 +00:00
parent 8a6b95b612
commit 06b64fc226
2 changed files with 11 additions and 5 deletions

View file

@ -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) {