[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm

raeburn raeburn at source.lon-capa.org
Tue Aug 14 13:35:05 EDT 2012


raeburn		Tue Aug 14 17:35:05 2012 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  - New roles should be active immediately if start date has been reached.    
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.270 loncom/auth/lonroles.pm:1.271
--- loncom/auth/lonroles.pm:1.270	Tue Aug 14 15:45:25 2012
+++ loncom/auth/lonroles.pm	Tue Aug 14 17:35:04 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.270 2012/08/14 15:45:25 raeburn Exp $
+# $Id: lonroles.pm,v 1.271 2012/08/14 17:35:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -262,8 +262,9 @@
                                                                             $env{'user.domain'},undef,
                                                                             \@inststatuses,\%domconfig);
                     if ($val eq 'automatic') {
+                        my $start = $now-1;
                         if (&Apache::lonnet::assignrole($env{'user.domain'},$env{'user.name'},'/'.$env{'user.domain'}.'/',
-                                                        'au',undef,$now,undef,undef,'requestauthor') eq 'ok') {
+                                                        'au',undef,$start,undef,undef,'requestauthor') eq 'ok') {
                             $reqauthor = '<span class="LC_info">'.
                                          &mt('Access to authoring space has been activated').'</span><br />';
                                          &update_session_roles();
@@ -2071,7 +2072,7 @@
         }
         if ($env{$envkey} eq '') {
             my $status_in_db =
-                &curr_role_status($tstart,$tend,$refresh,$now);
+                &curr_role_status($tstart,$tend,$now,$now);
                 &gather_roleprivs(\%allroles,\%allgroups,\%userroles,$where,$role,$tstart,$tend,$status_in_db);
             if (($role eq 'st') && ($env{'request.role'} =~ m{^\Q$role\E\.\Q/$udom/$uname\E})) {
                 if ($status_in_db eq 'active') {
@@ -2115,7 +2116,7 @@
                 my $status_in_env =
                     &curr_role_status($currstart,$currend,$refresh,$update);
                 my $status_in_db =
-                    &curr_role_status($tstart,$tend,$refresh,$now);
+                    &curr_role_status($tstart,$tend,$now,$now);
                 if ($status_in_env ne $status_in_db) {
                     if ($status_in_env eq 'active') {
                         if ($role eq 'st') {




More information about the LON-CAPA-cvs mailing list