version 1.508, 2014/04/16 14:39:59
|
version 1.511, 2014/06/29 03:22:43
|
Line 621 sub ConfigFileFromSelector {
|
Line 621 sub ConfigFileFromSelector {
|
# String to send to client ("ok" or "refused" if bad file). |
# String to send to client ("ok" or "refused" if bad file). |
# |
# |
sub PushFile { |
sub PushFile { |
my $request = shift; |
my $request = shift; |
my ($command, $filename, $contents) = split(":", $request, 3); |
my ($command, $filename, $contents) = split(":", $request, 3); |
&Debug("PushFile"); |
&Debug("PushFile"); |
|
|
Line 651 sub PushFile {
|
Line 651 sub PushFile {
|
|
|
if($filename eq "host") { |
if($filename eq "host") { |
$contents = AdjustHostContents($contents); |
$contents = AdjustHostContents($contents); |
|
} elsif ($filename eq 'dns_host' || $filename eq 'dns_domain') { |
|
if ($contents eq '') { |
|
&logthis('<font color="red"> Pushfile: unable to install ' |
|
.$tablefile." - no data received from push. </font>"); |
|
return 'error: push had no data'; |
|
} |
|
if (&Apache::lonnet::get_host_ip($clientname)) { |
|
my $clienthost = &Apache::lonnet::hostname($clientname); |
|
if ($managers{$clientip} eq $clientname) { |
|
my $clientprotocol = $Apache::lonnet::protocol{$clientname}; |
|
$clientprotocol = 'http' if ($clientprotocol ne 'https'); |
|
my $url = '/adm/'.$filename; |
|
$url =~ s{_}{/}; |
|
my $ua=new LWP::UserAgent; |
|
$ua->timeout(60); |
|
my $request=new HTTP::Request('GET',"$clientprotocol://$clienthost$url"); |
|
my $response=$ua->request($request); |
|
if ($response->is_error()) { |
|
&logthis('<font color="red"> Pushfile: unable to install ' |
|
.$tablefile." - error attempting to pull data. </font>"); |
|
return 'error: pull failed'; |
|
} else { |
|
my $result = $response->content; |
|
chomp($result); |
|
unless ($result eq $contents) { |
|
&logthis('<font color="red"> Pushfile: unable to install ' |
|
.$tablefile." - pushed data and pulled data differ. </font>"); |
|
my $pushleng = length($contents); |
|
my $pullleng = length($result); |
|
if ($pushleng != $pullleng) { |
|
return "error: $pushleng vs $pullleng bytes"; |
|
} else { |
|
return "error: mismatch push and pull"; |
|
} |
|
} |
|
} |
|
} |
|
} |
} |
} |
|
|
# Install the new file: |
# Install the new file: |
Line 5317 sub validate_crsreq_handler {
|
Line 5355 sub validate_crsreq_handler {
|
sub crsreq_update_handler { |
sub crsreq_update_handler { |
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
my ($cdom,$cnum,$crstype,$action,$ownername,$ownerdomain,$fullname,$title,$code,$infohashref) = |
my ($cdom,$cnum,$crstype,$action,$ownername,$ownerdomain,$fullname,$title,$code, |
|
$accessstart,$accessend,$infohashref) = |
split(/:/, $tail); |
split(/:/, $tail); |
$crstype = &unescape($crstype); |
$crstype = &unescape($crstype); |
$action = &unescape($action); |
$action = &unescape($action); |
Line 5326 sub crsreq_update_handler {
|
Line 5365 sub crsreq_update_handler {
|
$fullname = &unescape($fullname); |
$fullname = &unescape($fullname); |
$title = &unescape($title); |
$title = &unescape($title); |
$code = &unescape($code); |
$code = &unescape($code); |
|
$accessstart = &unescape($accessstart); |
|
$accessend = &unescape($accessend); |
my $incoming = &Apache::lonnet::thaw_unescape($infohashref); |
my $incoming = &Apache::lonnet::thaw_unescape($infohashref); |
my ($result,$outcome); |
my ($result,$outcome); |
eval { |
eval { |
Line 5333 sub crsreq_update_handler {
|
Line 5374 sub crsreq_update_handler {
|
my %rtnhash; |
my %rtnhash; |
$outcome = &localenroll::crsreq_updates($cdom,$cnum,$crstype,$action, |
$outcome = &localenroll::crsreq_updates($cdom,$cnum,$crstype,$action, |
$ownername,$ownerdomain,$fullname, |
$ownername,$ownerdomain,$fullname, |
$title,$code,$incoming,\%rtnhash); |
$title,$code,$accessstart,$accessend, |
|
$incoming,\%rtnhash); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
my @posskeys = qw(createdweb createdmsg queuedweb queuedmsg formitems reviewweb); |
my @posskeys = qw(createdweb createdmsg queuedweb queuedmsg formitems reviewweb); |
foreach my $key (keys(%rtnhash)) { |
foreach my $key (keys(%rtnhash)) { |
Line 6552 sub make_new_child {
|
Line 6594 sub make_new_child {
|
# my $tmpsnum=0; # Now global |
# my $tmpsnum=0; # Now global |
#---------------------------------------------------- kerberos 5 initialization |
#---------------------------------------------------- kerberos 5 initialization |
&Authen::Krb5::init_context(); |
&Authen::Krb5::init_context(); |
unless (($dist eq 'fedora5') || ($dist eq 'fedora4') || |
|
($dist eq 'fedora6') || ($dist eq 'suse9.3') || |
my $no_ets; |
($dist eq 'suse12.2') || ($dist eq 'suse12.3') || |
if ($dist =~ /^(?:centos|rhes)(\d+)$/) { |
($dist eq 'suse13.1')) { |
if ($1 >= 7) { |
|
$no_ets = 1; |
|
} |
|
} elsif ($dist =~ /^suse(\d+\.\d+)$/) { |
|
if (($1 eq '9.3') || ($1 >= 12.2)) { |
|
$no_ets = 1; |
|
} |
|
} elsif ($dist =~ /^fedora(\d+)$/) { |
|
if ($1 < 7) { |
|
$no_ets = 1; |
|
} |
|
} |
|
unless ($no_ets) { |
&Authen::Krb5::init_ets(); |
&Authen::Krb5::init_ets(); |
} |
} |
|
|