Examples of EPerson


Examples of org.dspace.eperson.EPerson

   * @param group
   * @return
   */
  public boolean isOnBehalfOfInGroup(SWORDContext swordContext, Group group)
  {
    EPerson onBehalfOf = swordContext.getOnBehalfOf();
    if (onBehalfOf != null)
    {
      return isInGroup(group, onBehalfOf);
    }
    return false;
View Full Code Here

Examples of org.dspace.eperson.EPerson

        // FIXME: icky hardcoded workflow steps
        Group step1group = coll.getWorkflowGroup(1);
        Group step2group = coll.getWorkflowGroup(2);
        Group step3group = coll.getWorkflowGroup(3);

        EPerson e = c.getCurrentUser();

        // read permission
        AuthorizeManager.addPolicy(c, i, Constants.READ, e);

        if (step1group != null)
View Full Code Here

Examples of org.dspace.eperson.EPerson

       
        if (eperson_ids != null)
        {
            for (int i = 0; i < eperson_ids.length; i++)
            {
                EPerson eperson = EPerson.find(context, eperson_ids[i]);

                if (eperson != null)
                {
                    g.addMember(eperson);
                }
View Full Code Here

Examples of org.dspace.eperson.EPerson

                            HttpServletRequest request)
        throws SQLException
    {
        if (username != null && password != null)
        {
            EPerson eperson = null;
            log.info(LogManager.getHeader(context, "authenticate", "attempting password auth of user="+username));
            try
            {
                eperson = EPerson.findByEmail(context, username.toLowerCase());
            }
            catch (AuthorizeException e)
            {
                // ignore exception, treat it as lookup failure.
            }

            // lookup failed.
            if (eperson == null)
                return NO_SUCH_USER;

            // cannot login this way
            else if (!eperson.canLogIn())
                return BAD_ARGS;

            // this user can only login with x.509 certificate
            else if (eperson.getRequireCertificate())
            {
                log.warn(LogManager.getHeader(context, "authenticate", "rejecting PasswordAuthentication because "+username+" requires certificate."));
                return CERT_REQUIRED;
            }

            // login is ok if password matches:
            else if (eperson.checkPassword(password))
            {
                context.setCurrentUser(eperson);
                log.info(LogManager.getHeader(context, "authenticate", "type=PasswordAuthentication"));
                return SUCCESS;
            }
View Full Code Here

Examples of org.dspace.eperson.EPerson

     * @param event
     *            Content event
     */
    public void consume(Context ctx, Event event) throws Exception
    {
        EPerson ep = ctx.getCurrentUser();
        String user = (ep == null) ? "(none)" : ep.getEmail();
        String detail = event.getDetail();

        String msg = "EVENT: called TestConsumer.consume(): EventType="
                + event.getEventTypeAsString()
                + ", SubjectType="
View Full Code Here

Examples of org.dspace.eperson.EPerson

   
    // Third, check if there are any members to add
    // i.e. scan the list of ids against the group.
    for (Integer epersonID : newEPeopleIDs)
    {
      EPerson eperson = EPerson.find(context, epersonID);
     
      group.addMember(eperson);
    }
   
    for (Integer _groupID : newGroupIDs)
View Full Code Here

Examples of org.dspace.eperson.EPerson

    if (last.length() == 0)
      result.addError("last_name");
     
     
    // Check if the email address is all ready being used.             
      EPerson potentialDupicate = EPerson.findByEmail(context,email);
      if (potentialDupicate != null)
      {
        // special error that the front end knows about.
        result.addError("eperson_email_key");
      }
   
      // No errors, so we try to create the EPerson from the data provided
      if (result.getErrors() == null)
      {
        EPerson newPerson = AuthenticationUtil.createNewEperson(objectModel,email);
       
        newPerson.setFirstName(first);
            newPerson.setLastName(last);
            newPerson.setMetadata("phone", phone);
            newPerson.setCanLogIn(login);
            newPerson.setRequireCertificate(certificate);
            newPerson.setSelfRegistered(false);
           
            newPerson.update();
            context.commit();
            // success
            result.setContinue(true);
            result.setOutcome(true);
            result.setMessage(T_add_eperson_success_notice);
            result.setParameter("epersonID", newPerson.getID());
      }
     
      return result;
  }
View Full Code Here

Examples of org.dspace.eperson.EPerson

   
      // No errors, so we edit the EPerson with the data provided
    if (result.getErrors() == null)
      {
        // Grab the person in question
        EPerson personModified = EPerson.find(context, epersonID);
         
        // Make sure the email address we are changing to is unique
          String originalEmail = personModified.getEmail();
            if (originalEmail == null || !originalEmail.equals(email))
          { 
            EPerson potentialDupicate = EPerson.findByEmail(context,email);
           
            if (potentialDupicate == null)
            {
              personModified.setEmail(email);
            }
View Full Code Here

Examples of org.dspace.eperson.EPerson

   * @param epersonID The unique id of the eperson being edited.
   * @return A process result's object.
   */
  public static FlowResult processResetPassword(Context context, int epersonID) throws IOException, MessagingException, SQLException, AuthorizeException
 
    EPerson eperson = EPerson.find(context, epersonID);
   
    // Note, this may throw an error is the email is bad.
    AccountManager.sendForgotPasswordInfo(context,eperson.getEmail());
 
    FlowResult result = new FlowResult();
    result.setContinue(true);
      result.setOutcome(true);
      result.setMessage(T_reset_password_success_notice);
View Full Code Here

Examples of org.dspace.eperson.EPerson

    result.setContinue(true);
    result.setOutcome(true);
   
    final HttpServletRequest request = (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
       
    EPerson eperson = EPerson.find(context,epersonID);

    try {
      AuthenticationUtil.loginAs(context, request, eperson);
    }
    catch (AuthorizeException ae)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.