Package com.adito.security

Examples of com.adito.security.User


    public PermissionTag() {
    }

    public int doStartTag() {

        User user = null;
        try {
            user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
            if (user == null) {
                return required ? SKIP_BODY : EVAL_BODY_INCLUDE;
            } else {
View Full Code Here


  public CheckAuthenticatedTag() {
  }

  public int doStartTag() {

    User user = null;

    try {
      user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
    }
    catch (SecurityErrorException ex) {
View Full Code Here

  }
 
  public int doStartTag() {
        UserDatabase udb;
        try {
            User user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
            udb = UserDatabaseManager.getInstance().getUserDatabase(user.getRealm().getResourceId());
        } catch (Exception e1) {
            return SKIP_BODY;
        }

      if(!udb.supportsAccountCreation()) {
View Full Code Here

     * (non-Javadoc)
     * @see com.adito.core.CoreListener#coreEvent(com.adito.core.CoreEvent)
     */
    public void coreEvent(CoreEvent evt) {
        if (evt.getId() == CoreEventConstants.USER_REMOVED) {
            User user = (User) evt.getParameter();
           
            // LDP - Fix as null user might be passed?
            if(user==null)
                return;
           
            try {
                removeUser(user.getPrincipalName());
            } catch (Exception e) {
                log.error("Failed to remove user from system database.", e);
            }
        }
    }
View Full Code Here

     */
    public ActionForward reset(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        AbstractPropertiesForm f = (AbstractPropertiesForm) form;
        f.clearValues();
        User user = isSetupMode() ? null : LogonControllerFactory.getInstance().getUser((HttpServletRequest) request);
        return rebuildItems(mapping, f.getParentCategory(), f, request, user);
    }
View Full Code Here

                                                HttpServletResponse response) throws Exception {
        if (log.isDebugEnabled())
            log.debug("Storing properties");
        AbstractPropertiesForm f = (AbstractPropertiesForm) form;
        f.storeItems();
        User user = isSetupMode() ? null : LogonControllerFactory.getInstance().getUser((HttpServletRequest) request);
        f.setSelectedCategory(f.getNewSelectedCategory());
        f.setNewSelectedCategory(-1);
        return rebuildItems(mapping, f.getParentCategory(), f, request, user);
    }
View Full Code Here

    }

    public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        AbstractPropertiesForm pf = (AbstractPropertiesForm) form;
        User user = isSetupMode() ? null : LogonControllerFactory.getInstance().getUser((HttpServletRequest) request);
        pf.setSelectedCategory(-1);
        pf.clearValues();
        int newCategory = pf.popCategory();
        pf.setParentCategory(newCategory);
        ActionForward fwd = rebuildItems(mapping, newCategory, pf, request, user);
View Full Code Here

     * @throws Exception
     */
    public ActionForward displayCategory(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                         HttpServletResponse response) throws Exception {
        AbstractPropertiesForm pf = (AbstractPropertiesForm) form;
        User user = isSetupMode() ? null : LogonControllerFactory.getInstance().getUser((HttpServletRequest) request);
        pf.setSelectedCategory(-1);
        pf.pushCategory(pf.getParentCategory());
        pf.setParentCategory(pf.getNewSelectedCategory());
        pf.setNewSelectedCategory(-1);
        return rebuildItems(mapping, pf.getParentCategory(), pf, request, user);
View Full Code Here

  }

  public int doStartTag() {
    UserDatabase udb;
    try {
        User user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
        udb = UserDatabaseManager.getInstance().getUserDatabase(user.getRealm().getResourceId());
    } catch (Exception e1) {
        return SKIP_BODY;
    }

    if(!udb.supportsAccountCreation() && requiresAccountCreation) {
View Full Code Here

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {

        ActionErrors errors = new ActionErrors();
        try {
            User user = LogonControllerFactory.getInstance().getUser(request);
            UserDatabase udb = UserDatabaseManager.getInstance().getUserDatabase(user.getRealm());
            if (getOldPassword().length() == 0) {
                throw new FieldValidationException("noOldPassword");
            }
            if (getOldPassword().equals(getNewPassword())) {
                throw new FieldValidationException("newAndOldPasswordMatch");
            }
            if (!getNewPassword().equals(getConfirmPassword())) {
                throw new FieldValidationException("newAndConfirmPasswordsDontMatch");
            }
            if (getNewPassword().length() == 0) {
                throw new FieldValidationException("noNewPassword");
            }
            if (!udb.checkPassword(user.getPrincipalName(), getOldPassword())) {
                throw new FieldValidationException("oldPasswordIncorrect");
            } else {
                // Check that the password matches the current policy, if not
                // then request a new one
                try {
                    String pattern = Property.getProperty(new RealmKey("security.password.pattern", user.getRealm().getResourceId()));
                    Pattern p = Pattern.compile(pattern);
                    if (!p.matcher(newPassword).matches()) {
                        throw new FieldValidationException("doesNotMatchPolicy");
                    }
                } catch(FieldValidationException fve) {
View Full Code Here

TOP

Related Classes of com.adito.security.User

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.