Search in sources :

Example 1 with ExtendedClientProperties

use of org.apache.openmeetings.web.util.ExtendedClientProperties in project openmeetings by apache.

the class WebSession method invalidate.

@Override
public void invalidate() {
    cm.invalidate(userId, getId());
    super.invalidate();
    userId = null;
    rights = Collections.unmodifiableSet(Collections.<Right>emptySet());
    ISO8601FORMAT = null;
    sdf = null;
    languageId = -1;
    i = null;
    soap = null;
    roomId = null;
    recordingId = null;
    externalType = null;
    tz = null;
    browserTz = null;
    extProps = new ExtendedClientProperties();
}
Also used : Right(org.apache.openmeetings.db.entity.user.User.Right) ExtendedClientProperties(org.apache.openmeetings.web.util.ExtendedClientProperties)

Example 2 with ExtendedClientProperties

use of org.apache.openmeetings.web.util.ExtendedClientProperties in project openmeetings by apache.

the class WebSession method setUser.

private void setUser(User u, Set<Right> rights) {
    Long _recordingId = recordingId;
    Long _roomId = roomId;
    Invitation _i = i;
    SOAPLogin _soap = soap;
    ClientInfo _info = clientInfo;
    ExtendedClientProperties _extProps = extProps;
    // required to prevent session fixation
    replaceSession();
    if (_recordingId != null) {
        recordingId = _recordingId;
    }
    if (_roomId != null) {
        roomId = _roomId;
    }
    if (_i != null) {
        i = _i;
    }
    if (_soap != null) {
        soap = _soap;
    }
    if (_info != null) {
        clientInfo = _info;
    }
    if (_extProps != null) {
        extProps = _extProps;
    }
    userId = u.getId();
    if (rights == null || rights.isEmpty()) {
        Set<Right> r = new HashSet<>(u.getRights());
        if (u.getGroupUsers() != null && !AuthLevelUtil.hasAdminLevel(r)) {
            for (GroupUser gu : u.getGroupUsers()) {
                if (gu.isModerator()) {
                    r.add(Right.GroupAdmin);
                    break;
                }
            }
        }
        this.rights = Collections.unmodifiableSet(r);
    } else {
        this.rights = Collections.unmodifiableSet(rights);
    }
    languageId = u.getLanguageId();
    externalType = u.getExternalType();
    tz = getTimeZone(u);
    ISO8601FORMAT = FastDateFormat.getInstance(ISO8601_FULL_FORMAT_STRING, tz);
    setLocale(LocaleHelper.getLocale(u));
    sdf = FormatHelper.getDateTimeFormat(u);
}
Also used : GroupUser(org.apache.openmeetings.db.entity.user.GroupUser) SOAPLogin(org.apache.openmeetings.db.entity.server.SOAPLogin) Invitation(org.apache.openmeetings.db.entity.room.Invitation) Right(org.apache.openmeetings.db.entity.user.User.Right) ClientInfo(org.apache.wicket.core.request.ClientInfo) ExtendedClientProperties(org.apache.openmeetings.web.util.ExtendedClientProperties) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Aggregations

Right (org.apache.openmeetings.db.entity.user.User.Right)2 ExtendedClientProperties (org.apache.openmeetings.web.util.ExtendedClientProperties)2 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Invitation (org.apache.openmeetings.db.entity.room.Invitation)1 SOAPLogin (org.apache.openmeetings.db.entity.server.SOAPLogin)1 GroupUser (org.apache.openmeetings.db.entity.user.GroupUser)1 ClientInfo (org.apache.wicket.core.request.ClientInfo)1