Search in sources :

Example 1 with ClientInfo

use of org.apache.wicket.core.request.ClientInfo 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

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 Right (org.apache.openmeetings.db.entity.user.User.Right)1 ExtendedClientProperties (org.apache.openmeetings.web.util.ExtendedClientProperties)1 ClientInfo (org.apache.wicket.core.request.ClientInfo)1