version 1.52, 2007/04/03 22:13:40
|
version 1.54, 2007/04/20 18:14:26
|
Line 47 $|=1;
|
Line 47 $|=1;
|
********************************************* |
********************************************* |
|
|
END |
END |
sleep(3); |
#sleep(3); |
</perlscript> |
</perlscript> |
</file> |
</file> |
<file> |
<file> |
Line 705 This is now the current configuration of
|
Line 705 This is now the current configuration of
|
12) Everything is correct up above |
12) Everything is correct up above |
END |
END |
|
|
my $error=''; |
my @error; |
foreach my $v ($perlvar{'lonDefDomain'},$perlvar{'lonHostID'}) { |
foreach my $v ($perlvar{'lonDefDomain'},$perlvar{'lonHostID'}) { |
if (length($v)>35) { $error.="\nName $v too long"; } |
if (length($v)>35) { $error.="\nName $v too long"; } |
if (length($v)<2) { $error.="\nName $v too short"; } |
if (length($v)<2) { $error.="\nName $v too short"; } |
if ($v=~/capa/i) { |
if ($v=~/capa/i) { |
if ($v!~/^oucapa\d+$/ && |
if ($v!~/^oucapa\d+$/ && |
($v!~/^capa\d+$/ && $perlvar{'lonDefDomain'} eq 'uwsp')) { |
($v!~/^capa\d+$/ && $perlvar{'lonDefDomain'} eq 'uwsp')) { |
$error.="\nName $v contains 'capa'"; |
push(@error,"Name $v contains 'capa'"); |
} |
} |
} |
} |
foreach my $bad ('res','raw','userfiles','priv','adm','uploaded', |
foreach my $bad ('res','raw','userfiles','priv','adm','uploaded', |
'editupload') { |
'editupload') { |
$error.="\nName $v reserved." if $v eq $bad; |
push(@error,"\nName $v reserved.") if $v eq $bad; |
} |
} |
if ($v=~/[^\w\-.]/) { $error.="\nName $v contains special characters"; } |
if ($v=~/[^\w\-.]/) { push(@error,"Name $v contains special characters"); } |
} |
} |
if ($domainDescription!~/^[\(\)\-\w\s,]+$/) { |
if ($domainDescription =~ /^\s*$/) { |
$error.="\nDomain Description contains special characters"; |
push(@error,"Domain Description is blank."); |
|
} elsif ($domainDescription!~/^[\(\)\-\w\s,]+$/) { |
|
push(@error,"Domain Description contains special characters."); |
} |
} |
foreach my $v ($perlvar{'lonExpire'},$perlvar{'lonLoadLim'}) { |
foreach my $v ($perlvar{'lonExpire'},$perlvar{'lonLoadLim'}) { |
unless ($v=~/^[\d+\.]+$/) { $error.="\nNumber expected instead of $v"; } |
unless ($v=~/^[\d+\.]+$/) { push(@error,"Number expected instead of $v"); } |
} |
} |
unless (($perlvar{'lonRole'} eq 'library') || ($perlvar{'lonRole'} eq 'access')) { |
unless (($perlvar{'lonRole'} eq 'library') || ($perlvar{'lonRole'} eq 'access')) { |
$error.="\nInvalid Role"; |
push(@error,"Invalid Role"); |
} |
} |
|
|
if (!defined($primaryLibServer)) { |
if (!defined($primaryLibServer)) { |
if (@libservers > 0) { |
if (@libservers > 0) { |
$error .= "No primary library server ID designated. Choose from: ".join(',',sort(@libservers)); |
push(@error,"No primary library server ID designated. Choose from: ".join(',',sort(@libservers))); |
} else { |
} else { |
$error .= "No library servers in this domain (including current server)"; |
push(@error,"No library servers in this domain (including current server)"); |
} |
} |
} else { |
} else { |
if (length($primaryLibServer)>35) { $error.="\nPrimary Library Server ID: $primaryLibServer too long"; } |
if (length($primaryLibServer)>35) { push(@error,"Primary Library Server ID: $primaryLibServer too long"); } |
if (length($primaryLibServer)<2) { $error.="\nPrimary Library Server ID: $primaryLibServer too short"; } |
if (length($primaryLibServer)<2) { push(@error,"Primary Library Server ID: $primaryLibServer too short"); } |
if ($primaryLibServer =~/capa/i) { |
if ($primaryLibServer =~/capa/i) { |
if ($primaryLibServer!~/^oucapa\d+$/ && |
if ($primaryLibServer!~/^oucapa\d+$/ && |
($primaryLibServer!~/^capa\d+$/ && $perlvar{'lonDefDomain'} eq 'uwsp')) { |
($primaryLibServer!~/^capa\d+$/ && $perlvar{'lonDefDomain'} eq 'uwsp')) { |
$error.="\nPrimary library server ID $primaryLibServer contains 'capa'"; |
push(@error,"Primary library server ID $primaryLibServer contains 'capa'") |
} |
} |
} |
} |
foreach my $bad ('res','raw','userfiles','priv','adm','uploaded', |
foreach my $bad ('res','raw','userfiles','priv','adm','uploaded', |
'editupload') { |
'editupload') { |
$error.="\nPrimary library server ID $primaryLibServer reserved." if $primaryLibServer eq $bad; |
push(@error,"Primary library server ID $primaryLibServer reserved.") if $primaryLibServer eq $bad; |
} |
} |
if ($primaryLibServer=~/[^\w\-.]/) { $error.="\nPrimary library server ID $primaryLibServer contains special characters"; } |
if ($primaryLibServer=~/[^\w\-.]/) { push(@error,"Primary library server ID $primaryLibServer contains special characters"); } |
} |
} |
|
|
|
|
if ($error) { print "\n*** ERRORS: $error\n"; } |
if (@error) { print "\n*** ERRORS: \n\t".join("\n\t",@error)."\n"; } |
print(<<END); |
print(<<END); |
ENTER A CHOICE OF 1-11 TO CHANGE, otherwise ENTER 12: |
ENTER A CHOICE OF 1-11 TO CHANGE, otherwise ENTER 12: |
END |
END |