mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
(Christophe Destin)
- SF Patch #1582754 CreateAdministrator for dummies git-svn-id: http://scm.dspace.org/svn/repo/trunk@1714 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
1.5 alpha 1
|
||||
===========
|
||||
(K. Nakagami)
|
||||
- SF Patch #1621889 ] for SF Bug #1606789 - When collection is deleted, mapped item remains in community
|
||||
(Christophe Destin)
|
||||
- SF Patch #1582754 CreateAdministrator for dummies
|
||||
Creation of admin via [dspace]/bin/create-administrator for a given email, irrespective of the email
|
||||
belonging to an allready registered user.
|
||||
|
||||
(K. Nakagami)
|
||||
- SF Patch #1621889 for SF Bug #1606789 When collection is deleted, mapped item remains in community
|
||||
|
||||
1.4.1 final
|
||||
===========
|
||||
(Tim Donohue)
|
||||
|
@@ -148,15 +148,21 @@ public class CreateAdministrator
|
||||
}
|
||||
|
||||
// Create the administrator e-person
|
||||
EPerson eperson = EPerson.create(context);
|
||||
|
||||
eperson.setEmail(email);
|
||||
EPerson eperson = EPerson.findByEmail(context,email);
|
||||
|
||||
// check if the email belongs to a registered user,
|
||||
// if not create a new user with this email
|
||||
if (eperson == null)
|
||||
{
|
||||
eperson = EPerson.create(context);
|
||||
eperson.setEmail(email);
|
||||
eperson.setCanLogIn(true);
|
||||
eperson.setRequireCertificate(false);
|
||||
eperson.setSelfRegistered(false);
|
||||
}
|
||||
eperson.setLastName(lastName);
|
||||
eperson.setFirstName(firstName);
|
||||
eperson.setPassword(password1);
|
||||
eperson.setCanLogIn(true);
|
||||
eperson.setRequireCertificate(false);
|
||||
eperson.setSelfRegistered(false);
|
||||
eperson.update();
|
||||
|
||||
admins.addMember(eperson);
|
||||
|
Reference in New Issue
Block a user