<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
        {font-family:Menlo-Regular;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle25
        {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:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1293949133;
        mso-list-type:hybrid;
        mso-list-template-ids:-360178608 134807567 134807577 134807579 134807567 134807577 134807579 134807567 134807577 134807579;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Andrew,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I missed out an important logic test in my last example.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I didn’t check whether there was a user or not.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">This is what should have been there.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I’d possibly look at extending this to check whether the user has permission to edit the EPrint too – so you only render the link to
 someone who can!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">$c-&gt;{dynamic_template}-&gt;{function} = sub {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my( $repository, $parts ) = @_;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;if( $repository-&gt;current_user &amp;&amp; $repository-&gt;{request}-&gt;pnotes( &quot;eprint&quot; ) ){<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $eprint = $repository-&gt;{request}-&gt;pnotes( &quot;eprint&quot; );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $admin_link = $repository-&gt;render_link( $eprint-&gt;get_control_url );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$admin_link-&gt;appendChild( $repository-&gt;make_text( &quot;Edit this EPrint&quot; ) );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $parts-&gt;{admin_link} = $admin_link;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">};<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I’ve installed this on DemoPrints (<a href="http://demoprints.eprints.org/">http://demoprints.eprints.org/</a>).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">If you view
<a href="http://demoprints.eprints.org/1/">http://demoprints.eprints.org/1/</a> you shouldn’t see an ‘Edit this EPrint’ link beneath the H1 title.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">If you create a user account, login and then view the same page, it should (magically :o) appear!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">NB I’m not sure how often DemoPrints is reset. When it gets reset, this will stop working!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
<b>On Behalf Of </b>Andrew Collington<br>
<b>Sent:</b> 04 March 2016 16:57<br>
<b>To:</b> eprints-tech@ecs.soton.ac.uk<br>
<b>Subject:</b> Re: [EP-tech] Antwort: Access user via javascript?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">No need to apologise for slightly hijacking the discussion, Alan!&nbsp; I’m very new to ePrints so this is actually all really helpful!&nbsp;
 It’s good to see how others would solve the issues, if there’s a “best practices” way or not, and so on.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I appreciate that the js version doesn’t fail-safe, but I was just living with the fact that the admin link shows now anyway, so if
 it continues to show then “oh well”, else if it could be hidden then all the better.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">John; thanks for the pin code.&nbsp; I did actually try something in the dynamic template, but it didn’t use the pnotes method (I’ll have
 to investigate that one) and I added the pin to the citation xml document rather than the default template.&nbsp; Given the way I did things it resulted in it not working because of the static cache build.&nbsp; But I will give that a shot next week and see how it goes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks also, Martin, for the heads-up of the $STAFF_ONLY variable – that could come in handy!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Much appreciated, all!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
 [</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">mailto:eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">]
<b>On Behalf Of </b>Alan.Stiles<br>
<b>Sent:</b> 04 March 2016 10:29<br>
<b>To:</b> </span><a href="mailto:eprints-tech@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><br>
<b>Subject:</b> Re: [EP-tech] Antwort: Access user via javascript?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">The problem with hide by default is that it doesn’t ‘fail-safe’ – i.e. no JS, no visible buttons.&nbsp; Having them hidden but present for
 crawlers is surely no worse than the current situation of always visible?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I’m working on the principle that the object of the exercise is to prevent everyday users from seeing and clicking on buttons that
 don’t work for them – maybe Andrew could clarify?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I do like the concept of generating the abstract pages without the Staff links for general browsing purposes but checking the request
 to see if you have a logged in admin user and redirecting them to a version of the page (generated on demand or with an alternate template?) with the buttons available.&nbsp; This seems lighter-weight than just generating the abstract fresh for each request?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I suppose it depends how complicated a solution Andrew has the time / capacity to develop
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">(Apologies to Andrew if we’ve slightly hi-jacked the discussion!)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Alan<o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
 [</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">mailto:eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">]
<b>On Behalf Of </b>John Salter<br>
<b>Sent:</b> 04 March 2016 10:04<br>
<b>To:</b> 'eprints-tech@ecs.soton.ac.uk' &lt;</span><a href="mailto:eprints-tech@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">&gt;<br>
<b>Subject:</b> Re: [EP-tech] Antwort: Access user via javascript?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Here’s my though for the best route… this is a slightly more difficult nut to crack than it first seems.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">You could have the links rendered in the page, hidden by default, and reveal them with a bit of javascript/a css rule applied when
 there’s a logged-in ‘staff’ user.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Whilst this works, in my mind it’s a bit ‘hacky’ – the links are still present in a page where you don’t want them – a crawler can
 still find them.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">As the page being served is a cached copy, there isn’t the same access to the EPrint object that you’d have in e.g. an EPrint::View
 screen – so adding a link to the toolbar / template isn’t straightforward either.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">My two suggestions are:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><span style="mso-list:Ignore">1.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Use a Screen plugin that checks the URL if the request – trying to match ^(\d&#43;)\D?$ as the EPrint ID<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><span style="mso-list:Ignore">2.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Use a Screen plugin that access the Apache request, and looks for $r-&gt;pnotes( “eprint” ); or possibly $r-&gt;pnotes( “eprintid”
 ); and render the control URL from the EPrint object.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I think the second of these *<b>might</b>* be the best solution, but I’m not sure what the performance impact would be.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Anyone have any thoughts on these options?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
 [</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">mailto:eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">]
