Adding karma.
This commit is contained in:
parent
8a6b95b612
commit
06b64fc226
2 changed files with 11 additions and 5 deletions
|
|
@ -81,7 +81,11 @@ sub www_editGroup {
|
||||||
$f->text("groupName",WebGUI::International::get(84),$group{groupName});
|
$f->text("groupName",WebGUI::International::get(84),$group{groupName});
|
||||||
$f->textarea("description",WebGUI::International::get(85),$group{description});
|
$f->textarea("description",WebGUI::International::get(85),$group{description});
|
||||||
$f->integer("expireAfter",WebGUI::International::get(367),$group{expireAfter});
|
$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;
|
$f->submit;
|
||||||
$output .= $f->print;
|
$output .= $f->print;
|
||||||
unless ($session{form}{gid} eq "new") {
|
unless ($session{form}{gid} eq "new") {
|
||||||
|
|
|
||||||
|
|
@ -137,11 +137,13 @@ sub isInGroup {
|
||||||
### Get data for auxillary checks.
|
### Get data for auxillary checks.
|
||||||
tie %group, 'Tie::CPHash';
|
tie %group, 'Tie::CPHash';
|
||||||
%group = WebGUI::SQL->quickHash("select karmaThreshold from groups where groupId='$gid'");
|
%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.
|
### Check karma levels.
|
||||||
if ($user{karma} >= $group{karmaThreshold}) {
|
if ($session{setting}{useKarma}) {
|
||||||
return 1;
|
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!
|
### Admins can do anything!
|
||||||
if ($gid != 3) {
|
if ($gid != 3) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue