[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Re: Problems having the secure.xml template loaded OR How to get a different $config{base_url} for secure connections?

Hi Florian

	I believe that secure.xml was phased out some versions ago.  It certainly isn't part of the current release of EPrints (see https://github.com/eprints/eprints/tree/3.3/lib/templates ).

	I would suggest that you check you're loading resources correctly in the template:


	If that fails, swap your template for the default one of the version you're using and see if you still have the same problem.  Finally, if you're still lost, put your template up somewhere where we can see (do you have a github account?) it and post a link to it so we can take a look.

Adam Field
Business Relationship Manager and Community Lead
EPrints Services

I am currently not working in the UK.  Due to timezone differences (GMT -9) email responses may take longer.

On 11 Jul 2015, at 00:04, Florian He? <hess at ub.uni-heidelberg.de> wrote:

> Hi,
> please could someone point me to where in the codebase EPrints decides 
> to load either of default.xml or secure.xml template? Failed to grep 
> that place in order to find out what the exact conditions are.
> What I am struggling with is to load local asset files (.css, .js). If 
> the connection is secure because the client is logged in, Firefox seems 
> to happily load these files into cache as Firebug shows, but refuses to 
> use them. That's apparently why the user area is styled with bare 
> browser-defaults, while in the public pages the styles are applied properly.
> Firebug allows to change the loaded code on the fly. By fixing the urls, 
> I get some style afterwards. Not everything, to fix this may be yet 
> another issue when I have solved the basic one.
> We have different hosts for insecure and secure connections, and 
> different http(s)_roots too: https requires loading from a subpath on 
> another vhost, while http is served directly from the official domain. 
> This setup seems to be too exotic for the current implementation. 
> Because EPrints urls are variadic in regard to hierarchy depth, the 
> paths cannot be indicated relative or absolute-on-same-domain in the 
> template (at least not without dirty methods asking for trouble).
> If the default.xml vs. secure.xml template distinction is deprecated, I 
> didn't find a hint in the changelogs. As a work-around I considered to 
> define a different $config{base_url} when the connection is secure, but 
> in cfg.d/session.pl file, can't I use $session->get_secure to get a 
> session-restricted base_url for template rendering?
> Following has no effect:
> $c->{session_init} = sub {
>     my ($session, $offline) = @_;
>     $c->{base_url} = $c->{https_root} if $session->get_secure;
> };
> Kind regards
> Florian
> -- 
> UB Heidelberg (Altstadt)
> Pl?ck 107-109, 69117 HD
> Abt. Informationstechnik
> http://www.ub.uni-heidelberg.de/
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20150720/b5a4a14f/attachment-0001.html