Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.267 and 1.267.4.5

version 1.267, 2002/08/13 14:37:52 version 1.267.4.5, 2002/09/03 01:29:35
Line 2137  sub modifyuserauth { Line 2137  sub modifyuserauth {
     my $uhome=&homeserver($uname,$udom);      my $uhome=&homeserver($uname,$udom);
     unless (&allowed('mau',$udom)) { return 'refused'; }      unless (&allowed('mau',$udom)) { return 'refused'; }
     &logthis('Call to modify user authentication '.$udom.', '.$uname.', '.      &logthis('Call to modify user authentication '.$udom.', '.$uname.', '.
              $umode.' by '.$ENV{'user.name'}.' at '.$ENV{'user.domain'});                 $umode.' by '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}.
                ' in domain '.$ENV{'request.role.domain'});  
     my $reply=&reply('encrypt:changeuserauth:'.$udom.':'.$uname.':'.$umode.':'.      my $reply=&reply('encrypt:changeuserauth:'.$udom.':'.$uname.':'.$umode.':'.
      &escape($upass),$uhome);       &escape($upass),$uhome);
     &log($ENV{'user.domain'},$ENV{'user.name'},$ENV{'user.home'},      &log($ENV{'user.domain'},$ENV{'user.name'},$ENV{'user.home'},
Line 2168  sub modifyuser { Line 2169  sub modifyuser {
      $last.', '.$gene.'(forceid: '.$forceid.')'.       $last.', '.$gene.'(forceid: '.$forceid.')'.
              (defined($desiredhome) ? ' desiredhome = '.$desiredhome :               (defined($desiredhome) ? ' desiredhome = '.$desiredhome :
                                      ' desiredhome not specified').                                        ' desiredhome not specified'). 
              ' by '.$ENV{'user.name'}.' at '.$ENV{'user.domain'});               ' by '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}.
                ' in domain '.$ENV{'request.role.domain'});
     my $uhome=&homeserver($uname,$udom,'true');      my $uhome=&homeserver($uname,$udom,'true');
 # ----------------------------------------------------------------- Create User  # ----------------------------------------------------------------- Create User
     if (($uhome eq 'no_host') && ($umode) && ($upass)) {      if (($uhome eq 'no_host') && ($umode) && ($upass)) {
Line 2428  sub dirlist { Line 2430  sub dirlist {
     }      }
 }  }
   
   # --------------------------------------------- GetFileTimestamp
   # This function utilizes dirlist and returns the date stamp for
   # when it was last modified.  It will also return an error of -1
   # if an error occurs
   
   sub GetFileTimestamp {
       my ($studentDomain,$studentName,$filename,$root)=@_;
       $studentDomain=~s/\W//g;
       $studentName=~s/\W//g;
       my $subdir=$studentName.'__';
       $subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/;
       my $proname="$studentDomain/$subdir/$studentName";
       $proname .= '/'.$filename;
       my @dir = &Apache::lonnet::dirlist($proname, $studentDomain, $studentName,
                                          $root);
       my $fileStat = $dir[0];
       my @stats = split('&', $fileStat);
       if($stats[0] ne 'empty' && $stats[0] ne 'no_such_dir') {
           return $stats[9];
       } else {
           return -1;
       }
   }
   
 # -------------------------------------------------------- Value of a Condition  # -------------------------------------------------------- Value of a Condition
   
 sub directcondval {  sub directcondval {
Line 2720  sub metadata { Line 2746  sub metadata {
 # Look at timestamp of caching  # Look at timestamp of caching
 # Everything is cached by the main uri, libraries are never directly cached  # Everything is cached by the main uri, libraries are never directly cached
 #  #
     unless (abs($metacache{$uri.':cachedtimestamp'}-time)<600) {      unless (abs($metacache{$uri.':cachedtimestamp'}-time)<600 && !defined($liburi)) {
 #  #
 # Is this a recursive call for a library?  # Is this a recursive call for a library?
 #  #
Line 2743  sub metadata { Line 2769  sub metadata {
       my $package=$token->[2]->{'package'};        my $package=$token->[2]->{'package'};
       my $keyroot='';        my $keyroot='';
               if ($prefix) {                if ($prefix) {
   $keyroot.='_'.$prefix;    $keyroot.=$prefix;
               } else {                } else {
                 if (defined($token->[2]->{'part'})) {                   if (defined($token->[2]->{'part'})) { 
                    $keyroot.='_'.$token->[2]->{'part'};                      $keyroot.='_'.$token->[2]->{'part'}; 
Line 2801  sub metadata { Line 2827  sub metadata {
 #  #
 # Importing a library here  # Importing a library here
 #                  #                
  if (defined($depthcount)) { $depthcount++; } else   
                                            { $depthcount=0; }  
                  if ($depthcount<20) {                   if ($depthcount<20) {
      foreach (split(/\,/,&metadata($uri,'keys',       my $location=$parser->get_text('/import');
                                   $parser->get_text('/import'),$unikey,       my $dir=$filename;
                                   $depthcount))) {       $dir=~s|[^/]*$||;
        $location=&filelocation($dir,$location);
        foreach (sort(split(/\,/,&metadata($uri,'keys',
    $location,$unikey,
    $depthcount+1)))) {
                          $metathesekeys{$_}=1;                           $metathesekeys{$_}=1;
      }       }
  }   }
Line 2831  sub metadata { Line 2859  sub metadata {
 # the next is the end of "start tag"  # the next is the end of "start tag"
  }   }
        }         }
  &metadata_generate_part0(\%metathesekeys,\%metacache,$uri);  
        $metacache{$uri.':keys'}=join(',',keys %metathesekeys);         $metacache{$uri.':keys'}=join(',',keys %metathesekeys);
    &metadata_generate_part0(\%metathesekeys,\%metacache,$uri);
          $metacache{$uri.':allpossiblekeys'}=join(',',keys %metathesekeys);
        $metacache{$uri.':cachedtimestamp'}=time;         $metacache{$uri.':cachedtimestamp'}=time;
 # this is the end of "was not already recently cached  # this is the end of "was not already recently cached
     }      }

Removed from v.1.267  
changed lines
  Added in v.1.267.4.5


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