Examples of Invitations


Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      Long language_id, Boolean sendMail, Date gmtTimeStart,
      Date gmtTimeEnd, Long appointmentId, String fromUserField) {
    try {
      if (authLevelManagement.checkUserLevel(user_level)) {

        Invitations invitation = new Invitations();
        invitation.setIsPasswordProtected(isPasswordProtected);
        if (isPasswordProtected) {
          invitation.setInvitationpass(manageCryptStyle
              .getInstanceOfCrypt().createPassPhrase(
                  invitationpass));
        }

        invitation.setInvitationWasUsed(false);
        log.debug(baseUrl);
        invitation.setBaseUrl(baseUrl);

        // valid period of Invitation
        if (valid == 1) {
          // endless
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(false);
        } else if (valid == 2) {
          // period
          invitation.setIsValidByTime(true);
          invitation.setCanBeUsedOnlyOneTime(false);

          Date gmtTimeStartShifted = new Date(gmtTimeStart.getTime()
              - (5 * 60 * 1000));

          invitation.setValidFrom(gmtTimeStartShifted);
          invitation.setValidTo(gmtTimeEnd);

          // invitation.setValidFrom(validFrom);
          // invitation.setValidTo(validTo);
        } else {
          // one-time
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(true);
          invitation.setInvitationWasUsed(false);
        }

        invitation.setDeleted("false");

        Users us = usersDao.getUser(createdBy);
        String hashRaw = "HASH" + (System.currentTimeMillis());
        invitation.setHash(MD5.do_checksum(hashRaw));

        invitation.setInvitedBy(us);
        invitation.setInvitedname(username);
        invitation.setInvitedEMail(email);
        invitation.setRoom(roommanagement.getRoomById(rooms_id));
        invitation.setConferencedomain(conferencedomain);
        invitation.setStarttime(new Date());
        invitation.setAppointmentId(appointmentId);

        invitation = em.merge(invitation);
        long invitationId = invitation.getInvitations_id();

        invitation.setInvitations_id(invitationId);

        if (invitationId > 0) {

          if (sendMail) {
            this.sendInvitionLink(us.getAdresses().getEmail(),
                username, message, baseurl,
                email, subject, invitation.getHash(),
                validFrom, validTo, language_id, fromUserField);
          }

          return invitation;
        }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      log.debug("addAppointment offset :: " + offset);

      Date gmtTimeStart = new Date(dFrom.getTime() - offset);
      Date gmtTimeEnd = new Date(dTo.getTime() - offset);

      Invitations invitation = invitationManagement
          .addInvitationLink(user_level, username, message, baseurl,
              email, subject, room_id, conferencedomain,
              isPasswordProtected, invitationpass, valid, dFrom,
              dTo, users_id, baseurl, language_id, true,
              gmtTimeStart, gmtTimeEnd, null, username);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

            + member.getEmail() + " : " + e.getMessage());
      }
    }

    // Deleting invitation, if exists
    Invitations inv = member.getInvitation();

    if (inv != null) {
      inv.setDeleted("true");
      updateInvitation(inv);
    }

  }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

    log.debug("addInvitationIcalLink");

    try {
      if (authLevelManagement.checkUserLevel(user_level)) {

        Invitations invitation = new Invitations();
        invitation.setIsPasswordProtected(isPasswordProtected);
        if (isPasswordProtected) {
          invitation.setInvitationpass(manageCryptStyle
              .getInstanceOfCrypt().createPassPhrase(
                  invitationpass));
        }

        invitation.setInvitationWasUsed(false);

        // valid period of Invitation
        if (valid == 1) {
          // endless
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(false);
        } else if (valid == 2) {
          // period
          invitation.setIsValidByTime(true);
          invitation.setCanBeUsedOnlyOneTime(false);
          invitation.setValidFrom(validFrom);
          invitation.setValidTo(validTo);
        } else {
          // one-time
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(true);
          invitation.setInvitationWasUsed(false);
        }

        invitation.setDeleted("false");

        Users us = usersDao.getUser(createdBy);
        String hashRaw = "InvitationHash"
            + (System.currentTimeMillis());
        log.debug("addInvitationIcalLink : rawHash = " + hashRaw);
        invitation.setHash(MD5.do_checksum(hashRaw));

        invitation.setInvitedBy(us);
        invitation.setBaseUrl(baseurl);
        invitation.setInvitedname(username);
        invitation.setInvitedEMail(email);
        invitation.setRoom(roommanagement.getRoomById(rooms_id));
        invitation.setConferencedomain(conferencedomain);
        invitation.setStarttime(new Date());
        invitation.setAppointmentId(appointmentId);

        invitation = em.merge(invitation);
        long invitationId = invitation.getInvitations_id();

        if (invitationId > 0) {
          this.sendInvitionIcalLink(username, message, baseurl,
              email, subject, invitation.getHash(),
              appointMentId, createdBy, invitor, language_id,
              validFrom, validTo, timezone, fromUserField);
          return invitationId;
        }
      }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      TypedQuery<Invitations> query = em.createQuery(hql, Invitations.class);
      query.setParameter("deleted", "true");
      query.setParameter("invid", invId);

      Invitations inv = null;
      try {
        inv = query.getSingleResult();
      } catch (NoResultException ex) {
      }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      TypedQuery<Invitations> query = em.createQuery(hql, Invitations.class);
      query.setParameter("deleted", "true");
      query.setParameter("invid", invId);

      Invitations inv = null;
      try {
        inv = query.getSingleResult();
      } catch (NoResultException ex) {
      }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

          + "where c.hash LIKE :hashCode "
          + "AND c.deleted = :deleted";
      TypedQuery<Invitations> query = em.createQuery(hql, Invitations.class);
      query.setParameter("hashCode", hashCode);
      query.setParameter("deleted", "false");
      Invitations invitation = null;
      try {
        invitation = query.getSingleResult();
      } catch (NoResultException ex) {
      }

      if (invitation == null) {
        // already deleted or does not exist
        return new Long(-31);
      } else {
        if (invitation.getCanBeUsedOnlyOneTime()) {

          // do this only if the user tries to get the Invitation, not
          // while checking the PWD
          if (hidePass) {
            // one-time invitation
            if (invitation.getInvitationWasUsed()) {
              // Invitation is of type *only-one-time* and was
              // already used
              return new Long(-32);
            } else {
              // set to true if this is the first time / a normal
              // getInvitation-Query
              invitation.setInvitationWasUsed(true);
              this.updateInvitation(invitation);
              // invitation.setInvitationpass(null);
              invitation.setAllowEntry(true);
              return invitation;
            }
          } else {
            invitation.setAllowEntry(true);
            return invitation;
          }

        } else if (invitation.getIsValidByTime()) {

          Calendar now = Calendar.getInstance();

          if (invitation.getValidFrom().getTime() <= now.getTime()
              .getTime()
              && invitation.getValidTo().getTime() >= now
                  .getTime().getTime()) {
            this.updateInvitation(invitation);
            // invitation.setInvitationpass(null);
            invitation.setAllowEntry(true);
            return invitation;
          } else {

            // Invitation is of type *period* and is not valid
            // anymore, this is an extra hook to display the time
            // correctly
            // in the method where it shows that the hash code does
            // not work anymore
            invitation.setAllowEntry(false);

            return invitation;
          }
        } else {
          // Invitation is not limited, neither time nor single-usage
          this.updateInvitation(invitation);

          invitation.setAllowEntry(true);
          // invitation.setInvitationpass(null);
          return invitation;
        }
      }

View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

  public Object checkInvitationPass(String hashCode, String pass) {
    try {
      Object obj = this.getInvitationByHashCode(hashCode, false);
      log.debug("checkInvitationPass - obj: " + obj);
      if (obj instanceof Invitations) {
        Invitations invitation = (Invitations) obj;

        // log.debug("invitationId "+invitation.getInvitations_id());
        // log.debug("pass "+pass);
        // log.debug("getInvitationpass "+invitation.getInvitationpass());

        if (manageCryptStyle.getInstanceOfCrypt().verifyPassword(pass,
            invitation.getInvitationpass())) {
          return new Long(1);
        } else {
          return new Long(-34);
        }
      } else {
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

                  .getDateWithTimeByMiliSeconds(dFrom));
          log.info("validToDate: "
              + CalendarPatterns
                  .getDateWithTimeByMiliSeconds(dTo));
        }
        Invitations invitation = invitationManagement
            .addInvitationLink(user_level, username, username,
                username, username, username, room_id, "",
                isPasswordProtected, invitationpass, valid,
                dFrom, dTo, users_id, "", 1L, false, dFrom,
                dTo, null, username);

        if (invitation != null) {

          return invitation.getHash();

        } else {

          return "Sys - Error";
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

          log.info("validToDate: "
              + CalendarPatterns
                  .getDateWithTimeByMiliSeconds(dTo));
        }

        Invitations invitation = invitationManagement
            .addInvitationLink(user_level, username, message,
                baseurl, email, subject, room_id, "",
                isPasswordProtected, invitationpass, valid,
                dFrom, dTo, users_id, baseurl, language_id,
                sendMail, dFrom, dTo, null, username);

        if (invitation != null) {

          return invitation.getHash();

        } else {

          return "Sys - Error";
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.