version 1.31, 2002/04/15 23:37:37
|
version 1.32, 2002/04/22 15:26:46
|
Line 143 BEGIN {
|
Line 143 BEGIN {
|
"<font color=yellow>INFO: Read file types and thesaurus</font>"); |
"<font color=yellow>INFO: Read file types and thesaurus</font>"); |
$readit=1; |
$readit=1; |
} |
} |
|
|
} |
} |
# ============================================================= END BEGIN BLOCK |
# ============================================================= END BEGIN BLOCK |
|
|
|
############################################################### |
|
## Authentication changing form generation subroutines ## |
|
############################################################### |
|
## |
|
## All of the authform_xxxxxxx subroutines take their inputs in a |
|
## hash, and have reasonable default values. |
|
## |
|
## formname = the name given in the <form> tag. |
|
sub authform_header{ |
|
my %in = ( |
|
formname => 'cu', |
|
kerb_def_dom => 'MSU.EDU', |
|
@_, |
|
); |
|
$in{'formname'} = 'document.' . $in{'formname'}; |
|
my $result=''; |
|
$result.=<<"END"; |
|
var current = new Object(); |
|
current.radiovalue = 'nochange'; |
|
current.argfield = null; |
|
|
|
function changed_radio(choice,currentform) { |
|
var choicearg = choice + 'arg'; |
|
// If a radio button in changed, we need to change the argfield |
|
if (current.radiovalue != choice) { |
|
current.radiovalue = choice; |
|
if (current.argfield != null) { |
|
currentform.elements[current.argfield].value = ''; |
|
} |
|
if (choice == 'nochange') { |
|
current.argfield = null; |
|
} else { |
|
current.argfield = choicearg; |
|
switch(choice) { |
|
case 'krb': |
|
currentform.elements[current.argfield].value = |
|
"$in{'kerb_def_dom'}"; |
|
break; |
|
default: |
|
break; |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function changed_text(choice,currentform) { |
|
var choicearg = choice + 'arg'; |
|
if (currentform.elements[choicearg].value !='') { |
|
switch (choice) { |
|
case 'krb': currentform.elements[choicearg].value = |
|
currentform.elements[choicearg].value.toUpperCase(); |
|
break; |
|
default: |
|
} |
|
// clear old field |
|
if ((current.argfield != choicearg) && (current.argfield != null)) { |
|
currentform.elements[current.argfield].value = ''; |
|
} |
|
current.argfield = choicearg; |
|
} |
|
set_auth_radio_buttons(choice,currentform); |
|
return; |
|
} |
|
|
|
function set_auth_radio_buttons(newvalue,currentform) { |
|
var i=0; |
|
while (i < currentform.login.length) { |
|
if (currentform.login[i].value == newvalue) { break; } |
|
i++; |
|
} |
|
if (i == currentform.login.length) { |
|
return; |
|
} |
|
current.radiovalue = newvalue; |
|
currentform.login[i].checked = true; |
|
return; |
|
} |
|
END |
|
return $result; |
|
} |
|
|
|
sub authform_authorwarning{ |
|
my $result=''; |
|
$result=<<"END"; |
|
<i>As a general rule, only authors or co-authors should be filesystem |
|
authenticated (which allows access to the server filesystem).</i> |
|
END |
|
return $result; |
|
} |
|
|
|
sub authform_nochange{ |
|
my %in = ( |
|
formname => 'document.cu', |
|
kerb_def_dom => 'MSU.EDU', |
|
@_, |
|
); |
|
my $result=''; |
|
$result.=<<"END"; |
|
<input type="radio" name="login" value="nochange" checked="checked" |
|
onclick="javascript:changed_radio('nochange',$in{'formname'});"> |
|
Do not change login data |
|
END |
|
return $result; |
|
} |
|
|
|
sub authform_kerberos{ |
|
my %in = ( |
|
formname => 'document.cu', |
|
kerb_def_dom => 'MSU.EDU', |
|
@_, |
|
); |
|
my $result=''; |
|
$result.=<<"END"; |
|
<input type="radio" name="login" value="krb" |
|
onclick="javascript:changed_radio('krb',$in{'formname'});" |
|
onchange="javascript:changed_radio('krb',$in{'formname'});"> |
|
Kerberos authenticated with domain |
|
<input type="text" size="10" name="krbarg" value="" |
|
onchange="javascript:changed_text('krb',$in{'formname'});"> |
|
END |
|
return $result; |
|
} |
|
|
|
sub authform_internal{ |
|
my %args = ( |
|
formname => 'document.cu', |
|
kerb_def_dom => 'MSU.EDU', |
|
@_, |
|
); |
|
my $result=''; |
|
$result.=<<"END"; |
|
<input type="radio" name="login" value="int" |
|
onchange="javascript:changed_radio('int',$args{'formname'});" |
|
onclick="javascript:changed_radio('int',$args{'formname'});"> |
|
Internally authenticated (with initial password |
|
<input type="text" size="10" name="intarg" value="" |
|
onchange="javascript:changed_text('int',$args{'formname'});"> |
|
END |
|
return $result; |
|
} |
|
|
|
sub authform_local{ |
|
my %in = ( |
|
formname => 'document.cu', |
|
kerb_def_dom => 'MSU.EDU', |
|
@_, |
|
); |
|
my $result=''; |
|
$result.=<<"END"; |
|
<input type="radio" name="login" value="loc" |
|
onchange="javascript:changed_radio('loc',$in{'formname'});" |
|
onclick="javascript:changed_radio('loc',$in{'formname'});"> |
|
Local Authentication with argument |
|
<input type="text" size="10" name="locarg" value="" |
|
onchange="javascript:changed_text('loc',$in{'formname'});"> |
|
END |
|
return $result; |
|
} |
|
|
|
sub authform_filesystem{ |
|
my %in = ( |
|
formname => 'document.cu', |
|
kerb_def_dom => 'MSU.EDU', |
|
@_, |
|
); |
|
my $result=''; |
|
$result.=<<"END"; |
|
<input type="radio" name="login" value="fsys" |
|
onchange="javascript:changed_radio('fsys',$in{'formname'});" |
|
onclick="javascript:changed_radio('fsys',$in{'formname'});"> |
|
Filesystem authenticated (with initial password |
|
<input type="text" size="10" name="fsysarg" value="" |
|
onchange="javascript:changed_text('fsys',$in{'formname'});"> |
|
END |
|
return $result; |
|
} |
|
|
|
############################################################### |
|
## End Authentication changing form generation functions ## |
|
############################################################### |
|
|
|
|
|
|
# ---------------------------------------------------------- Is this a keyword? |
# ---------------------------------------------------------- Is this a keyword? |
|
|
Line 566 sub csv_print_select_table {
|
Line 749 sub csv_print_select_table {
|
$r->print('<tr><td>'.$display.'</td>'); |
$r->print('<tr><td>'.$display.'</td>'); |
|
|
$r->print('<td><select name=f'.$i. |
$r->print('<td><select name=f'.$i. |
' onChange="flip(this.form,'.$i.');">'); |
' onchange="javascript:flip(this.form,'.$i.');">'); |
$r->print('<option value="none"></option>'); |
$r->print('<option value="none"></option>'); |
foreach (sort({$a <=> $b} keys(%sone))) { |
foreach (sort({$a <=> $b} keys(%sone))) { |
$r->print('<option value="'.$_.'">Column '.($_+1).'</option>'); |
$r->print('<option value="'.$_.'">Column '.($_+1).'</option>'); |
Line 595 sub csv_samples_select_table {
|
Line 778 sub csv_samples_select_table {
|
|
|
foreach (sort keys %sone) { |
foreach (sort keys %sone) { |
$r->print('<tr><td><select name=f'.$i. |
$r->print('<tr><td><select name=f'.$i. |
' onChange="flip(this.form,'.$i.');">'); |
' onchange="javascript:flip(this.form,'.$i.');">'); |
foreach (@$d) { |
foreach (@$d) { |
my ($value,$display)=@{ $_ }; |
my ($value,$display)=@{ $_ }; |
$r->print('<option value='.$value.'>'.$display.'</option>'); |
$r->print('<option value='.$value.'>'.$display.'</option>'); |