'.
''.&mt('Domain: [_1]',''.$dom.'').'
'.
''.&mt('Format for comma separated IP ranges').': '.
- &mt('A.B.C.D/N or A.B.C.D-E.F.G.H').' | '.
+ &mt('A.B.C.D/N or A.B.C.D-E.F.G.H').'
'.
+ &mt('Range(s) stored in CIDR notation').''.
''.
''.
''.$lt{'remoteip'}.': '.
@@ -14775,13 +14787,14 @@ sub modify_lti {
my @courseroles = ('cc','in','ta','ep','st');
my @ltiroles = qw(Learner Instructor ContentDeveloper TeachingAssistant Mentor Member Manager Administrator);
my @lticourseroles = qw(Instructor TeachingAssistant Mentor Learner);
- my @coursetypes = ('official','unofficial','community','textbook','placement');
+ my @coursetypes = ('official','unofficial','community','textbook','placement','lti');
my %coursetypetitles = &Apache::lonlocal::texthash (
official => 'Official',
unofficial => 'Unofficial',
community => 'Community',
textbook => 'Textbook',
placement => 'Placement Test',
+ lti => 'LTI Provider',
);
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles();
my %lt = <i_names();
@@ -14939,6 +14952,9 @@ sub modify_lti {
}
}
$confhash{$itemid}{'mapcrstype'} = \@crstypes;
+ if ($env{'form.lti_storecrs_'.$idx}) {
+ $confhash{$itemid}{'storecrs'} = 1;
+ }
if ($env{'form.lti_makecrs_'.$idx}) {
$confhash{$itemid}{'makecrs'} = 1;
}
@@ -14983,7 +14999,7 @@ sub modify_lti {
}
unless (($idx eq 'add') || ($changes{$itemid})) {
if ($confhash{$itemid}{'crsinc'}) {
- foreach my $field ('mapcrs','makecrs','section','passback','roster') {
+ foreach my $field ('mapcrs','storecrs','makecrs','section','passback','roster') {
if ($domconfig{$action}{$itemid}{$field} ne $confhash{$itemid}{$field}) {
$changes{$itemid} = 1;
}
@@ -15145,7 +15161,7 @@ sub modify_lti {
if ($confhash{$itemid}{'callback'}) {
$resulttext .= ''.&mt('Callback setting').': '.$confhash{$itemid}{'callback'}.'';
} else {
- $resulttext .= ''.&mt('No callback to logout LON-CAPA session when user logs out of Comsumer').'';
+ $resulttext .= ''.&mt('Callback to logout LON-CAPA on log out from Consumer').'';
}
if ($confhash{$itemid}{'mapuser'}) {
my $shownmapuser;
@@ -15234,6 +15250,9 @@ sub modify_lti {
$resulttext .= ''.&mt('No mapping to LON-CAPA courses').'';
}
}
+ if ($confhash{$itemid}{'storecrs'}) {
+ $resulttext .= ''.&mt('Store mapping of course identifier to LON-CAPA CourseID').': '.$confhash{$itemid}{'storecrs'}.'';
+ }
if ($confhash{$itemid}{'makecrs'}) {
$resulttext .= ''.&mt('Instructor may create course (if absent).').'';
} else {
@@ -20491,18 +20510,17 @@ sub modify_wafproxy {
$possible =~ s/[\r\n]+/\s/g;
$possible =~ s/\s*-\s*/-/g;
$possible =~ s/\s+/,/g;
+ $possible =~ s/,+/,/g;
}
$count = 0;
if ($possible ne '') {
foreach my $poss (split(/\,/,$possible)) {
$count ++;
- if (&validate_ip_pattern($poss)) {
+ $poss = &validate_ip_pattern($poss);
+ if ($poss ne '') {
push(@ok,$poss);
}
}
- if (@ok) {
- $wafproxy{$item} = join(',',@ok);
- }
my $diff = $count - scalar(@ok);
if ($diff) {
push(@warnings,''.
@@ -20510,6 +20528,13 @@ sub modify_wafproxy {
$diff,$warn{$item}).
'');
}
+ if (@ok) {
+ my @cidr_list;
+ foreach my $item (@ok) {
+ @cidr_list = &Net::CIDR::cidradd($item,@cidr_list);
+ }
+ $wafproxy{$item} = join(',',@cidr_list);
+ }
}
}
if ($wafproxy{$item} ne $currvalue{$item}) {
@@ -20701,12 +20726,17 @@ sub validate_ip_pattern {
if ($pattern =~ /^([^-]+)\-([^-]+)$/) {
my ($start,$end) = ($1,$2);
if ((&Net::CIDR::cidrvalidate($start)) && (&Net::CIDR::cidrvalidate($end))) {
- return 1;
+ if (($start !~ m{/}) && ($end !~ m{/})) {
+ return $start.'-'.$end;
+ }
+ }
+ } elsif ($pattern ne '') {
+ $pattern = &Net::CIDR::cidrvalidate($pattern);
+ if ($pattern ne '') {
+ return $pattern;
}
- } elsif (&Net::CIDR::cidrvalidate($pattern)) {
- return 1;
}
- return
+ return;
}
sub modify_usersessions {
| |