Diff for /loncom/interface/lonparmset.pm between versions 1.350 and 1.350.2.3

version 1.350, 2006/12/05 02:55:53 version 1.350.2.3, 2006/12/14 20:50:25
Line 122  sub parmval_by_symb { Line 122  sub parmval_by_symb {
 # load caches  # load caches
     &cacheparmhash();      &cacheparmhash();
   
     my $useropt=&Apache::lonnet::get_userresdata($uname,$udom);      my $useropt;
       if ($uname ne '' && $udom ne '') {
    $useropt = &Apache::lonnet::get_userresdata($uname,$udom);
       }
   
     my $result='';      my $result='';
     my @outpar=();      my @outpar=();
Line 173  sub parmval_by_symb { Line 176  sub parmval_by_symb {
     }      }
   
 # ------------------------------------------------------ fourth, back to course  # ------------------------------------------------------ fourth, back to course
     if (defined($csec)) {      if ($csec ne '') {
         if (defined($$courseopt{$seclevel})) {          if (defined($$courseopt{$seclevel})) {
     $outpar[9]=$$courseopt{$seclevel};      $outpar[9]=$$courseopt{$seclevel};
     $result=9;      $result=9;
Line 189  sub parmval_by_symb { Line 192  sub parmval_by_symb {
  }   }
     }      }
 # ------------------------------------------------------ fifth, check course group  # ------------------------------------------------------ fifth, check course group
     if (defined($cgroup)) {      if ($cgroup ne '') {
         if (defined($$courseopt{$grplevel})) {          if (defined($$courseopt{$grplevel})) {
             $outpar[6]=$$courseopt{$grplevel};              $outpar[6]=$$courseopt{$grplevel};
             $result=6;              $result=6;
Line 206  sub parmval_by_symb { Line 209  sub parmval_by_symb {
   
 # ---------------------------------------------------------- fifth, check user  # ---------------------------------------------------------- fifth, check user
   
     if (defined($uname)) {      if ($uname ne '') {
  if (defined($$useropt{$courselevel})) {   if (defined($$useropt{$courselevel})) {
     $outpar[3]=$$useropt{$courselevel};      $outpar[3]=$$useropt{$courselevel};
     $result=3;      $result=3;
Line 269  sub resetrulescache { Line 272  sub resetrulescache {
   
 sub rulescache {  sub rulescache {
     my $id=shift;      my $id=shift;
     if ($rulesid ne $env{'request.course.id'}) {      if ($rulesid ne $env{'request.course.id'}
  %rules=();   && !defined($rules{$id})) {
     }  
     unless (defined($rules{$id})) {  
  my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};   my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
  my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};   my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
  %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);   %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);
Line 3835  sub parm_change_log { Line 3836  sub parm_change_log {
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
 }  }
   
   sub check_for_course_info {
       my $navmap = Apache::lonnavmaps::navmap->new();
       return 1 if ($navmap);
       return 0;
   }
   
 ##################################################  ##################################################
 ##################################################  ##################################################
   
Line 3878  sub handler { Line 3885  sub handler {
  (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) ||   (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) ||
  &Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.   &Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.
   $env{'request.course.sec'}));    $env{'request.course.sec'}));
     if ($env{'request.course.id'} &&  $parm_permission) {      my $exists = &check_for_course_info();
   
       if ($env{'request.course.id'} &&  $parm_permission && $exists) {
   
         # Start Page          # Start Page
         &Apache::loncommon::content_type($r,'text/html');          &Apache::loncommon::content_type($r,'text/html');
Line 3948  sub handler { Line 3957  sub handler {
  }          }       
     } else {      } else {
 # ----------------------------- Not in a course, or not allowed to modify parms  # ----------------------------- Not in a course, or not allowed to modify parms
  $env{'user.error.msg'}=   if ($exists) {
     "/adm/parmset:opa:0:0:Cannot modify assessment parameters";      $env{'user.error.msg'}=
    "/adm/parmset:opa:0:0:Cannot modify assessment parameters";
    } else {
       $env{'user.error.msg'}=
    "/adm/parmset::0:1:Course environment gone, reinitialize the course";
    }
  return HTTP_NOT_ACCEPTABLE;   return HTTP_NOT_ACCEPTABLE;
     }      }
     return OK;      return OK;

Removed from v.1.350  
changed lines
  Added in v.1.350.2.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>