Diff for /loncom/interface/loncommon.pm between versions 1.1027 and 1.1028

version 1.1027, 2011/11/02 23:05:07 version 1.1028, 2011/11/14 00:20:34
Line 4532  sub designparm { Line 4532  sub designparm {
   
 =item * &authorspace()  =item * &authorspace()
   
 Inputs: ./.  Inputs: $url (usually will be undef).
   
 Returns: Path to the Construction Space of the current user's  Returns: Path to Construction Space containing the resource or 
          accessed author space           directory being viewed (or for which action is being taken). 
          The author space will be that of the current user           If $url is provided, and begins /priv/<domain>/<uname>
          when accessing the own author space           the path will be that portion of the $context argument.
          and that of the co-author/assistent co-author           Otherwise the path will be for the author space of the current
          when accessing the co-author's/assistent co-author's           user when the current role is author, or for that of the 
          space           co-author/assistant co-author space when the current role 
            is co-author or assistant co-author.
   
 =cut  =cut
   
 sub authorspace {  sub authorspace {
       my ($url) = @_;
       if ($url ne '') {
           if ($url =~ m{^(/priv/$match_domain/$match_username/)}) {
              return $1;
           }
       }
     my $caname = '';      my $caname = '';
     my $cadom = '';      my $cadom = '';
     if ($env{'request.role'} =~ /^ca|^aa/) {      if ($env{'request.role'} =~ /^(?:ca|aa)/) {
         ($cadom,$caname) =          ($cadom,$caname) =
             ($env{'request.role'}=~/($match_domain)\/($match_username)$/);              ($env{'request.role'}=~/($match_domain)\/($match_username)$/);
     } else {      } elsif ($env{'request.role'} =~ m{^au\./($match_domain)/}) {
         $caname = $env{'user.name'};          $caname = $env{'user.name'};
         $cadom = $env{'user.domain'};          $cadom = $env{'user.domain'};
     }      }
     return '/priv/'.$cadom.'/'.$caname.'/';      if (($caname ne '') && ($cadom ne '')) {
           return "/priv/$cadom/$caname/";
       }
       return;
 }  }
   
 ##############################################  ##############################################

Removed from v.1.1027  
changed lines
  Added in v.1.1028


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