--- loncom/interface/loncreateuser.pm	2008/01/20 01:24:16	1.231
+++ loncom/interface/loncreateuser.pm	2008/01/20 01:40:37	1.232
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.231 2008/01/20 01:24:16 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.232 2008/01/20 01:40:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1636,6 +1636,27 @@ sub update_user_data {
 	$r->print(&mt('Generating user').': '.$result);
         $uhome = &Apache::lonnet::homeserver($env{'form.ccuname'},
                                                $env{'form.ccdomain'});
+        if (($uhome ne 'no_host') && ($env{'form.customquota'} == 1)) {
+            my (%changeHash,$newportfolioquota);
+            if ($env{'form.portfolioquota'} eq '') {
+                $newportfolioquota = 0;
+            } else {
+                $newportfolioquota = $env{'form.portfolioquota'};
+                $newportfolioquota =~ s/[^\d\.]//g;
+            }
+            my $quotachanged = &quota_admin($newportfolioquota,\%changeHash);
+            if ($quotachanged) {
+                $changeHash{'firstname'}  = $env{'form.cfirstname'};
+                $changeHash{'middlename'} = $env{'form.cmiddlename'};
+                $changeHash{'lastname'}   = $env{'form.clastname'};
+                $changeHash{'generation'} = $env{'form.cgeneration'};
+                $changeHash{'id'}         = $env{'form.cid'};
+                $changeHash{'permanentemail'} = $env{'form.cpermanentemail'};
+                my $quotachgresult =
+                    &Apache::lonnet::put('environment',\%changeHash,
+                                         $env{'form.ccdomain'},$env{'form.ccuname'});
+            }
+        }
         $r->print('<br />'.&mt('Home server').': '.$uhome.' '.
                   &Apache::lonnet::hostname($uhome));
     } elsif (($env{'form.login'} ne 'nochange') &&