version 1.91.2.1, 2004/01/21 00:23:30
|
version 1.91.2.2, 2004/01/21 00:29:56
|
Line 240 sub print_upload_manager_header {
|
Line 240 sub print_upload_manager_header {
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
sub javascript_validations { |
sub javascript_validations { |
my ($mode,$krbdefdom)=@_; |
my ($mode,$krbdefdom,$curr_authtype,$curr_authfield)=@_; |
my $authheader; |
my $authheader; |
if ($mode eq 'auth') { |
if ($mode eq 'auth') { |
my %param = ( formname => 'studentform', |
my %param = ( formname => 'studentform', |
Line 250 sub javascript_validations {
|
Line 250 sub javascript_validations {
|
my %param = ( formname => 'ccrs', |
my %param = ( formname => 'ccrs', |
kerb_def_dom => $krbdefdom ); |
kerb_def_dom => $krbdefdom ); |
$authheader = &Apache::loncommon::authform_header(%param); |
$authheader = &Apache::loncommon::authform_header(%param); |
|
} elsif ($mode eq 'modifycourse') { |
|
my %param = ( formname => 'cmod', |
|
kerb_def_dom => $krbdefdom, |
|
mode => 'modifycourse', |
|
curr_authtype => $curr_authtype, |
|
curr_autharg => $curr_authfield ); |
|
$authheader = &Apache::loncommon::authform_header(%param); |
} |
} |
|
|
|
|
my %alert = &Apache::lonlocal::texthash |
my %alert = &Apache::lonlocal::texthash |
(username => 'You need to specify the username field.', |
(username => 'You need to specify the username field.', |
Line 268 sub javascript_validations {
|
Line 276 sub javascript_validations {
|
my $function_name =(<<END); |
my $function_name =(<<END); |
function verify_message (vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail) { |
function verify_message (vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail) { |
END |
END |
my $auth_checks = (<<END); |
my $auth_checks; |
var foundatype=0; |
if ($mode eq 'createcourse') { |
|
$auth_checks .= (<<END); |
|
if (vf.autoadds[0].checked == true) { |
|
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
|
alert('$alert{'authen'}'); |
|
return; |
|
} |
|
} |
END |
END |
unless ($mode eq 'createcourse') { |
} else { |
$auth_checks .= (<<END); |
$auth_checks .= (<<END); |
|
var foundatype=0; |
if (founduname==0) { |
if (founduname==0) { |
alert('$alert{'username'}'); |
alert('$alert{'username'}'); |
return; |
return; |
} |
} |
END |
|
} |
|
$auth_checks .= (<<END); |
|
// alert('current.radiovalue = '+current.radiovalue); |
// alert('current.radiovalue = '+current.radiovalue); |
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
// They did not check any of the login radiobuttons. |
// They did not check any of the login radiobuttons. |
alert('$alert{'authen'}'); |
alert('$alert{'authen'}'); |
return; |
return; |
} |
} |
|
END |
|
} |
|
if ($mode eq 'createcourse') { |
|
$auth_checks .= " |
|
if ( (vf.autoadds[0].checked == true) && |
|
(vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '') ) { |
|
"; |
|
} elsif ($mode eq 'modifycourse') { |
|
$auth_checks .= " |
|
if (vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '') { |
|
"; |
|
} |
|
if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
|
$auth_checks .= (<<END); |
|
var alertmsg = ''; |
|
switch (current.radiovalue) { |
|
case 'krb': |
|
alertmsg = '$alert{'krb'}'; |
|
break; |
|
default: |
|
alertmsg = ''; |
|
} |
|
if (alertmsg != '') { |
|
alert(alertmsg); |
|
return; |
|
} |
|
} |
|
END |
|
} else { |
|
$auth_checks .= (<<END); |
foundatype=1; |
foundatype=1; |
if (current.argfield == null || current.argfield == '') { |
if (current.argfield == null || current.argfield == '') { |
var alertmsg = ''; |
var alertmsg = ''; |
Line 309 END
|
Line 352 END
|
} |
} |
} |
} |
END |
END |
|
} |
my $optional_checks = ''; |
my $optional_checks = ''; |
if ($mode eq 'createcourse') { |
if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
$optional_checks = (<<END); |
$optional_checks = (<<END); |
vf.submit(); |
vf.submit(); |
} |
} |
Line 353 END
|
Line 397 END
|
END |
END |
} |
} |
my $result = $function_name; |
my $result = $function_name; |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) { |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
$result .= $auth_checks; |
$result .= $auth_checks; |
} |
} |
$result .= $optional_checks; |
$result .= $optional_checks; |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) { |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
$result .= $authheader; |
$result .= $authheader; |
} |
} |
return $result; |
return $result; |