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

[EP-tech] Antwort: Access user via javascript?


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.

There is the undocument variable $STAFF_ONLY that can be used in EPScript
und EPrints Control Format (EPC).

<epc:if test="$STAFF_ONLY = 'TRUE'">display something here</epc:if>

It is mentioned in
 (in the workflow description at the bottom), but not explained there.

In my opinion, that variable (and possible other system variables) should
be documented in


Best regards,


Dr. Martin Br?ndle
Zentrale Informatik
Universit?t Z?rich
Stampfenbachstr. 73
CH-8006 Z?rich

Von:	Andrew Collington <a.p.collington at sussex.ac.uk>
An:	"eprints-tech at ecs.soton.ac.uk" <eprints-tech at ecs.soton.ac.uk>
Datum:	01/03/2016 14:16
Betreff:	[EP-tech] Access user via javascript?
Gesendet von:	eprints-tech-bounces at ecs.soton.ac.uk

Hi all,

Is there something set up in ePrints that allows you to get user details
(such as type/role, email, etc.) via javascript?  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!

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).  I originally tried to modify that
section, but with the caching it obviously didn?t work.  I then tried to
use a pin but had the same problems.  Someone responded to my original
EPrints UK User Group post (
suggesting that js may be a good way forward.

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.  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.

Many thanks,


Andrew Collington
Web Programmer, ITS Client Services
ITS-CS Shawcross, University of Sussex, Falmer, Brighton, BN1 9QT

T: (01273) 872591 (ext. 2591)
E: a.p.collington at sussex.ac.uk
 *** 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/20160304/ae59fafd/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160304/ae59fafd/attachment.gif