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

raeburn raeburn at source.lon-capa.org
Fri May 10 16:26:22 EDT 2013


raeburn		Fri May 10 20:26:22 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonroles.pm 
  Log:
  - For 2.11
    - Backport 1.282, 1.283, 1.284, 1.285.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.269.2.7 loncom/auth/lonroles.pm:1.269.2.8
--- loncom/auth/lonroles.pm:1.269.2.7	Fri Jan  4 04:08:34 2013
+++ loncom/auth/lonroles.pm	Fri May 10 20:26:22 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.269.2.7 2013/01/04 04:08:34 raeburn Exp $
+# $Id: lonroles.pm,v 1.269.2.8 2013/05/10 20:26:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -139,6 +139,7 @@
 use Apache::lonnavdisplay();
 use Apache::loncoursequeueadmin;
 use Apache::longroup;
+use Apache::lonrss;
 use GDBM_File;
 use LONCAPA qw(:DEFAULT :match);
 use HTML::Entities;
@@ -316,6 +317,7 @@
                             my $trolecode = 'au./'.$domain.'/';
                             my $switchserver = '/adm/switchserver?otherserver='.$home.'&role='.$trolecode;
                             $r->internal_redirect($switchserver);
+                            return OK;
                         }
                         last;
                     }
@@ -327,6 +329,7 @@
                                 my $trolecode = 'ca./'.$domain.'/'.$user;
                                 my $switchserver = '/adm/switchserver?otherserver='.$home.'&role='.$trolecode;
                                 $r->internal_redirect($switchserver);
+                                return OK;
                             }
                             last;
                         }
@@ -348,6 +351,7 @@
                                 my $switchserver = '/adm/switchserver?'
                                                   .'otherserver='.$home.'&role='.$trolecode;
                                 $r->internal_redirect($switchserver);
+                                return OK;
                             }
                         } else {
                             delete($env{$envkey});
@@ -522,13 +526,28 @@
 
 		    if (($cnum) && ($role ne 'ca') && ($role ne 'aa')) {
                         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);
+                        my ($furl,$ferr)=
+                            &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
+                        unless ($ferr) {
+                            unless (($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);
+                            }
+                            my ($feeds,$syllabus_time);
+                            &Apache::lonrss::advertisefeeds($cnum,$cdom,undef,\$feeds);
+                            &Apache::lonnet::appenv({'request.course.feeds' => $feeds});
+                            unless ($env{'course.'.$cdom.'_'.$cnum.'.updatedsyllabus'}) {
+                                unless (($env{'course.'.$cdom.'_'.$cnum.'.externalsyllabus'}) ||
+                                        ($env{'course.'.$cdom.'_'.$cnum.'.uploadedsyllabus'})) {
+                                    my %syllabus=&Apache::lonnet::dump('syllabus',$cdom,$cnum);
+                                    $syllabus_time = $syllabus{'uploaded.lastmodified'};
+                                    if ($syllabus_time) {
+                                        &Apache::lonnet::appenv({'request.course.syllabustime' => $syllabus_time});
+                                    }
+                                }
+                            }
                         }
 			if (($env{'form.orgurl'}) && 
 			    ($env{'form.orgurl'}!~/^\/adm\/flip/)) {
@@ -2551,7 +2570,8 @@
     my ($item,$update,$refresh,$now) = @_;
     my ($where,$trolecode,$role,$tstatus,$tend,$tstart,$twhere,
         $trole,$tremark);
-    &Apache::lonnet::role_status('user.role.'.$item,$update,$refresh,                                      $now,\$role,\$where, \$trolecode,
+    &Apache::lonnet::role_status('user.role.'.$item,$update,$refresh,
+                                 $now,\$role,\$where,\$trolecode,
                                  \$tstatus,\$tstart,\$tend);
     if ($role =~ /^cr\//) {
         my ($rdummy,$rdomain,$rauthor,$rrole)=split(/\//,$role);




More information about the LON-CAPA-cvs mailing list