diff --git a/lib/WebGUI/Group.pm b/lib/WebGUI/Group.pm index 4d1638df3..0093c2ecc 100755 --- a/lib/WebGUI/Group.pm +++ b/lib/WebGUI/Group.pm @@ -708,11 +708,12 @@ sub new { =head2 scratchFilter ( [ value ] ) -Returns the name of this group. +Returns the scratch value that should be set to automatically add this user +to a group. =head3 value -If specified, the name is set to this value. +If specified, the scratchFilter is set to this value. =cut @@ -749,8 +750,6 @@ sub showInForms { #------------------------------------------------------------------- -=head2 dbQuery ( ) - =head2 dbQuery ( [ value ] ) Returns the dbQuery for this group. diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index dbaaa0108..f65f4d9ab 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -219,7 +219,7 @@ sub www_deleteGroupConfirm { return $session->privilege->vitalComponent() if (isIn($session->form->process("gid"), qw(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17))); my $g = WebGUI::Group->new($session,$session->form->process("gid")); $g->delete; - return www_listGroups(); + return www_listGroups($session); } #------------------------------------------------------------------- @@ -429,7 +429,7 @@ sub www_editGroupSave { $g->ldapGroup($session->form->text("ldapGroup")); $g->ldapGroupProperty($session->form->text("ldapGroupProperty")); $g->ldapRecursiveProperty($session->form->text("ldapRecursiveProperty")); - return www_listGroups(); + return www_listGroups($session); } #------------------------------------------------------------------- diff --git a/t/Group.t b/t/Group.t new file mode 100644 index 000000000..05424f149 --- /dev/null +++ b/t/Group.t @@ -0,0 +1,39 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2006 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/lib"; + +use WebGUI::Test; +use WebGUI::Session; +use WebGUI::Utility; + +use WebGUI::User; +use WebGUI::Group; +use Test::More tests => 4; # increment this value for each test you create + +my $session = WebGUI::Test->session; + +my $g = WebGUI::Group->new($session, "new"); + +diag("Object creation and defaults"); +is( ref $g, "WebGUI::Group", "Group object creation"); +isnt( $g->getId, "new", "Group assigned new groupId, not new"); +is( length($g->getId), 22, "GroupId is proper length"); + +my $gid = $g->getId; + +$g->delete(); + +my $matchingGroups = $session->db->quickArray("select groupId from groups where groupId=".$session->db->quote($gid)); + +is ( $matchingGroups, 0, 'group was removed'); +