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

raeburn raeburn at source.lon-capa.org
Sat Aug 18 23:11:43 EDT 2012


raeburn		Sun Aug 19 03:11:43 2012 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  - Keep track of last course "login". 
    - DC selecting adhoc role in a course (in which he/she has no existing
      role,  and use of role switcher within course do *not* cause update 
      of last log-in for that user/role/section.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.274 loncom/auth/lonroles.pm:1.275
--- loncom/auth/lonroles.pm:1.274	Thu Aug 16 17:02:46 2012
+++ loncom/auth/lonroles.pm	Sun Aug 19 03:11:43 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.274 2012/08/16 17:02:46 raeburn Exp $
+# $Id: lonroles.pm,v 1.275 2012/08/19 03:11:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -291,8 +291,10 @@
                 if (my ($ccrole,$domain,$coursenum) =
 		    ($envkey =~ m-^form\.(cc|co)\./($match_domain)/($match_courseid)$-)) {
                     if ($dcroles{$domain}) {
-                        &Apache::lonnet::check_adhoc_privs($domain,$coursenum,
-                                                           $update,$refresh,$now,$ccrole);
+                        if (&Apache::lonnet::check_adhoc_privs($domain,$coursenum,
+                                                           $update,$refresh,$now,$ccrole)) {
+                            &Apache::lonnet::appenv({"environment.internal.$domain.$coursenum.$ccrole.adhoc" => time});
+                        }
                     }
                     last;
                 }
@@ -515,6 +517,12 @@
                         my $msg;
 			my ($furl,$ferr)=
 			    &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
+                        unless (($ferr) || ($env{'form.switchrole'}) ||
+                                ($env{"environment.internal.$cdom.$cnum.$role.adhoc"})) {
+                            &Apache::lonnet::put('nohist_crslastlogin',
+                                {$env{'user.name'}.':'.$env{'user.domain'}.
+                                ':'.$csec.':'.$role => $now},$cdom,$cnum);
+                        }
 			if (($env{'form.orgurl'}) && 
 			    ($env{'form.orgurl'}!~/^\/adm\/flip/)) {
 			    my $dest=$env{'form.orgurl'};




More information about the LON-CAPA-cvs mailing list