Package com.dotcms.repackage.javax.portlet

Examples of com.dotcms.repackage.javax.portlet.PortletSession


      is.close();
    } catch (Exception e) {
      Logger.error(this, "Could not load this file = user_manager_config.properties", e);
    }
 
    PortletSession sess = req.getPortletSession();
    req.setAttribute(WebKeys.USERMANAGER_PROPERTIES, properties);
    sess.setAttribute(WebKeys.USERMANAGER_PROPERTIES, properties);
  }
View Full Code Here


            // Getting the http request
            ActionRequestImpl reqImpl = (ActionRequestImpl) req;
            HttpServletRequest httpReq = reqImpl.getHttpServletRequest();

      PortletSession ses = req.getPortletSession();

      String companyId = PortalUtil.getCompanyId(req);

      String firstName = ParamUtil.getString(req, "first_name");
      String middleName = ParamUtil.getString(req, "middle_name");
      String lastName = ParamUtil.getString(req, "last_name");
      String nickName = ParamUtil.getString(req, "nick_name");

      String userId = ParamUtil.get(req, "user_id", "");
      boolean autoUserId = ParamUtil.get(req, "auto_user_id", false);

      String emailAddress =
        ParamUtil.getString(req, "email_address").toLowerCase();

      boolean autoPassword = ParamUtil.get(req, "auto_password", false);
      String password1 = ParamUtil.getString(req, "password_1");
      String password2 = ParamUtil.getString(req, "password_2");
      boolean passwordReset = ParamUtil.get(
        req, "password_reset",
        GetterUtil.getBoolean(PropsUtil.get(
          PropsUtil.PASSWORDS_CHANGE_ON_FIRST_USE)));

      boolean male = ParamUtil.get(req, "male", true);

      int bdMonth = ParamUtil.get(
        req, "birthday_month", Calendar.JANUARY);
      int bdDay = ParamUtil.get(req, "birthday_day", 1);
      int bdYear = ParamUtil.get(req, "birthday_year", 1970);

      Locale locale = null;
      if (req.getRemoteUser() == null) {
        locale = (Locale)ses.getAttribute(
          Globals.LOCALE_KEY, PortletSession.APPLICATION_SCOPE);
      }
      else {
        User defaultUser =
          UserLocalManagerUtil.getDefaultUser(companyId);

        locale = defaultUser.getLocale();
      }

      Captcha captcha = null;

      if (GetterUtil.getBoolean(
          PropsUtil.get(PropsUtil.CAPTCHA_CHALLENGE)) &&
        (config.getPortletName().equals(PortletKeys.MY_ACCOUNT))) {

        captcha = (Captcha)ses.getAttribute(
          WebKeys.CAPTCHA, PortletSession.APPLICATION_SCOPE);

        Boolean validResponse = captcha.validateResponse(
          ParamUtil.getString(req, "captcha_response"));

        if ((validResponse == null) ||
          (validResponse.equals(Boolean.FALSE))) {

          ses.removeAttribute(
            WebKeys.CAPTCHA, PortletSession.APPLICATION_SCOPE);

          throw new CaptchaException();
        }
      }

      UserManagerUtil.addUser(
        companyId, autoUserId, userId, autoPassword, password1,
        password2, passwordReset, firstName, middleName, lastName,
        nickName, male,
        new GregorianCalendar(bdYear, bdMonth, bdDay).getTime(),
        emailAddress, locale);

      if (captcha != null) {
        captcha.disposeChallenge();

        ses.removeAttribute(
          WebKeys.CAPTCHA, PortletSession.APPLICATION_SCOPE);
      }

      // Session messages
View Full Code Here

      RenderResponseImpl resImpl = (RenderResponseImpl)res;

      StringServletResponse stringServletRes =
        (StringServletResponse)resImpl.getHttpServletResponse();

      PortletSession ses = req.getPortletSession();

      long now = System.currentTimeMillis();

      Layout layout = (Layout)req.getAttribute(WebKeys.LAYOUT);
View Full Code Here

        // Getting the http request
        ActionRequestImpl reqImpl = (ActionRequestImpl) req;
        HttpServletRequest httpReq = reqImpl.getHttpServletRequest();

    PortletSession ses = req.getPortletSession();

    String password1 = ParamUtil.getString(req, "password_1");
    String password2 = ParamUtil.getString(req, "password_2");
    boolean passwordReset = ParamUtil.get(req, "password_reset", false);

    User user = PortalUtil.getSelectedUser(req);

    PortalUtil.updateUser(
      req, res, user.getUserId(), password1, password2, passwordReset);

    if (user.getUserId().equals(PortalUtil.getUser(req).getUserId())) {
      ses.setAttribute(
        WebKeys.USER_PASSWORD, password1,
        PortletSession.APPLICATION_SCOPE);
    }

    // Session messages
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.javax.portlet.PortletSession

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.