$ctx->{unparsed_uri} = $self->apache->unparsed_uri;
$ctx->{opac_root} = $ctx->{base_path} . "/opac"; # absolute base url
$ctx->{is_staff} = 0; # Assume false, check for workstation id later. Was: ($self->apache->headers_in->get('User-Agent') =~ /oils_xulrunner/);
- $ctx->{physical_loc} = $self->get_physical_loc;
# capture some commonly accessed pages
$ctx->{home_page} = 'http://' . $self->apache->hostname . $self->ctx->{opac_root} . "/home";
}
}
+ $ctx->{physical_loc} = $self->get_physical_loc;
$self->staff_saved_searches_set_expansion_state if $ctx->{is_staff};
return Apache2::Const::OK;
sub get_physical_loc {
my $self = shift;
- if(my $physical_loc = $self->cgi->param('physical_loc')) {
+ my $physical_loc;
+
+ if ($physical_loc = $self->cgi->param('physical_loc')) { # assignment
$self->apache->headers_out->add(
"Set-Cookie" => $self->cgi->cookie(
-name => COOKIE_PHYSICAL_LOC,
)
);
return $physical_loc;
+ } elsif ($physical_loc = $self->cgi->cookie(COOKIE_PHYSICAL_LOC)) { # assignment
+ return $physical_loc;
+ } elsif ($self->ctx->{is_staff}) {
+ return $self->editor->requestor->ws_ou;
}
- return $self->cgi->cookie(COOKIE_PHYSICAL_LOC);
+ return;
}