--- loncom/interface/loncommon.pm 2009/05/28 15:19:54 1.831 +++ loncom/interface/loncommon.pm 2009/05/28 16:54:29 1.832 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.831 2009/05/28 15:19:54 bisitz Exp $ +# $Id: loncommon.pm,v 1.832 2009/05/28 16:54:29 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4181,6 +4181,34 @@ sub designparm { } ############################################## +=pod + +=item * &authorspace() + +Inputs: ./. + +Returns: Path to the Construction Space of the current user's + accessed author space + The author space will be that of the current user + when accessing the own author space + and that of the co-author/assistent co-author + when accessing the co-author's/assistent co-author's + space + +=cut + +sub authorspace { + my $caname = ''; + if ($env{'request.role'} =~ /^ca|^aa/) { + (undef,$caname) = + ($env{'request.role'}=~/($match_domain)\/($match_username)$/); + } else { + $caname = $env{'user.name'}; + } + return '/priv/'.$caname.'/'; +} + +############################################## =pod =item * &head_subbox()