the('title') || 'Elsevier Science'; $main = $method = ''; $framed = $this->the('framed') || ''; $sarea = lc the('sarea') || ''; $mode = lc the('mode') || ''; #$jobref = the('ref') || ''; for frame only - not used yet.. $key = the('key') || ''; if (($sarea eq '') && ($key =~ m/^s(\w+)$/i)) { $sarea = lc $1; } # default to "sarea = saa" in the 'prgm' mode $sarea = 'saa' if (($mode eq 'prgm') && ($sarea eq '')); $new_arguments = arguments; unless ($main = the('main')) { # Do we want a form? my $form = the('form') || $this->the('form'); if ($form) { $main = '/cgi-bin/homepage/guestbook/formhandler.cgi'; my (%temp) = %{$new_arguments}; $temp{'action'} = 'index.htt'; $temp{'form'} = $form; $new_arguments = \%temp; $method = 'exec'; # Embed a simple file? } elsif ($main = the('file')) { $method = 'embed'; } else { my $modes = $this->the('modes'); if (ref $modes eq 'HASH') { #my $mode = the('mode'); unless ( $mode && $modes->{$mode}) { $mode = $this->the('mode'); } my $ref = $modes->{$mode}; ($main, $method, $framed) = @{$ref}; } } } unless (defined $main) { $main = $this->the('main'); $method = $this->the('method'); } # this is to use the default color scheme for the search - do not pass it in this case $sarea = '' if (($method eq 'exec') && ($main eq '/cgi-bin/inca/search/search.cgi')); ""; }> <?{ $title }> the('header') ) { @Header = @{$this->the('header')}; } $header = join('',@Header) ne '' ? 1 : 0; '' }> the('header')} }> = 4)) ? " OnLoad=\"rotateStart(); return true;\"" : "" ; $onload = '' ; my($mbase) = $main; my($anchorfile) = ''; $anchorfile = $1 if ($main =~ /\/(\w+\.\w+)$/) ; $onload = $rstart if ( $main =~/layout\/main.htt/ ) ; $mbase .= '/' if ($mbase !~ /\.\w+$/); # add a '/' if it does not finish by '.something' $mbase =~ s/\/\/$/\//; if ($mbase =~ m/(\/homepage\/)(about|search|news|errors|estoc|general|misc|sa\w|ssi)\/(.*)?\//) { $base = ""; } $base }> >
'0', 'sarea' => $sarea}) }>
$sarea, 'mode' => $mode}, $this); }> ) =~ /\S/; # skip headers my @lines = ; chdir ($dir); close FH; close PFH; wait; my $status = $? >> 8; warn "show/index.htt: $cgi_cmd returned $status\n" if $::debug >= 2; @lines; } $method ||= ($main =~ m:/cgi-bin/:) ? 'POST' : 'GET'; if ($method eq 'GET') { # now simply load main pages use LWP::Simple; if (substr($main,0,1) eq '/') { $main = 'http://' . $server_name . $main; } # warn "in index.htt get of $main ", __LINE__, " of ", __FILE__; my $MainText = get($main); $MainText = "URL $main
" . "NOT DEFINED - ERROR" if (! $MainText); $MainText } elsif ($method eq 'POST') { # now post a request and display the content my $res = ''; eval { use HTTP::Request::Common qw(POST); use LWP::UserAgent; *IO::Select::DESTROY = sub {} unless defined &IO::Select::DESTROY; *HTTP::Headers::DESTROY = sub {} unless defined &HTTP::Headers::DESTROY; my $ua = new LWP::UserAgent; my $URL = "http://$server_name$main"; my $req = POST $URL, $new_arguments; my $response = $ua->request($req); if ($response->is_success) { $res = $response->content; } else { $res = $response->error_as_HTML; } undef $response; undef $req; }; $res; } elsif ($method eq 'exec') { join ('', _cgi_post ($main, $new_arguments)); } elsif ($method eq 'embed') { embed(\$main, $new_arguments); } }>