Package org.apache.openmeetings.db.dao.server

Examples of org.apache.openmeetings.db.dao.server.SessiondataDao


  public boolean signIn(String secureHash) {
    //FIXME code is duplicated from MainService, need to be unified
    SOAPLoginDao soapDao = getBean(SOAPLoginDao.class);
    SOAPLogin soapLogin = soapDao.get(secureHash);
    if (soapLogin != null && !soapLogin.getUsed()) { //add code for  || (soapLogin.getAllowSameURLMultipleTimes())
      SessiondataDao sessionDao = getBean(SessiondataDao.class);
      Sessiondata sd = sessionDao.getSessionByHash(soapLogin.getSessionHash());
      if (sd != null && sd.getSessionXml() != null) {
        RemoteSessionObject remoteUser = RemoteSessionObject.fromXml(sd.getSessionXml());
        if (remoteUser != null && !Strings.isEmpty(remoteUser.getExternalUserId())) {
          AdminUserDao userDao = getBean(AdminUserDao.class);
          User user = userDao.getExternalUser(remoteUser.getExternalUserId(), remoteUser.getExternalUserType());
          if (user == null) {
            user = userDao.getNewUserInstance(null);
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setLogin(remoteUser.getUsername()); //FIXME check if login UNIQUE
            user.setExternalUserId(remoteUser.getExternalUserId());
            user.setExternalUserType(remoteUser.getExternalUserType());
            user.getAdresses().setEmail(remoteUser.getEmail());
            user.setPictureuri(remoteUser.getPictureUrl());
          } else {
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setPictureuri(remoteUser.getPictureUrl());
          }
          user = userDao.update(user, null);

          soapLogin.setUsed(true);
          soapLogin.setUseDate(new Date());
          //soapLogin.setClientURL(clientURL); //FIXME
          soapDao.update(soapLogin);

          sessionDao.updateUser(SID, user.getUser_id());
          setUser(user);
          recordingId = soapLogin.getRoomRecordingId();
          return true;
        }
      }
View Full Code Here


  public static FieldLanguage getLanguageObj() {
    return getBean(FieldLanguageDao.class).getFieldLanguageById(getLanguage());
  }
 
  public String getValidatedSid() {
    SessiondataDao sessionDao = getBean(SessiondataDao.class);
    Long _userId = sessionDao.checkSession(SID);
    if (_userId == null || userId != _userId) {
      Sessiondata sessionData = sessionDao.getSessionByHash(SID);
      if (sessionData == null) {
        sessionData = sessionDao.startsession();
      }
      if (!sessionDao.updateUser(sessionData.getSession_id(), userId, false, languageId)) {
        //something bad, force user to re-login
        invalidate();
      } else {
        SID = sessionData.getSession_id();
      }
View Full Code Here

  public boolean signIn(String secureHash) {
    //FIXME code is duplicated from MainService, need to be unified
    SOAPLoginDao soapDao = getBean(SOAPLoginDao.class);
    SOAPLogin soapLogin = soapDao.get(secureHash);
    if (soapLogin != null && !soapLogin.getUsed()) { //add code for  || (soapLogin.getAllowSameURLMultipleTimes())
      SessiondataDao sessionDao = getBean(SessiondataDao.class);
      Sessiondata sd = sessionDao.getSessionByHash(soapLogin.getSessionHash());
      if (sd != null && sd.getSessionXml() != null) {
        RemoteSessionObject remoteUser = RemoteSessionObject.fromXml(sd.getSessionXml());
        if (remoteUser != null && !Strings.isEmpty(remoteUser.getExternalUserId())) {
          AdminUserDao userDao = getBean(AdminUserDao.class);
          User user = userDao.getExternalUser(remoteUser.getExternalUserId(), remoteUser.getExternalUserType());
          if (user == null) {
            user = userDao.getNewUserInstance(null);
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setLogin(remoteUser.getUsername()); //FIXME check if login UNIQUE
            user.setExternalUserId(remoteUser.getExternalUserId());
            user.setExternalUserType(remoteUser.getExternalUserType());
            user.getAdresses().setEmail(remoteUser.getEmail());
            user.setPictureuri(remoteUser.getPictureUrl());
          } else {
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setPictureuri(remoteUser.getPictureUrl());
          }
          user = userDao.update(user, null);

          soapLogin.setUsed(true);
          soapLogin.setUseDate(new Date());
          //soapLogin.setClientURL(clientURL); //FIXME
          soapDao.update(soapLogin);

          sessionDao.updateUser(SID, user.getUser_id());
          setUser(user);
          recordingId = soapLogin.getRoomRecordingId();
          return true;
        }
      }
View Full Code Here

  public boolean signIn(String secureHash) {
    //FIXME code is duplicated from MainService, need to be unified
    SOAPLoginDao soapDao = getBean(SOAPLoginDao.class);
    SOAPLogin soapLogin = soapDao.get(secureHash);
    if (soapLogin != null && !soapLogin.getUsed()) { //add code for  || (soapLogin.getAllowSameURLMultipleTimes())
      SessiondataDao sessionDao = getBean(SessiondataDao.class);
      Sessiondata sd = sessionDao.getSessionByHash(soapLogin.getSessionHash());
      if (sd != null && sd.getSessionXml() != null) {
        RemoteSessionObject remoteUser = RemoteSessionObject.fromXml(sd.getSessionXml());
        if (remoteUser != null && !Strings.isEmpty(remoteUser.getExternalUserId())) {
          UserDao userDao = getBean(UserDao.class);
          User user = userDao.getExternalUser(remoteUser.getExternalUserId(), remoteUser.getExternalUserType());
          if (user == null) {
            user = userDao.getNewUserInstance(null);
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setLogin(remoteUser.getUsername()); //FIXME check if login UNIQUE
            user.setExternalUserId(remoteUser.getExternalUserId());
            user.setExternalUserType(remoteUser.getExternalUserType());
            user.getRights().add(Right.Room);
            user.getAdresses().setEmail(remoteUser.getEmail());
            user.setPictureuri(remoteUser.getPictureUrl());
          } else {
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setPictureuri(remoteUser.getPictureUrl());
          }
          user = userDao.update(user, null);

          soapLogin.setUsed(true);
          soapLogin.setUseDate(new Date());
          //soapLogin.setClientURL(clientURL); //FIXME
          soapDao.update(soapLogin);

          sessionDao.updateUser(SID, user.getUser_id());
          setUser(user);
          recordingId = soapLogin.getRoomRecordingId();
          return true;
        }
      }
View Full Code Here

  public static FieldLanguage getLanguageObj() {
    return getBean(FieldLanguageDao.class).getFieldLanguageById(getLanguage());
  }
 
  public String getValidatedSid() {
    SessiondataDao sessionDao = getBean(SessiondataDao.class);
    Long _userId = sessionDao.checkSession(SID);
    if (_userId == null || userId != _userId) {
      Sessiondata sessionData = sessionDao.getSessionByHash(SID);
      if (sessionData == null) {
        sessionData = sessionDao.startsession();
      }
      if (!sessionDao.updateUser(sessionData.getSession_id(), userId, false, languageId)) {
        //something bad, force user to re-login
        invalidate();
      } else {
        SID = sessionData.getSession_id();
      }
View Full Code Here

  public boolean signIn(String secureHash) {
    //FIXME code is duplicated from MainService, need to be unified
    SOAPLoginDao soapDao = getBean(SOAPLoginDao.class);
    SOAPLogin soapLogin = soapDao.get(secureHash);
    if (soapLogin != null && !soapLogin.getUsed()) { //add code for  || (soapLogin.getAllowSameURLMultipleTimes())
      SessiondataDao sessionDao = getBean(SessiondataDao.class);
      Sessiondata sd = sessionDao.getSessionByHash(soapLogin.getSessionHash());
      if (sd != null && sd.getSessionXml() != null) {
        RemoteSessionObject remoteUser = RemoteSessionObject.fromXml(sd.getSessionXml());
        if (remoteUser != null && !Strings.isEmpty(remoteUser.getExternalUserId())) {
          AdminUserDao userDao = getBean(AdminUserDao.class);
          User user = userDao.getExternalUser(remoteUser.getExternalUserId(), remoteUser.getExternalUserType());
          if (user == null) {
            user = userDao.getNewUserInstance(null);
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setLogin(remoteUser.getUsername()); //FIXME check if login UNIQUE
            user.setExternalUserId(remoteUser.getExternalUserId());
            user.setExternalUserType(remoteUser.getExternalUserType());
            user.getAdresses().setEmail(remoteUser.getEmail());
            user.setPictureuri(remoteUser.getPictureUrl());
          } else {
            user.setFirstname(remoteUser.getFirstname());
            user.setLastname(remoteUser.getLastname());
            user.setPictureuri(remoteUser.getPictureUrl());
          }
          user = userDao.update(user, null);

          soapLogin.setUsed(true);
          soapLogin.setUseDate(new Date());
          //soapLogin.setClientURL(clientURL); //FIXME
          soapDao.update(soapLogin);

          sessionDao.updateUser(SID, user.getUser_id());
          setUser(user);
          recordingId = soapLogin.getRoomRecordingId();
          return true;
        }
      }
View Full Code Here

  public static FieldLanguage getLanguageObj() {
    return getBean(FieldLanguageDao.class).getFieldLanguageById(getLanguage());
  }
 
  public String getValidatedSid() {
    SessiondataDao sessionDao = getBean(SessiondataDao.class);
    Long _userId = sessionDao.checkSession(SID);
    if (_userId == null || userId != _userId) {
      Sessiondata sessionData = sessionDao.getSessionByHash(SID);
      if (sessionData == null) {
        sessionData = sessionDao.startsession();
      }
      if (!sessionDao.updateUser(sessionData.getSession_id(), userId, false, languageId)) {
        //something bad, force user to re-login
        invalidate();
      } else {
        SID = sessionData.getSession_id();
      }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.dao.server.SessiondataDao

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.