<b>On Behalf Of </b>Alan.Stiles<br>
<b>Sent:</b> 04 March 2016 09:35<br>
<b>To:</b> </span><a href="mailto:eprints-tech@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><br>
<b>Subject:</b> Re: [EP-tech] Antwort: Access user via javascript?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">The issue doesn’t seem so much one of security (the standard access control on eprints will still stop unauthorised users from accessing
 staff only areas) but rather one of hiding the buttons from those who don’t require them in the pre-built static abstract pages rather than the workflow.&nbsp; This means that you either have to rebuild the pages every time they are requested, which is heavy on
 the server, especially once there are 5 or 6 spiders farming your site, or you use some javascript/jquery to hide or not hide the repository admin access buttons as appropriate.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">It was I who suggested that idea to Andrew on the user group list, with the belief that some aspect of the user profile was available
 in JS.&nbsp; Assuming I was wrong on that front, would the best way to get that detail dynamically be an ajax call to a cgi function to return whether or not the user was an admin and, if not, hide the buttons (possibly requiring a surrounding ‘div’ or some such
 on the elements to be hidden).&nbsp; That way the worst that happens if the script fails or JS is disabled is that the buttons are still visible, as they are currently?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Any thoughts folks?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Alan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
 [</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">mailto:eprints-tech-bounces@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">]
<b>On Behalf Of </b></span><a href="mailto:martin.braendle@id.uzh.ch"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">martin.braendle@id.uzh.ch</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><br>
<b>Sent:</b> 04 March 2016 09:08<br>
<b>To:</b> </span><a href="mailto:eprints-tech@ecs.soton.ac.uk"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">eprints-tech@ecs.soton.ac.uk</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"><br>
<b>Subject:</b> [EP-tech] Antwort: Access user via javascript?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Hi,</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">from a point of view of security, I don't think that JavaScript is a good way, since it can be turned off or changed browser side.</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">There is the undocument variable $STAFF_ONLY that can be used in EPScript und EPrints Control Format (EPC).
</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Menlo-Regular&quot;,serif">&lt;epc:if test=&quot;$STAFF_ONLY = 'TRUE'&quot;&gt;</span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">display something here&lt;/epc:if&gt;</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">It is mentioned in </span>
<a href="http://wiki.eprints.org/w/How_to_control_eprint_workflow_based_on_a_user_field"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">http://wiki.eprints.org/w/How_to_control_eprint_workflow_based_on_a_user_field</span></a><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">&nbsp;(in
 the workflow description at the bottom), but not explained there.</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">In my opinion, that variable (and possible other system variables) should be documented in
