--- loncom/auth/lonroles.pm 2012/08/14 15:45:25 1.270 +++ loncom/auth/lonroles.pm 2012/08/14 17:35:04 1.271 @@ -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 @@ sub handler { $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 = ''. &mt('Access to authoring space has been activated').'
'; &update_session_roles(); @@ -2071,7 +2072,7 @@ sub update_session_roles { } 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 @@ sub update_session_roles { 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') {