--- loncom/interface/loncreateuser.pm 2002/08/22 21:22:30 1.39.2.1 +++ loncom/interface/loncreateuser.pm 2002/08/21 17:18:08 1.40 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.39.2.1 2002/08/22 21:22:30 albertel Exp $ +# $Id: loncreateuser.pm,v 1.40 2002/08/21 17:18:08 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,7 +47,7 @@ # 11/12,11/13,11/15 Scott Harrison # 02/11/02 Matthew Hall # -# $Id: loncreateuser.pm,v 1.39.2.1 2002/08/22 21:22:30 albertel Exp $ +# $Id: loncreateuser.pm,v 1.40 2002/08/21 17:18:08 www Exp $ ### package Apache::loncreateuser; @@ -87,13 +87,14 @@ sub phase_one { my $defdom=$ENV{'user.domain'}; my @domains = &Apache::loncommon::get_domains(); my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain'); + my $bodytag =&Apache::loncommon::bodytag( + 'Create Users, Change User Privileges'); $r->print(<<"ENDDOCUMENT"); The LearningOnline Network with CAPA - -

Create User, Change User Privileges

+$bodytag

@@ -154,9 +155,9 @@ sub phase_two { - - ENDDOCHEAD + $r->print(&Apache::loncommon::bodytag( + 'Create Users, Change User Privileges')); my $forminfo =<<"ENDFORMINFO"; @@ -328,8 +329,8 @@ END $r->print(''); } # End of unless my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain); - if ($currentauth=~/^krb(4|5):/) { - $currentauth=~/^krb(4|5):(.*)/; + if ($currentauth=~/^krb4:/) { + $currentauth=~/^krb4:(.*)/; my $krbdefdom2=$1; my %param = ( formname => 'document.cu', kerb_def_dom => $krbdefdom @@ -337,7 +338,7 @@ END $loginscript = &Apache::loncommon::authform_header(%param); } # Check for a bad authentication type - unless ($currentauth=~/^krb(4|5):/ or + unless ($currentauth=~/^krb4:/ or $currentauth=~/^unix:/ or $currentauth=~/^internal:/ or $currentauth=~/^localauth:/ @@ -375,7 +376,7 @@ ENDBADAUTH } else { # Authentication type is valid my $authformcurrent=''; my $authform_other=''; - if ($currentauth=~/^krb(4|5):/) { + if ($currentauth=~/^krb4:/) { $authformcurrent=$authformkrb; $authform_other="

$authformint

\n". "

$authformfsys

$authformloc

"; @@ -498,9 +499,14 @@ sub phase_three { The LearningOnline Network with CAPA - - ENDTHREEHEAD + my $title; + if (exists($ENV{'form.makeuser'})) { + $title='Set Privileges for New User'; + } else { + $title='Modify User Privileges'; + } + $r->print(&Apache::loncommon::bodytag($title)); # Check Inputs if (! $ENV{'form.ccuname'} ) { $r->print($error.'No login name specified.'.$end); @@ -535,8 +541,7 @@ ENDTHREEHEAD my $amode=''; my $genpwd=''; if ($ENV{'form.login'} eq 'krb') { - $amode='krb'; - $amode.=$ENV{'form.krbver'}; + $amode='krb4'; $genpwd=$ENV{'form.krbarg'}; } elsif ($ENV{'form.login'} eq 'int') { $amode='internal'; @@ -561,7 +566,6 @@ ENDTHREEHEAD if ($ENV{'form.makeuser'}) { # Create a new user $r->print(<Create User

Creating user "$ENV{'form.ccuname'}" in domain "$ENV{'form.ccdomain'}"

ENDNEWUSERHEAD # Check for the authentication mode and password @@ -597,7 +601,6 @@ ENDNEWUSERHEAD ($ENV{'form.login'} ne '' )) { # Modify user privileges $r->print(<Change User Privileges

User "$ENV{'form.ccuname'}" in domain "$ENV{'form.ccdomain'}"

ENDMODIFYUSERHEAD if (! $amode || ! $genpwd) {