</span><br>
<br>
<a href="http://wiki.eprints.org/w/EPScript"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">http://wiki.eprints.org/w/EPScript</span></a><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Best regards,</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Martin</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">--</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Dr. Martin Brändle</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Zentrale Informatik</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Universität Zürich</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Stampfenbachstr. 73</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">CH-8006 Zürich</span><br>
<br>
<br>
<img border="0" width="16" height="16" id="Picture_x0020_1" src="cid:image001.gif@01D1763B.12AED210" alt="Inactive hide details for Andrew Collington ---01/03/2016 14:16:18---Hi all, Is there something set up in ePrints that allows y"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#424282">Andrew
 Collington ---01/03/2016 14:16:18---Hi all, Is there something set up in ePrints that allows you to get user details (such as type/role,</span><br>
<br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Von: </span>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">Andrew Collington &lt;</span><a href="mailto:a.p.collington@sussex.ac.uk"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">a.p.collington@sussex.ac.uk</span></a><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">&gt;</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">An: </span>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">&quot;</span><a href="mailto:eprints-tech@ecs.soton.ac.uk"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">eprints-tech@ecs.soton.ac.uk</span></a><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">&quot;
 &lt;</span><a href="mailto:eprints-tech@ecs.soton.ac.uk"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">eprints-tech@ecs.soton.ac.uk</span></a><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">&gt;</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Datum:
</span><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">01/03/2016 14:16</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Betreff:
</span><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">[EP-tech] Access user via javascript?</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Gesendet von:
</span><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">eprints-tech-bounces@ecs.soton.ac.uk</span></a><o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div class="MsoNormal">
<hr size="2" width="100%" noshade="" style="color:#8091A5" align="left">
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Hi all,</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Is there something set up in ePrints that allows you to get user details (such as type/role, email, etc.) via javascript? &nbsp;I did have a look through the auto.js file but didn’t see anything, though
 given the size of that file it’d be very easy for me to miss something obvious!</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">The reason I ask is that I want to show a section in the abstract details only to admins (which is currently set up in cfg/citations/eprint/control.xml). &nbsp;I originally tried to modify that section,
 but with the caching it obviously didn’t work. &nbsp;I then tried to use a pin but had the same problems. &nbsp;Someone responded to my original EPrints UK User Group post (</span><a href="https://groups.google.com/forum/#!topic/eprints-uk-user-group/LloconUdLDg"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#0563C1">https://groups.google.com/forum/#!topic/eprints-uk-user-group/LloconUdLDg</span></a><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">)
 suggesting that js may be a good way forward.</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">If there’s not something already available then I could update the main template to include a json object of the user details which I can then use later on in the page. &nbsp;But hopefully someone else
 has already tried to add/show content dynamically based on role (or any other user property, I imagine) and can give some advice.</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Many thanks,</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Andy</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">-- <br>
Andrew Collington<br>
Web Programmer, ITS Client Services<br>
ITS-CS Shawcross, University of Sussex, Falmer, Brighton, BN1 9QT<br>
<br>
T: (01273) 872591 (ext. 2591)<br>
E: </span><a href="mailto:a.p.collington@sussex.ac.uk"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">a.p.collington@sussex.ac.uk</span></a><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><tt><span style="font-size:10.0pt">*** Options:
</span></tt><a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</span></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>*** Archive: </tt></span><a href="http://www.eprints.org/tech.php/"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">http://www.eprints.org/tech.php/</span></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>*** EPrints community wiki: </tt></span><a href="http://wiki.eprints.org/"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">http://wiki.eprints.org/</span></a><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>*** EPrints developers Forum: </tt></span><a href="http://forum.eprints.org/"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">http://forum.eprints.org/</span></a><o:p></o:p></p>
<p class="MsoNormal">-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England &amp; Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.
<o:p></o:p></p>
</div>
</body>
</html>