(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:
Claudia Juergen
2006-12-27 12:36:08 +00:00
parent bda0d498e9
commit 889b65d3d4
2 changed files with 19 additions and 8 deletions

View File

@@ -1,7 +1,12 @@
1.5 alpha 1
===========
(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
- SF Patch #1621889 for SF Bug #1606789 When collection is deleted, mapped item remains in community
1.4.1 final
===========

View File

@@ -148,15 +148,21 @@ public class CreateAdministrator
}
// Create the administrator e-person
EPerson eperson = EPerson.create(context);
EPerson eperson = EPerson.findByEmail(context,email);
eperson.setEmail(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);