Package com.liferay.portal.model

Examples of com.liferay.portal.model.PasswordPolicy


      case UserPasswordException.PASSWORD_LENGTH: {

        try {
          Company company = CompanyLocalServiceUtil.getCompany(companyId);
          PasswordPolicy passwordPolicy = company.getDefaultUser().getPasswordPolicy();
          liferayFacesContext.addGlobalErrorMessage(
            "that-password-is-too-short-or-too-long-please-make-sure-your-password-is-between-x-and-512-characters",
            new Object[] { String.valueOf(passwordPolicy.getMinLength()) });

        }
        catch (Exception e1) {
          logger.error(e.getMessage(), e);
          liferayFacesContext.addGlobalUnexpectedErrorMessage();
        }

        break;
      }

      case UserPasswordException.PASSWORD_NOT_CHANGEABLE: {
        liferayFacesContext.addGlobalErrorMessage("your-password-cannot-be-changed");

        break;
      }

      case UserPasswordException.PASSWORD_SAME_AS_CURRENT: {
        liferayFacesContext.addGlobalErrorMessage(
          "your-new-password-cannot-be-the-same-as-your-old-password-please-enter-in-a-different-password");

        break;
      }

      case UserPasswordException.PASSWORD_TOO_TRIVIAL: {
        liferayFacesContext.addGlobalErrorMessage("that-password-is-too-trivial");

        break;
      }

      case UserPasswordException.PASSWORD_TOO_YOUNG: {

        try {
          Company company = CompanyLocalServiceUtil.getCompany(companyId);
          PasswordPolicy passwordPolicy = company.getDefaultUser().getPasswordPolicy();
          liferayFacesContext.addGlobalErrorMessage(
            "you-cannot-change-your-password-yet-please-wait-at-least-x-before-changing-your-password-again",
            new Object[] { String.valueOf(passwordPolicy.getMinAge() * 1000) });

        }
        catch (Exception e1) {
          logger.error(e.getMessage(), e);
          liferayFacesContext.addGlobalUnexpectedErrorMessage();
View Full Code Here

TOP

Related Classes of com.liferay.portal.model.PasswordPolicy

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.