Package org.apache.openmeetings.persistence.beans.user

Examples of org.apache.openmeetings.persistence.beans.user.User


      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManagement.getUserLevelByID(users_id);

      if (authLevelUtil.checkAdminLevel(user_level)) {

        User userExternal = userManagement.getUserByExternalIdAndType(
            externalUserId, externalUserType);

        Long userId = userExternal.getUser_id();

        // Setting user deleted
        usersDao.deleteUserID(userId);

        return userId;
View Full Code Here


        log.debug("appointmentId " + appointmentId);

        appointmentLogic.getAppointMentById(appointmentId);

        User user = userManager.getUserById(users_id);

        return appointmentDao.updateAppointmentByTime(appointmentId,
            appointmentstart, appointmentend, users_id, baseurl,
            languageId, user.getOmTimeZone().getIcal());
      }
    } catch (Exception err) {
      log.error("[updateAppointment]", err);
      err.printStackTrace();
    }
View Full Code Here

        room.setRoomtype(rt);

        roomDao.update(room, users_id);
      }

      User user = userManager.getUserById(users_id);

      return appointmentDao.updateAppointment(appointmentId,
          appointmentName, appointmentDescription, appointmentstart
              .getTime(), appointmentend.getTime(), isDaily,
          isWeekly, isMonthly, isYearly, categoryId, remind, newList,
          users_id, baseurl, languageId, isPasswordProtected,
          password, user.getOmTimeZone().getIcal(),
          appointmentLocation);

    } catch (Exception err) {
      log.error("[updateAppointment]", err);
      throw new AxisFault(err.getMessage());
View Full Code Here

      }
    }

    // check if user already exists

    User u = null;

    try {
      u = userManager.getUserByLogin(user);

    } catch (Exception e) {
      log.error("Error retrieving Userdata : " + e.getMessage());
    }
   
    // Attributes to retrieve from ldap to either create or update the user
    List<String> attributes = new ArrayList<String>();
    attributes.add(ldap_user_attr_lastname); // Lastname
    attributes.add(ldap_user_attr_firstname); // Firstname
    attributes.add(ldap_user_attr_mail);// mail
    attributes.add(ldap_user_attr_street); // Street
    attributes.add(ldap_user_attr_additional_name); // Additional name
    attributes.add(ldap_user_attr_fax); // Fax
    attributes.add(ldap_user_attr_zip); // ZIP
    attributes.add(ldap_user_attr_country); // Country
    attributes.add(ldap_user_attr_town); // Town
    attributes.add(ldap_user_attr_phone); // Phone
    attributes.add(ldap_user_attr_timezone); // timezone
    attributes.add(ldap_user_picture_uri); //picture uri
   
    HashMap<String, String> ldapAttrs = new HashMap<String, String>();
    ldapAttrs.put("lastnameAttr", ldap_user_attr_lastname);
    ldapAttrs.put("firstnameAttr", ldap_user_attr_firstname);
    ldapAttrs.put("mailAttr", ldap_user_attr_mail);
    ldapAttrs.put("streetAttr", ldap_user_attr_street);
    ldapAttrs.put("additionalNameAttr", ldap_user_attr_additional_name);
    ldapAttrs.put("faxAttr", ldap_user_attr_fax);
    ldapAttrs.put("zipAttr", ldap_user_attr_zip);
    ldapAttrs.put("countryAttr", ldap_user_attr_country);
    ldapAttrs.put("townAttr", ldap_user_attr_town);
    ldapAttrs.put("phoneAttr", ldap_user_attr_phone);
    ldapAttrs.put("timezoneAttr", ldap_user_attr_timezone);
    ldapAttrs.put("pictureUri", ldap_user_picture_uri);

    Vector<HashMap<String, String>> result = lAuth.getData(
        ldap_search_scope, ldap_search_filter, attributes);

    if (result == null || result.size() < 1) {
      log.error("Error on Ldap request - no result for user " + user);
      return new Long(-10);
    }
   
    if (result.size() > 1) {
      log.error("Error on Ldap request - more than one result for user "
          + user);
      return null;
    }
   
    HashMap<String, String> userData = result.get(0);


    // User not existant in local database -> take over data for referential
    // integrity
    if (u == null) {
      log.debug("user doesnt exist local -> create new");

      try {
        // Create User with LdapData
        Long userid;
        if (ldap_sync_passwd_to_om) {
          Random r = new Random();
          String token = Long.toString(Math.abs(r.nextLong()), 36);
          log.debug("Synching Ldap user to OM DB with RANDOM password: "
              + token);
          userid = createUserFromLdapData(userData, token, user,
              ldapAttrs);
        } else {
          log.debug("Synching Ldap user to OM DB with password");
          userid = createUserFromLdapData(userData, passwd, user,
              ldapAttrs);
        }
        log.debug("New User ID : " + userid);

        // If invoked via SOAP this is NULL
        if (currentClient != null) {
          currentClient.setUser_id(userid);
          SessionVariablesUtil.setUserId(client, userid);
        }

        // Update Session
        Boolean bool = sessiondataDao.updateUser(SID, userid);

        if (bool == null) {
          // Exception
          log.error("Error on Updating Session");
          return new Long(-1);
        } else if (!bool) {
          // invalid Session-Object
          log.error("Invalid Session Object");
          return new Long(-35);
        }

        // Return UserObject
        User u2 = userManager.getUserById(userid);

        if (u2 == null)
          return new Long(-1);

        u2.setExternalUserType(EXTERNAL_USER_TYPE_LDAP); // TIBO

        // initialize lazy collection
        userManager.refreshUserObject(u2);

        log.debug("getUserbyId : " + userid + " : " + u2.getLogin());

        return u2;

      } catch (Exception e) {
        log.error("Error on Working Userdata : ", e);
View Full Code Here

          "", //userSearchs
          false, //showContactData
          true //showContactDataToContacts
          );
     
      User user = usersDao.get(newUserId);
      user.setPictureuri(pictureUri);
      usersDao.update(user, null);

    } catch (Exception e) {
      log.error("Error creating user : " + e.getMessage());
    }
