'.
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table();
return $output;
}
@@ -428,9 +450,12 @@ sub print_user_modification_page {
&print_username_entry_form($r,$usermsg);
return;
}
- my ($curr_authtype,$instsrch,$rulematch,$rules,%inst_results);
+ my %abv_auth = &auth_abbrev();
+ my ($curr_authtype,$instsrch,$rulematch,$rules,%inst_results,
+ $curr_kerb_ver,$newuser);
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
if ($uhome eq 'no_host') {
+ $newuser = 1;
$instsrch =
{
srchin => 'instd',
@@ -446,8 +471,15 @@ sub print_user_modification_page {
return;
}
} else {
- $curr_authtype =
+ $newuser = 0;
+ my $currentauth =
&Apache::lonnet::queryauthenticate($ccuname,$ccdomain);
+ if ($currentauth =~ /^(krb4|krb5|unix|internal|localauth):/) {
+ $curr_authtype = $abv_auth{$1};
+ if ($currentauth =~ /^krb(4|5)/) {
+ $curr_kerb_ver = $1;
+ }
+ }
}
if ($response) {
$response = ' '.$response
@@ -461,6 +493,7 @@ sub print_user_modification_page {
kerb_def_dom => $krbdefdom,
kerb_def_auth => $krbdef,
curr_authtype => $curr_authtype,
+ curr_kerb_ver => $curr_kerb_ver,
domain => $ccdomain,
);
$loginscript = &Apache::loncommon::authform_header(%param);
@@ -669,10 +702,17 @@ ENDSECCODE
$nondc_setsection_code,$groupslist);
my ($jsback,$elements) = &crumb_utilities();
-
+ my $javascript_validations;
+ if ((&Apache::lonnet::allowed('mau',$ccdomain)) || ($uhome eq 'no_host')) {
+ my ($krbdef,$krbdefdom) =
+ &Apache::loncommon::get_kerberos_defaults($ccdomain);
+ $javascript_validations =
+ &Apache::londropadd::javascript_validations('auth',$krbdefdom,undef,
+ undef,$ccdomain);
+ }
$js .= "\n".
- '';
-
+ '';
my $start_page =
&Apache::loncommon::start_page('Create Users, Change User Privileges',
$js,{'add_entries' => \%loaditem,});
@@ -696,8 +736,8 @@ ENDSECCODE
my $forminfo =<<"ENDFORMINFO";
".&Apache::loncommon::end_page());
}
+sub user_authentication {
+ my ($ccuname,$ccdomain,$krbdefdom,$abv_auth) = @_;
+ my $currentauth=&Apache::lonnet::queryauthenticate($ccuname,$ccdomain);
+ my ($loginscript,$outcome);
+ if ($currentauth=~/^(krb)(4|5):(.*)/) {
+ my $long_auth = $1.$2;
+ my $curr_kerb_ver = $2;
+ my $krbdefdom=$3;
+ my $curr_authtype = $abv_auth->{$long_auth};
+ my %param = ( formname => 'document.cu',
+ kerb_def_dom => $krbdefdom,
+ domain => $ccdomain,
+ curr_authtype => $curr_authtype,
+ curr_kerb_ver => $curr_kerb_ver,
+ );
+ $loginscript = &Apache::loncommon::authform_header(%param);
+ }
+ # Check for a bad authentication type
+ if ($currentauth !~ /^(krb4|krb5|unix|internal|localauth):/) {
+ # bad authentication scheme
+ my %lt=&Apache::lonlocal::texthash(
+ 'err' => "ERROR",
+ 'uuas' => "This user has an unrecognized authentication scheme",
+ 'adcs' => "Please alert a domain coordinator of this situation",
+ 'sldb' => "Please specify login data below",
+ 'ld' => "Login Data"
+ );
+ if (&Apache::lonnet::allowed('mau',$ccdomain)) {
+ &initialize_authen_forms($ccdomain);
+ my $choices = &set_login($ccdomain);
+ $outcome = <
+$loginscript
+
+$lt{'err'}:
+$lt{'uuas'} ($currentauth). $lt{'sldb'}.
+
$lt{'ld'}
+$choices
+ENDBADAUTH
+ } else {
+ # This user is not allowed to modify the user's
+ # authentication scheme, so just notify them of the problem
+ $outcome = < $lt{'err'}:
+$lt{'uuas'} ($currentauth). $lt{'adcs'}.
+
+ENDBADAUTH
+ }
+ } else { # Authentication type is valid
+ my $authformcurrent='';
+ my $authform_other='';
+ &initialize_authen_forms($ccdomain,$currentauth);
+ my ($authformcurrent,$authform_other,$can_modify) =
+ &modify_login_block($ccdomain,$currentauth);
+ if (&Apache::lonnet::allowed('mau',$ccdomain)) {
+ # Current user has login modification privileges
+ my %lt=&Apache::lonlocal::texthash (
+ 'ld' => "Login Data",
+ 'ccld' => "Change Current Login Data",
+ 'enld' => "Enter New Login Data"
+ );
+ $outcome =
+ ''."\n".
+ '
END
if ($putresult eq 'ok') {
if ($oldportfolioquota != $newportfolioquota) {
@@ -1894,20 +2004,28 @@ END
} # End of foreach (keys(%env))
# Flush the course logs so reverse user roles immediately updated
&Apache::lonnet::flushcourselogs();
- $r->print('