Adding karma.

This commit is contained in:
JT Smith 2002-06-19 00:59:01 +00:00
parent 428dd45110
commit 566a62e6af
4 changed files with 27 additions and 10 deletions

View file

@ -68,6 +68,7 @@ sub www_editGroup {
if (WebGUI::Privilege::isInGroup(3)) {
if ($session{form}{gid} eq "new") {
$group{expireAfter} = 314496000;
$group{karmaThreshold} = 1000000000;
} else {
%group = WebGUI::SQL->quickHash("select * from groups where groupId=$session{form}{gid}");
}
@ -80,6 +81,7 @@ 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});
$f->submit;
$output .= $f->print;
unless ($session{form}{gid} eq "new") {
@ -116,7 +118,8 @@ sub www_editGroupSave {
WebGUI::SQL->write("insert into groups (groupId) values ($session{form}{gid})");
}
WebGUI::SQL->write("update groups set groupName=".quote($session{form}{groupName}).",
description=".quote($session{form}{description}).", expireAfter='$session{form}{expireAfter}'
description=".quote($session{form}{description}).", expireAfter='$session{form}{expireAfter}',
karmaThreshold='$session{form}{karmaThreshold}'
where groupId=".$session{form}{gid});
return www_listGroups();
} else {

View file

@ -202,6 +202,7 @@ sub www_editUser {
$f->hidden("op","editUserSave");
$f->hidden("uid",$session{form}{uid});
$f->readOnly($session{form}{uid},WebGUI::International::get(378));
$f->readOnly($u->karma,WebGUI::International::get(537));
$f->readOnly(epochToHuman($u->dateCreated,"%z"),WebGUI::International::get(453));
$f->readOnly(epochToHuman($u->lastUpdated,"%z"),WebGUI::International::get(454));
$f->text("username",WebGUI::International::get(50),$u->username);

View file

@ -30,14 +30,15 @@ use WebGUI::URL;
use WebGUI::User;
$u = WebGUI::User->new(3); or $f = WebGUI::User->new("new");
$authMethod = $u->authMethod("WebGUI");
$connectDN = $u->authMethod("cn=Jon Doe");
$dateCreated = $u->dateCreated;
$identifier = $u->identifier("somepassword");
$lastUpdated = $u->lastUpdated;
$ldapURL = $u->ldapURL("ldap://ldap.mycompany.com:389/o=MyCompany");
$languagePreference = $u->profileField("language","English");
$username = $u->username("jonboy");
$authMethod = $u->authMethod("WebGUI");
$connectDN = $u->authMethod("cn=Jon Doe");
$dateCreated = $u->dateCreated;
$identifier = $u->identifier("somepassword");
$karma = $u->karma;
$lastUpdated = $u->lastUpdated;
$ldapURL = $u->ldapURL("ldap://ldap.mycompany.com:389/o=MyCompany");
$languagePreference = $u->profileField("language","English");
$username = $u->username("jonboy");
$u->addToGroups(\@arr);
$u->deleteFromGroups(\@arr);
@ -213,6 +214,18 @@ sub identifier {
#-------------------------------------------------------------------
=head2 karma ( )
Returns the current level of karma this user has earned.
=cut
sub karma {
return $_[0]->{_user}{karma};
}
#-------------------------------------------------------------------
=head2 lastUpdated ( )
Returns the epoch for when this user was last modified.