--- loncom/interface/loncreateuser.pm 2005/01/11 22:08:08 1.97 +++ loncom/interface/loncreateuser.pm 2006/12/01 21:52:29 1.141 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.97 2005/01/11 22:08:08 albertel Exp $ +# $Id: loncreateuser.pm,v 1.141 2006/12/01 21:52:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,6 +64,9 @@ use Apache::Constants qw(:common :http); use Apache::lonnet; use Apache::loncommon; use Apache::lonlocal; +use Apache::longroup; +use lib '/home/httpd/lib/perl/'; +use LONCAPA qw(:DEFAULT :match); my $loginscript; # piece of javascript used in two separate instances my $generalrule; @@ -96,8 +99,8 @@ sub initialize_authen_forms { sub my_custom_roles { my %returnhash=(); my %rolehash=&Apache::lonnet::dump('roles'); - foreach (keys %rolehash) { - if ($_=~/^rolesdef\_(\w+)$/) { + foreach my $key (keys %rolehash) { + if ($key=~/^rolesdef\_(\w+)$/) { $returnhash{$1}=$1; } } @@ -108,22 +111,37 @@ sub my_custom_roles { sub authorpriv { my ($auname,$audom)=@_; - if (($auname ne $ENV{'user.name'}) || - (($audom ne $ENV{'user.domain'}) && - ($audom ne $ENV{'request.role.domain'}))) { return ''; } - unless (&Apache::lonnet::allowed('cca',$audom)) { return ''; } + unless ((&Apache::lonnet::allowed('cca',$audom.'/'.$auname)) + || (&Apache::lonnet::allowed('caa',$audom.'/'.$auname))) { return ''; } return 1; } +# ==================================================== + +sub portfolio_quota { + my ($ccuname,$ccdomain) = @_; + my %lt = &Apache::lonlocal::texthash( + 'disk' => "Disk space allocated to user's portfolio files", + ); + my $output = '