Adding karma.
This commit is contained in:
parent
8a6b95b612
commit
06b64fc226
2 changed files with 11 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue