[LON-CAPA-cvs] cvs: loncom /interface loncoursegroups.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Tue, 28 Nov 2006 21:38:10 -0000
raeburn Tue Nov 28 16:38:10 2006 EDT
Modified files:
/loncom/interface loncoursegroups.pm
Log:
Check if group to re-enable really is still a deleted group, before proceeding.
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.65 loncom/interface/loncoursegroups.pm:1.66
--- loncom/interface/loncoursegroups.pm:1.65 Tue Nov 28 14:46:00 2006
+++ loncom/interface/loncoursegroups.pm Tue Nov 28 16:38:04 2006
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursegroups.pm,v 1.65 2006/11/28 19:46:00 raeburn Exp $
+# $Id: loncoursegroups.pm,v 1.66 2006/11/28 21:38:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1297,10 +1297,14 @@
}
sub reenable_group {
- my ($r,$cdom,$cnum,$groupname,) = @_;
+ my ($r,$cdom,$cnum,$groupname) = @_;
my %groups =
&Apache::longroup::coursegroups($cdom,$cnum,$groupname,
'deleted_groups');
+ if (keys(%groups) == 0) {
+ $r->print(&mt('The group ([_1]) was not re-enabled, because it is not a deleted group.<br />Perhaps it has already been re-enabled?',$groupname));
+ return;
+ }
my %groupinfo =
&Apache::longroup::get_group_settings($groups{$groupname});
my $defstart = $groupinfo{'startdate'};
@@ -1368,6 +1372,7 @@
} else {
$r->print(&mt('Re-enabling group failed'));
}
+ return;
}
sub header {