Examples of Invitations


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

      Long language_id, Boolean sendMail, Date gmtTimeStart,
      Date gmtTimeEnd, Long appointmentId, String fromUserField, OmTimeZone omTimeZone) {
    try {
      if (authLevelUtil.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);
        invitation.setOmTimeZone(omTimeZone);

        // 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);

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

        invitation.setInvitedBy(us);
        invitation.setInvitedname(username);
        invitation.setInvitedEMail(email);
        invitation.setRoom(roomDao.get(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.apache.openmeetings.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.apache.openmeetings.persistence.beans.invitation.Invitations

    log.debug("addInvitationIcalLink");

    try {
      if (authLevelUtil.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);

        User us = usersDao.get(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(roomDao.get(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.apache.openmeetings.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.apache.openmeetings.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.apache.openmeetings.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()) {
          OmTimeZone tz = invitation.getOmTimeZone() == null
              ? omTimeZoneDaoImpl.getOmTimeZone(configurationDao.getConfValue("default.timezone", String.class, "Europe/Berlin"))
              : invitation.getOmTimeZone();
          Calendar now = Calendar.getInstance(TimeZone.getTimeZone(tz.getIcal()));
          Calendar start = Calendar.getInstance(TimeZone.getTimeZone(tz.getIcal()));
          start.setTime(invitation.getValidFrom());

          Calendar end = Calendar.getInstance(TimeZone.getTimeZone(tz.getIcal()));
          end.setTime(invitation.getValidTo());
          if (now.after(start) && now.before(end)) {
            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.apache.openmeetings.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.apache.openmeetings.persistence.beans.invitation.Invitations

                  recipients, room, appointmentstart,
                  appointmentend, false, true,
                  sendJNameTimeZone);
            }

            Invitations invitation = invitationManager
                .addInvitationLink(
                    new Long(2), // userlevel
                    from.getFirstname() + " "
                        + from.getLastname(), // username
                    message,
                    baseURL, // baseURl
                    from.getAdresses().getEmail(), // email
                    subject, // subject
                    room_id, // room_id
                    "public",
                    false, // passwordprotected
                    "", // invitationpass
                    2, // valid type
                    appointmentstart, // valid from
                    appointmentend, // valid to
                    from.getUser_id(), // created by
                    baseURL, from.getUser_id(),
                    false, // really send mail sendMail
                    appointmentstart, appointmentend,
                    appointmentId, from.getFirstname()
                        + " " + from.getLastname(),
                    from.getOmTimeZone());

            invitation_link = baseURL + "?invitationHash="
                + invitation.getHash();

          }

          if (to != null) {
View Full Code Here

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

      calTo.set(Calendar.SECOND, 0);

      Date dFrom = calFrom.getTime();
      Date dTo = calTo.getTime();

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

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

    return null;
  }

  public String sendInvitationByHash(String SID, String invitationHash, String message, String baseurl, String subject, Long language_id) {
    User us = userDAO.get(sessiondataDao.checkSession(SID));
    Invitations inv = (Invitations)invitationManager.getInvitationByHashCode(invitationHash, true);
    return invitationManager.sendInvitionLink(us, inv, message, baseurl, subject, language_id);
  }
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.