<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I did some digging on this trying different values to handle the problem of &#8220;Edit Profile&#8221; link being broken when under https after you login.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I ended up replacing the line here:</span>
<span style="color:#1F497D"><a href="https://github.com/eprintsug/meprints/blob/66da9c9c7bfb04dfa202368ad03cacc5ffe61fca/lib/plugins/EPrints/Plugin/Screen/User/EditLink.pm#L64">https://github.com/eprintsug/meprints/blob/66da9c9c7bfb04dfa202368ad03cacc5ffe61fca/lib/plugins/EPrints/Plugin/Screen/User/EditLink.pm#L64</a>
 &nbsp;with the following which now redirects properly under https. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Here&#8217;s my code change for line 64 of EditLink.pm.&nbsp; I&#8217;m not sure what the difference is between the original code and my code as it seems as though they should be the same.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $config = $self-&gt;{config};<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $url = URI-&gt;new( $config-&gt;{&quot;userhome&quot;} );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Also, using the standard https setup as documented here:
<a href="http://wiki.eprints.org/w/How_to_use_EPrints_with_HTTPS">http://wiki.eprints.org/w/How_to_use_EPrints_with_HTTPS</a> the include line for apache has changed to &#8220;Include /opt/eprints3/cfg/apache_ssl.conf&#8221; at what version this include has changed I have
 no idea.&nbsp; I&#8217;d update the documentation but reluctant to do so as I don&#8217;t know when this changed version wise.&nbsp; This took a while to figure out.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Brian Gregg.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:18.0pt;color:#323E4F">Brian D. Gregg<o:p></o:p></span></b></p>
<p class="MsoNormal"><i><span style="font-size:14.0pt;color:#323E4F">Solutions Architect
</span></i><span style="font-size:14.0pt;color:#323E4F">|<i> Manager Systems Development<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="color:#323E4F">University of Pittsburgh | University Library System<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#323E4F">Address: <a href="https://maps.google.com/maps?q=7500&#43;Thomas&#43;Blvd,&#43;Pittsburgh,&#43;PA&amp;hl=en&amp;sll=41.117935,-77.604698&amp;sspn=7.662465,13.73291&amp;oq=7500&#43;Tho&amp;t=h&amp;hnear=7500&#43;Thomas&#43;Blvd,&#43;Pittsburgh,&#43;Pennsylvania&#43;15208&amp;z=17" target="_blank">
<span style="color:#0563C1">7500 Thomas Blvd. &nbsp;Room 129 Pittsburgh, PA 15208</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#17365D">Tel: (412) 648-3264 | Email: <a href="mailto:bdgregg@pitt.edu">
<span style="color:#0563C1">bdgregg@pitt.edu</span></a> | Fax: (412) 648-3585<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></a></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
<b>On Behalf Of </b>Brian D. Gregg<br>
<b>Sent:</b> Friday, September 18, 2015 12:21 PM<br>
<b>To:</b> 'eprints-tech@ecs.soton.ac.uk' &lt;eprints-tech@ecs.soton.ac.uk&gt;<br>
<b>Subject:</b> [EP-tech] https and $session-&gt;config('userhome')<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">All,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">What is the best config value to use for the base URL when dealing with both http and https connections?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I see in 10_core.pl the following defined, but obviously they don&#8217;t automatically switch based upon http vs. https.<o:p></o:p></p>
<p class="MsoNormal">$c-&gt;{http_root} = undef;<o:p></o:p></p>
<p class="MsoNormal">$c-&gt;{https_root} = '/secure';<o:p></o:p></p>
<p class="MsoNormal">$c-&gt;{http_cgiroot} = '/cgi';<o:p></o:p></p>
<p class="MsoNormal">$c-&gt;{https_cgiroot} = '/secure/cgi';<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">But is there a $session-&gt;config(&#8216;{???}&#8217;) value that automatically switches between http and https as needed?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">The reason I am asking is in the code for meprints, we are having an issue with the &#8220;Edit Profile&#8221; link on the user&#8217;s homepage isn&#8217;t redirecting properly to https (aka &#8220;/secure/&#8230;&#8221;).&nbsp; I suspect that the issue is found here:
<a href="https://github.com/eprintsug/meprints/blob/66da9c9c7bfb04dfa202368ad03cacc5ffe61fca/lib/plugins/EPrints/Plugin/Screen/User/EditLink.pm#L64">
https://github.com/eprintsug/meprints/blob/66da9c9c7bfb04dfa202368ad03cacc5ffe61fca/lib/plugins/EPrints/Plugin/Screen/User/EditLink.pm#L64</a>&nbsp; However, I&#8217;m at a loss as to what to replace the $session-&gt;config( &#8216;userhome&#8217; ) value with.&nbsp; I suspect that there
 is a https or /secure that needs prepended to the string and I figure there is a short cut that I can use like $session-&gt;config( &#8216;cgiurl&#8217; ) etc. or something similar.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Any suggestions?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Brian.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><b><span style="font-size:18.0pt;color:#323E4F">Brian D. Gregg<o:p></o:p></span></b></p>
<p class="MsoNormal"><i><span style="font-size:14.0pt;color:#323E4F">Solutions Architect
</span></i><span style="font-size:14.0pt;color:#323E4F">|<i> Manager Systems Development<o:p></o:p></i></span></p>
<p class="MsoNormal"><span style="color:#323E4F">University of Pittsburgh | University Library System<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#323E4F">Address: <a href="https://maps.google.com/maps?q=7500&#43;Thomas&#43;Blvd,&#43;Pittsburgh,&#43;PA&amp;hl=en&amp;sll=41.117935,-77.604698&amp;sspn=7.662465,13.73291&amp;oq=7500&#43;Tho&amp;t=h&amp;hnear=7500&#43;Thomas&#43;Blvd,&#43;Pittsburgh,&#43;Pennsylvania&#43;15208&amp;z=17" target="_blank">
7500 Thomas Blvd.&nbsp; Room 129 Pittsburgh, PA 15208</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#17365D">Tel: (412) 648-3264 | Email: <a href="mailto:bdgregg@pitt.edu">
bdgregg@pitt.edu</a> | Fax: (412) 648-3585<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>