version 1.50, 2006/09/28 22:52:43
|
version 1.51, 2006/12/10 23:38:35
|
Line 260 END
|
Line 260 END
|
close(OUT); |
close(OUT); |
$lonDefDomain=$choice; |
$lonDefDomain=$choice; |
$flag=1; |
$flag=1; |
} elsif (length($choice)>12) { |
} elsif (length($choice)>35) { |
print "Name too long\n"; |
print "Name too long\n"; |
} elsif (length($choice)<2) { |
} elsif (length($choice)<2) { |
print "Name too short\n"; |
print "Name too short\n"; |
} elsif ($bad_domain_flag) { |
} elsif ($bad_domain_flag) { |
print "Invalid input ('$choice' conflicts with LON-CAPA namespace).\n"; |
print "Invalid input ('$choice' conflicts with LON-CAPA namespace).\n"; |
print "Please try something different than '$choice'\n"; |
print "Please try something different than '$choice'\n"; |
} elsif ($choice!~/\_/ and $choice=~/^\w+$/) { |
} elsif ($choice!~/\_/ and $choice=~/^[\w\-.]+$/) { |
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
print(OUT 'lonDefDomain'."\t".$choice."\n"); |
print(OUT 'lonDefDomain'."\t".$choice."\n"); |
close(OUT); |
close(OUT); |
Line 275 END
|
Line 275 END
|
$r='l'; |
$r='l'; |
$flag=1; |
$flag=1; |
} else { |
} else { |
print "Invalid input (only alphanumeric characters supported).\n"; |
print "Invalid input (only alphanumeric characters, '-', and '.' supported).\n"; |
} |
} |
} |
} |
|
|
Line 348 END
|
Line 348 END
|
close(OUT); |
close(OUT); |
$lonHostID=$choice; |
$lonHostID=$choice; |
$flag=1; |
$flag=1; |
} elsif (length($choice)>15) { |
} elsif (length($choice)>45) { |
print "Name too long\n"; |
print "Name too long\n"; |
} elsif (length($choice)<4) { |
} elsif (length($choice)<4) { |
print "Name too short\n"; |
print "Name too short\n"; |
} elsif ($choice!~/\_/ and $choice=~/^\w+$/) { |
} elsif ($choice!~/\_/ and $choice=~/^[\w\-.]+$/) { |
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
print(OUT 'lonHostID'."\t".$choice."\n"); |
print(OUT 'lonHostID'."\t".$choice."\n"); |
close(OUT); |
close(OUT); |
$lonHostID=$choice; |
$lonHostID=$choice; |
$flag=1; |
$flag=1; |
} else { |
} else { |
print "Invalid input (only alphanumeric characters supported).\n"; |
print "Invalid input (only alphanumeric characters, '-', and '.' supported).\n"; |
} |
} |
} |
} |
|
|
Line 404 END
|
Line 404 END
|
print(OUT 'primaryLibServer'."\t".$choice."\n"); |
print(OUT 'primaryLibServer'."\t".$choice."\n"); |
close(OUT); |
close(OUT); |
$flag=1; |
$flag=1; |
} elsif (length($choice)>15) { |
} elsif (length($choice)>35) { |
print "Name too long\n"; |
print "Name too long\n"; |
} elsif (length($choice)<4) { |
} elsif (length($choice)<4) { |
print "Name too short\n"; |
print "Name too short\n"; |
} elsif ($choice!~/\_/ and $choice=~/^\w+$/) { |
} elsif ($choice!~/\_/ and $choice=~/^[\w\-.]+$/) { |
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
print(OUT 'primaryLibServer'."\t".$choice."\n"); |
print(OUT 'primaryLibServer'."\t".$choice."\n"); |
close(OUT); |
close(OUT); |
$primaryLibServer=$choice; |
$primaryLibServer=$choice; |
$flag=1; |
$flag=1; |
} else { |
} else { |
print "Invalid input (only alphanumeric characters supported).\n"; |
print "Invalid input (only alphanumeric characters, '-', and '.' supported).\n"; |
} |
} |
} |
} |
|
|
Line 713 END
|
Line 713 END
|
|
|
my $error=''; |
my $error=''; |
foreach my $v ($perlvar{'lonDefDomain'},$perlvar{'lonHostID'}) { |
foreach my $v ($perlvar{'lonDefDomain'},$perlvar{'lonHostID'}) { |
if (length($v)>16) { $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+$/ && |
Line 725 foreach my $v ($perlvar{'lonDefDomain'},
|
Line 725 foreach my $v ($perlvar{'lonDefDomain'},
|
'editupload') { |
'editupload') { |
$error.="\nName $v reserved." if $v eq $bad; |
$error.="\nName $v reserved." if $v eq $bad; |
} |
} |
if ($v=~/\W/) { $error.="\nName $v contains special characters"; } |
if ($v=~/[^\w\-.]/) { $error.="\nName $v contains special characters"; } |
} |
} |
if ($domainDescription!~/^[\(\)\-\w\s,]+$/) { |
if ($domainDescription!~/^[\(\)\-\w\s,]+$/) { |
$error.="\nDomain Description contains special characters"; |
$error.="\nDomain Description contains special characters"; |
Line 744 if (!defined($primaryLibServer)) {
|
Line 744 if (!defined($primaryLibServer)) {
|
$error .= "No library servers in this domain (including current server)"; |
$error .= "No library servers in this domain (including current server)"; |
} |
} |
} else { |
} else { |
if (length($primaryLibServer)>16) { $error.="\nPrimary Library Server ID: $primaryLibServer too long"; } |
if (length($primaryLibServer)>35) { $error.="\nPrimary Library Server ID: $primaryLibServer too long"; } |
if (length($primaryLibServer)<2) { $error.="\nPrimary Library Server ID: $primaryLibServer too short"; } |
if (length($primaryLibServer)<2) { $error.="\nPrimary Library Server ID: $primaryLibServer too short"; } |
if ($primaryLibServer =~/capa/i) { |
if ($primaryLibServer =~/capa/i) { |
if ($primaryLibServer!~/^oucapa\d+$/ && |
if ($primaryLibServer!~/^oucapa\d+$/ && |
Line 756 if (!defined($primaryLibServer)) {
|
Line 756 if (!defined($primaryLibServer)) {
|
'editupload') { |
'editupload') { |
$error.="\nPrimary library server ID $primaryLibServer reserved." if $primaryLibServer eq $bad; |
$error.="\nPrimary library server ID $primaryLibServer reserved." if $primaryLibServer eq $bad; |
} |
} |
if ($primaryLibServer=~/\W/) { $error.="\nPrimary library server ID $primaryLibServer contains special characters"; } |
if ($primaryLibServer=~/[^\w\-.]/) { $error.="\nPrimary library server ID $primaryLibServer contains special characters"; } |
} |
} |
|
|
|
|
Line 928 unless (-l "<TARGET />") {
|
Line 928 unless (-l "<TARGET />") {
|
my $hostname=`hostname -f`;chomp($hostname); |
my $hostname=`hostname -f`;chomp($hostname); |
$date=`date -I`; chomp($date); |
$date=`date -I`; chomp($date); |
$lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=~s/\W//g; |
$lonHostID=~s/[^\w\-.]//g; |
$lineexistflag=0; |
$lineexistflag=0; |
$hostidexistflag=0; |
$hostidexistflag=0; |
$line2insert=<<END; |
$line2insert=<<END; |