View Full Code Here

      Long user_level = userManager.getUserLevelByID(users_id);

      if (authLevelUtil.checkUserLevel(user_level)) {
       
        User us = userManager.getUserById(users_id);
       
        // Refactor the given time ignoring the Date is always UTC!
        TimeZone timezone = timezoneUtil.getTimezoneByUser(us);
       
        //Transform the user time in a local time of the server
View Full Code Here

        log.debug("updateAppointment");

        log.debug("appointmentId " + appointmentId);
       
        User us = userManager.getUserById(users_id);
       
        // Refactor the given time ignoring the Date is always UTC!
        TimeZone timezone = timezoneUtil.getTimezoneByUser(us);
       
        //Transform the user time in a local time of the server
        //machines locale timeZone and store that to the db
        Date appointmentstart = new Date(TimezoneUtil.getCalendarInTimezone(appointmentstartStr, timezone).getTime().getTime());
        Date appointmentend = new Date(TimezoneUtil.getCalendarInTimezone(appointmentendStr, timezone).getTime().getTime());

        log.debug("up timezone "+timezone);
        log.debug("up appointmentstartStr "+appointmentstartStr);
        log.debug("up appointmentendStr "+appointmentendStr);
        log.debug("up appointmentstart "+appointmentstart);
        log.debug("up appointmentend   "+appointmentend);

        appointmentLogic
            .getAppointMentById(appointmentId);

        User user = userManager.getUserById(users_id);
       
        return appointmentDao.updateAppointmentByTime(appointmentId,
            appointmentstart, appointmentend, users_id, baseurl,
            language_id, user.getOmTimeZone().getIcal());

      }
    } catch (Exception err) {
      log.error("[updateAppointment]", err);
    }
View Full Code Here

            room.setRoomtype(rt);
 
            roomDao.update(room, users_id);
          }
        }
        User user = userManager.getUserById(users_id);
       
        // Refactor the given time ignoring the Date is always UTC!
        TimeZone timezone = timezoneUtil.getTimezoneByUser(user);
       
        //Transform the user time in a local time of the server
        //machines locale timeZone and store that to the db
        Date appointmentstart = new Date(TimezoneUtil.getCalendarInTimezone(appointmentstartStr, timezone).getTime().getTime());
        Date appointmentend = new Date(TimezoneUtil.getCalendarInTimezone(appointmentendStr, timezone).getTime().getTime());

        log.debug("up2 timezone "+timezone);
        log.debug("up2 appointmentstartStr "+appointmentstartStr);
        log.debug("up2 appointmentendStr "+appointmentendStr);
        log.debug("up2 appointmentstart "+appointmentstart);
        log.debug("up2 appointmentend "+appointmentend);

        return appointmentDao.updateAppointment(appointmentId,
            appointmentName, appointmentDescription,
            appointmentstart, appointmentend, isDaily, isWeekly,
            isMonthly, isYearly, categoryId, remind, mmClient,
            users_id, baseUrl, language_id, isPasswordProtected, password, user
                .getOmTimeZone().getIcal(), appointmentLocation);
      }
    } catch (Exception err) {
      log.error("[updateAppointment]", err);
    }
View Full Code Here

          "", //userSearchs
          false, //showContactData
          true //showContactDataToContacts
          );
     
      User user = usersDao.get(newUserId);
      user.setPictureuri(pictureUri);
      usersDao.update(user, null);

    } catch (Exception e) {
      log.error("Error creating user : " + e.getMessage());
    }
View Full Code Here

      }

      TypedQuery<User> query = em
          .createQuery("select c from User as c where c.user_id = :user_id AND c.deleted <> true", User.class);
      query.setParameter("user_id", user_id);
      User us = null;
      try {
        us = query.getSingleResult();
      } catch (NoResultException e) {
        // u=null}
      }

      if (us != null) {
        return us.getLevel_id();
      } else {
        return -1L;
      }
    } catch (Exception ex2) {
      log.error("[getUserLevelByID]", ex2);
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.persistence.beans.user.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.