Package org.dspace.eperson

Examples of org.dspace.eperson.EPerson


            if (id != null)
            {
                String address = (String)session.getAttribute(CURRENT_IP_ADDRESS);
                if (address != null && address.equals(request.getRemoteAddr()))
                {
                    EPerson eperson = EPerson.find(context, id);
                    context.setCurrentUser(eperson);
                   
                    // Check to see if systemwide alerts is restricting sessions
                    if (!AuthorizeManager.isAdmin(context) && !SystemwideAlerts.canUserMaintainSession())
                    {
                      // Normal users can not maintain their sessions, check to see if this is really an
                      // administrator loging in as someone else.
                     
                      EPerson realEPerson = EPerson.find(context, realid);
                      Group administrators = Group.find(context,1);
                       if (!administrators.isMember(realEPerson))
                       {
                         // Log this user out because sessions are being restricted by a systemwide alert.
                         context.setCurrentUser(null);
View Full Code Here


          if (effectiveID.intValue() != authenticatedID.intValue())
          {
            // The user has login in as another user, instead of logging them out,
            // revert back to their previous login name.
           
            EPerson authenticatedUser = EPerson.find(context, authenticatedID);
            context.setCurrentUser(authenticatedUser);
            session.setAttribute(EFFECTIVE_USER_ID, authenticatedID);
            return;
          }
        }
View Full Code Here

       
        // Need to create new eperson
        // FIXME: TEMPORARILY need to turn off authentication, as usually
        // only site admins can create e-people
        context.setIgnoreAuthorization(true);
        EPerson eperson = EPerson.create(context);
        eperson.setEmail(email);
        eperson.setCanLogIn(true);
        eperson.setSelfRegistered(true);
        eperson.update();
        context.setIgnoreAuthorization(false);
       
        // Give site auth a chance to set/override appropriate fields
        AuthenticationManager.initEPerson(context, request, eperson);
       
View Full Code Here

    {
      try{
     
          UsageEvent ue = (UsageEvent)event;
     
          EPerson currentUser = ue.getContext() == null ? null : ue.getContext().getCurrentUser();

                SolrLogger.post(ue.getObject(), ue.getRequest(), currentUser);

      }
      catch(Exception e)
View Full Code Here

        // Sort them to a consistent ordering
        Collections.sort(allMemberEPeopleIDs);
       
        for (Integer epersonID : allMemberEPeopleIDs)
        {
          EPerson eperson = EPerson.find(context, epersonID);
          boolean highlight = (eperson.getID() == highlightEPersonID);
          boolean pendingAddition = !parent.isMember(eperson);
          boolean pendingRemoval = !memberEPeopleIDs.contains(epersonID);
          addMemberRow(table,eperson,highlight,pendingAddition,pendingRemoval);
         
          if (pendingAddition || pendingRemoval)
View Full Code Here

            // Match "/eperson/ep_db_<id>" URI
            // -or- "/eperson/<email-addr>"
            // -or- "/eperson/current" - magic path to _current_ user (if any)
            if (pathElt[0].equals("eperson") && pathElt.length > 1)
            {
                EPerson ep = null;
                if (pathElt.length > 2)
                {
                    throw new DAVStatusException(
                            HttpServletResponse.SC_NOT_FOUND,
                            "Invalid eperson resource path.");
View Full Code Here

    {
        if (AuthorizeManager.isAdmin(context))
        {
            return true;
        }
        EPerson self = context.getCurrentUser();
        return self != null && this.eperson != null
                && self.getID() == this.eperson.getID();
    }
View Full Code Here

        int status = AuthenticationManager.authenticate(context, username,
                password, null, this.request);
        if (status == AuthenticationMethod.SUCCESS)
        {
            EPerson cu = context.getCurrentUser();
            log.debug("SOAP service " + this.getClass().getName()
                    + " authenticated as " + cu.getEmail() + " ("
                    + cu.getFirstName() + " " + cu.getLastName() + ")");
            DAVServlet.putAuthCookie(context, this.request, this.response, true);
            return context;
        }
        else if (status == AuthenticationMethod.BAD_CREDENTIALS)
        {
View Full Code Here

        {
            value = canonicalizeHandle(this.item.getHandle());
        }
        else if (elementsEqualIsh(property, submitterProperty))
        {
            EPerson ep = this.item.getSubmitter();
            if (ep != null)
            {
                value = hrefToEPerson(ep);
            }
        }
View Full Code Here

            {
                throw new DAVStatusException(DAV.SC_CONFLICT,
                        "The submitter property cannot be removed.");
            }
            String newName = prop.getText();
            EPerson ep = EPerson.findByEmail(this.context, newName);
            if (ep == null)
            {
                throw new DAVStatusException(DAV.SC_CONFLICT,
                        "Cannot set submitter, no EPerson found for email address: "
                                + newName);
View Full Code Here

TOP

Related Classes of org.dspace.eperson.EPerson

Copyright © 2018 www.massapicom. 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.