EPrints Technical Mailing List Archive
Message: #06768
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Usertype at demoeprints
- To: eprints-tech@ecs.soton.ac.uk
- Subject: Re: [EP-tech] Usertype at demoeprints
- From: Ajunk Pracetio <prazetyo@gmail.com>
- Date: Mon, 14 Aug 2017 19:27:20 +0700
Hi Agung,
I *think* the code that's reverting the usertype to 'user' is in [EPRINTS_ROOT]/perl_lib/
EPrints/Plugin/Screen/NewUser. pm In the 'action_create' sub, the config 'default_user_type' is referenced, and the user is created with this.
This config is normally in [EPRINTS_ROOT]/archives/[
ARCHIVEID]/cfg/cfg.d/registrat ion.pl
I think there are two options:
i) override the NewUser plugin (see: https://wiki.eprints.org/w/
Instructions_for_local_plugins ) - you just need to override the 'action_create'. ii) Make the 'default_user_type' find the data in the request, and return the value selected.
With either option, you should make sue the usertype chosen isn't going to cause you problems - e.g allowing someone to create an admin account could allow them to break things!
If you want to limit the usertype options in the workflow, you can add an 'options' parameter e.g.:
<component><field ref="usertype" options="user,editor"/></
component> but you should also validate that one of those options has been chosen when processing the registration.
Cheers,
John
From: eprints-tech-bounces@ecs.
soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk ] On Behalf Of Ajunk Pracetio
Sent: 13 August 2017 11:41
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Usertype at demoeprints
Hi,
I want to create a demoprint like http://demoprints.eprints.org/. I've been able to bring up the usertype option at registration, but when I select "editor", and try to login, the usertype is still the user, not the "editor" as I choose. It looks like my selection is not saved.
Is there a wrong move? Please guidance.
thank youregards,
Agung
--Life isn't valuable if you don't have someone to care
*** 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/
- References:
- [EP-tech] Usertype at demoeprints
- From: Ajunk Pracetio <prazetyo@gmail.com>
- Re: [EP-tech] Usertype at demoeprints
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Usertype at demoeprints
- Prev by Date: [EP-tech] Eprints GMAIL SMTP Configuration
- Next by Date: [EP-tech] URGENT: Dublin Core output issues
- Previous by thread: Re: [EP-tech] Usertype at demoeprints
- Next by thread: [EP-tech] Eprints GMAIL SMTP Configuration
- Index(es):