[LON-CAPA-cvs] cvs: loncom /interface longroup.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 01 May 2008 16:26:29 -0000


raeburn		Thu May  1 12:26:29 2008 EDT

  Modified files:              
    /loncom/interface	longroup.pm 
  Log:
  &group_changes() can take extra arguments - selfenroll and context, to be stored in record for membership changes in nohist_groupslog.db
  
  
Index: loncom/interface/longroup.pm
diff -u loncom/interface/longroup.pm:1.15 loncom/interface/longroup.pm:1.16
--- loncom/interface/longroup.pm:1.15	Wed Dec 20 17:37:04 2006
+++ loncom/interface/longroup.pm	Thu May  1 12:26:29 2008
@@ -199,6 +199,8 @@
 4. Role
 5. End date of role
 6. Start date of role
+7. Selfenroll
+8. Context
 
 Checks to see if role for which assignment is being made is in a course.
 If so, gathers information about auto-group population settings for
@@ -214,7 +216,11 @@
 If role is being added, will add any group memberships specified
 for auto-group population, unless use is already a group member.
 Uses default group privileges and default start and end group access
-times. 
+times.
+
+Flag for selfenroll (value of 1), and context (auto, updatenow, 
+automated, course, domain etc.) can be used to log the reason for
+the role change.     
 
 Output
 None
@@ -227,7 +233,7 @@
 =cut
 
 sub group_changes {
-    my ($udom,$uname,$url,$role,$origend,$origstart) = @_;
+    my ($udom,$uname,$url,$role,$origend,$origstart,$selfenroll,$context) = @_;
     my $now = time;
     my $chgtype;
     if ($origend > 0 && $origend <= $now) {
@@ -339,7 +345,7 @@
                                                   $add,$uname.':'.$udom,
                                                   $settings{$add}{'enddate'},
                                                   $settings{$add}{'startdate'},
-                                                  $group_privs) eq 'ok') {
+                                                  $group_privs,$selfenroll,$context) eq 'ok') {
                             my %usersettings;
                             $usersettings{$add.':'.$uname.':'.$udom} =
                                                                $addgroup{$add};
@@ -408,7 +414,8 @@
                                                          $cnum,$drop,
                                                          $uname.':'.$udom,$now,
                                                          $dropstart{$drop},
-                                                         $currpriv{$drop}) 
+                                                         $currpriv{$drop},
+                                                         $selfenroll,$context) 
                                                                      eq 'ok') {
                                 my %usersettings;
                                 $usersettings{$drop.':'.$uname.':'.$udom} =