This is an automated email from the ASF dual-hosted git repository.
solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git
The following commit(s) were added to refs/heads/master by this push:
new 8a22431 [OPENMEETINGS-2247] CSP is switched to 'block'
8a22431 is described below
commit 8a22431b1535b52a7a17d04ef00b9d38f79abac0
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Sat Apr 11 20:15:32 2020 +0700
[OPENMEETINGS-2247] CSP is switched to 'block'
---
.../db/dao/basic/ConfigurationDao.java | 119 +++++++++++++++------
.../openmeetings/db/dao/server/OAuth2Dao.java | 5 +
.../apache/openmeetings/backup/BackupImport.java | 2 +
.../installation/ImportInitvalues.java | 30 ++++--
.../openmeetings/util/OpenmeetingsVariables.java | 88 +++++++++++----
.../apache/openmeetings/web/app/Application.java | 45 --------
.../common/confirmation/bootstrap-confirmation.js | 1 -
.../web/room/activities/ActivitiesPanel.html | 2 +-
.../openmeetings/web/room/activities/activities.js | 1 +
.../openmeetings/web/room/menu/RoomMenuPanel.html | 2 +-
.../openmeetings/web/room/menu/RoomMenuPanel.java | 1 +
.../web/room/menu/SipDialerDialog.html | 5 -
.../org/apache/openmeetings/web/room/raw-room.js | 13 +++
.../apache/openmeetings/web/room/raw-settings.js | 3 +
.../openmeetings/web/room/sidebar/RoomSidebar.html | 6 +-
.../org/apache/openmeetings/web/room/wb/MathJax.js | 5 +-
.../apache/openmeetings/web/room/wb/raw-wb-area.js | 2 +-
.../openmeetings/web/room/wb/raw-wb-board.js | 12 ++-
.../openmeetings/web/user/chat/ChatToolbar.html | 2 +-
.../apache/openmeetings/web/user/chat/raw-chat.js | 6 ++
.../web/user/profile/MessagesContactsPanel.html | 3 +-
.../web/user/profile/MessagesContactsPanel.java | 13 ++-
.../web/user/profile/UserSearchPanel.html | 8 +-
.../web/user/profile/UserSearchPanel.java | 13 ++-
.../web/util/CallbackFunctionHelper.java | 7 --
openmeetings-web/src/main/webapp/css/raw-wb.css | 19 ++++
26 files changed, 271 insertions(+), 142 deletions(-)
diff --git
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
index cdf355a..65656cb 100644
---
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
+++
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
@@ -26,7 +26,12 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_AUTO_OPE
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CAM_FPS;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CHAT_SEND_ON_ENTER;
import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_XFRAME;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_FONT;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_FRAME;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_IMAGE;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_MEDIA;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_SCRIPT;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_STYLE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_GROUP_ID;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANG;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_TIMEZONE;
@@ -36,7 +41,6 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_EMAIL_VE
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_EXT_PROCESS_TTL;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FNAME_MIN_LENGTH;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_GOOGLE_ANALYTICS_CODE;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_HEADER_CSP;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_KEYCODE_ARRANGE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_KEYCODE_ARRANGE_RESIZE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_KEYCODE_MUTE;
@@ -61,12 +65,20 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SIP_ENAB
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SIP_EXTEN_CONTEXT;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_APP_NAME;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_BASE_URL;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_CSP_FONT;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_CSP_IMAGE;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_CSP_STYLE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_MAX_UPLOAD_SIZE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_SIP_CONTEXT;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.HEADER_CSP_SELF;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.HEADER_XFRAME_SELF;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.USER_LOGIN_MINIMUM_LENGTH;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.USER_PASSWORD_MINIMUM_LENGTH;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.getCspFontSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.getCspFrameSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.getCspImageSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.getCspMediaSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.getCspScriptSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.getCspStyleSrc;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.getGaCode;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.getRoomSettings;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setAllowRegisterFrontend;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setAllowRegisterOauth;
@@ -76,8 +88,13 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.setAudioBitrate
import static org.apache.openmeetings.util.OpenmeetingsVariables.setAudioRate;
import static org.apache.openmeetings.util.OpenmeetingsVariables.setBaseUrl;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setChatSendOnEnter;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.setContentSecurityPolicy;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setCryptClassName;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.setCspFontSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.setCspFrameSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.setCspImageSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.setCspMediaSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.setCspScriptSrc;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.setCspStyleSrc;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setDefaultGroup;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setDefaultLang;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setDefaultTimezone;
@@ -97,7 +114,8 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.setSendVerifica
import static org.apache.openmeetings.util.OpenmeetingsVariables.setSipContext;
import static org.apache.openmeetings.util.OpenmeetingsVariables.setSipEnabled;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.setVideoPreset;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.setxFrameOptions;
+import static org.apache.wicket.csp.CSPDirectiveSrcValue.SELF;
+import static org.apache.wicket.csp.CSPDirectiveSrcValue.STRICT_DYNAMIC;
import java.net.UnknownHostException;
import java.util.ArrayList;
@@ -117,10 +135,16 @@ import org.apache.openjpa.event.TCPRemoteCommitProvider;
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
import org.apache.openjpa.persistence.OpenJPAPersistence;
import org.apache.openmeetings.db.dao.IDataProviderDao;
+import org.apache.openmeetings.db.dao.server.OAuth2Dao;
import org.apache.openmeetings.db.dao.user.UserDao;
import org.apache.openmeetings.db.entity.basic.Configuration;
import org.apache.openmeetings.db.util.DaoHelper;
import org.apache.openmeetings.util.crypt.CryptProvider;
+import org.apache.wicket.Application;
+import org.apache.wicket.csp.CSPDirective;
+import org.apache.wicket.csp.CSPHeaderConfiguration;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.util.string.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -154,6 +178,8 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
@Autowired
private UserDao userDao;
+ @Autowired
+ private OAuth2Dao oauthDao;
public void updateClusterAddresses(String addresses) throws
UnknownHostException {
OpenJPAConfiguration cfg =
((OpenJPAEntityManagerSPI)OpenJPAPersistence.cast(em)).getConfiguration();
@@ -328,15 +354,6 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
case CONFIG_SIP_ENABLED:
reloadSipEnabled();
break;
- case CONFIG_GOOGLE_ANALYTICS_CODE:
- reloadGaCode();
- break;
- case CONFIG_CSP_XFRAME:
- reloadXFrameOptions();
- break;
- case CONFIG_HEADER_CSP:
- reloadContentSecurityPolicy();
- break;
case CONFIG_EXT_PROCESS_TTL:
setExtProcessTtl(toInt(value));
break;
@@ -400,6 +417,15 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
case CONFIG_MYROOMS_ENABLED:
reloadMyRoomsEnabled();
break;
+ case CONFIG_GOOGLE_ANALYTICS_CODE:
+ case CONFIG_CSP_FONT:
+ case CONFIG_CSP_FRAME:
+ case CONFIG_CSP_IMAGE:
+ case CONFIG_CSP_MEDIA:
+ case CONFIG_CSP_SCRIPT:
+ case CONFIG_CSP_STYLE:
+ updateCsp();
+ break;
}
return entity;
}
@@ -438,10 +464,6 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
setSipEnabled(getBool(CONFIG_SIP_ENABLED, false));
}
- private void reloadGaCode() {
- setGaCode(getString(CONFIG_GOOGLE_ANALYTICS_CODE, null));
- }
-
private void reloadDefaultLang() {
setDefaultLang(getLong(CONFIG_DEFAULT_LANG, 1L));
}
@@ -523,14 +545,6 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
setSendRegisterEmail(getBool(CONFIG_EMAIL_AT_REGISTER, false));
}
- private void reloadXFrameOptions() {
- setxFrameOptions(getString(CONFIG_CSP_XFRAME,
HEADER_XFRAME_SELF));
- }
-
- private void reloadContentSecurityPolicy() {
- setContentSecurityPolicy(getString(CONFIG_HEADER_CSP,
HEADER_CSP_SELF));
- }
-
private void reloadDisplayNameEditable() {
setDisplayNameEditable(getBool(CONFIG_DISPLAY_NAME_EDITABLE,
false));
}
@@ -546,7 +560,6 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
reloadDefaultLang();
reloadBaseUrl();
reloadSipEnabled();
- reloadGaCode();
reloadAudioRate();
reloadAudioBitrate();
reloadVideoPreset();
@@ -565,10 +578,10 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
reloadAllowRegisterOauth();
reloadSendVerificationEmail();
reloadSendRegisterEmail();
- reloadXFrameOptions();
- reloadContentSecurityPolicy();
reloadDisplayNameEditable();
reloadMyRoomsEnabled();
+
+ updateCsp();
}
private static JSONObject getHotkey(String value) {
@@ -604,4 +617,50 @@ public class ConfigurationDao implements
IDataProviderDao<Configuration> {
}
return getRoomSettings();
}
+
+ private void addCspRule(CSPHeaderConfiguration cspConfig, CSPDirective
key, String val) {
+ addCspRule(cspConfig, key, val, true);
+ }
+
+ private void addCspRule(CSPHeaderConfiguration cspConfig, CSPDirective
key, String val, boolean remove) {
+ if (!Strings.isEmpty(val)) {
+ for(String str : val.split(",")) {
+ if (!Strings.isEmpty(str)) {
+ cspConfig.add(key, str.trim());
+ }
+ }
+ } else if (remove) {
+ cspConfig.remove(key);
+ }
+ }
+
+ public void updateCsp() {
+ setGaCode(getString(CONFIG_GOOGLE_ANALYTICS_CODE, null));
+
+ setCspFontSrc(getString(CONFIG_CSP_FONT, DEFAULT_CSP_FONT));
+ setCspFrameSrc(getString(CONFIG_CSP_FRAME, SELF.getValue()));
+ setCspImageSrc(getString(CONFIG_CSP_IMAGE, DEFAULT_CSP_IMAGE));
+ setCspMediaSrc(getString(CONFIG_CSP_MEDIA, SELF.getValue()));
+ setCspScriptSrc(getString(CONFIG_CSP_SCRIPT,
STRICT_DYNAMIC.getValue()));
+ setCspStyleSrc(getString(CONFIG_CSP_STYLE, DEFAULT_CSP_STYLE));
+ if (Application.exists()) {
+ final CSPHeaderConfiguration cspConfig =
WebApplication.get().getCspSettings().blocking().strict();
+ addCspRule(cspConfig, CSPDirective.FONT_SRC,
getCspFontSrc());
+ addCspRule(cspConfig, CSPDirective.FRAME_SRC,
getCspFrameSrc());
+ addCspRule(cspConfig, CSPDirective.IMG_SRC,
getCspImageSrc());
+ addCspRule(cspConfig, CSPDirective.MEDIA_SRC,
getCspMediaSrc());
+ addCspRule(cspConfig, CSPDirective.SCRIPT_SRC,
getCspScriptSrc());
+ addCspRule(cspConfig, CSPDirective.STYLE_SRC,
getCspStyleSrc());
+ if (!Strings.isEmpty(getGaCode())) {
+ //
https://developers.google.com/tag-manager/web/csp#universal_analytics_google_analytics
+ addCspRule(cspConfig, CSPDirective.IMG_SRC,
"https://www.google-analytics.com");
+ addCspRule(cspConfig, CSPDirective.SCRIPT_SRC,
"https://www.google-analytics.com, https://ssl.google-analytics.com");
+ }
+ oauthDao.getActive().forEach(oauth -> {
+ if (!Strings.isEmpty(oauth.getIconUrl())) {
+ addCspRule(cspConfig,
CSPDirective.IMG_SRC, oauth.getIconUrl(), false);
+ }
+ });
+ }
+ }
}
diff --git
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/OAuth2Dao.java
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/OAuth2Dao.java
index 3f1c05c..4a48779 100644
---
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/OAuth2Dao.java
+++
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/OAuth2Dao.java
@@ -30,8 +30,10 @@ import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import org.apache.openmeetings.db.dao.IDataProviderDao;
+import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
import org.apache.openmeetings.db.entity.server.OAuthServer;
import org.apache.openmeetings.db.util.DaoHelper;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@@ -41,6 +43,8 @@ public class OAuth2Dao implements
IDataProviderDao<OAuthServer> {
private static final String[] searchFields = {"name"};
@PersistenceContext
private EntityManager em;
+ @Autowired
+ private ConfigurationDao cfgDao;;
public List<OAuthServer> getActive() {
if (!isAllowRegisterOauth()) {
@@ -90,6 +94,7 @@ public class OAuth2Dao implements
IDataProviderDao<OAuthServer> {
server.setUpdated(new Date());
server = em.merge(server);
}
+ cfgDao.updateCsp();
return server;
}
diff --git
a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
index af849b6..891fb88 100644
---
a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
+++
b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
@@ -88,6 +88,7 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPOINTM
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CALENDAR_ROOM_CAPACITY;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CAM_FPS;
import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_FRAME;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_RSS_FEED1;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_RSS_FEED2;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_SHOW_CHAT;
@@ -265,6 +266,7 @@ public class BackupImport {
outdatedConfigKeys.put("swftools_jpegquality",
CONFIG_DOCUMENT_QUALITY);
outdatedConfigKeys.put("sms.subject", CONFIG_REMINDER_MESSAGE);
outdatedConfigKeys.put("exclusive.audio.keycode",
CONFIG_KEYCODE_MUTE_OTHERS);
+ outdatedConfigKeys.put("header.csp.frame.options",
CONFIG_CSP_FRAME);
configTypes.put(CONFIG_REGISTER_FRONTEND,
Configuration.Type.BOOL);
configTypes.put(CONFIG_REGISTER_SOAP, Configuration.Type.BOOL);
configTypes.put(CONFIG_REGISTER_OAUTH, Configuration.Type.BOOL);
diff --git
a/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
b/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
index 2607599..671699a 100644
---
a/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
+++
b/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
@@ -31,7 +31,12 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CALENDAR
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CAM_FPS;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CHAT_SEND_ON_ENTER;
import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_XFRAME;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_FONT;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_FRAME;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_IMAGE;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_MEDIA;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_SCRIPT;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CSP_STYLE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_RSS_FEED1;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_RSS_FEED2;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_SHOW_CHAT;
@@ -50,7 +55,6 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_EMAIL_VE
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_EXT_PROCESS_TTL;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FNAME_MIN_LENGTH;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_GOOGLE_ANALYTICS_CODE;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_HEADER_CSP;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IGNORE_BAD_SSL;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_KEYCODE_ARRANGE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_KEYCODE_ARRANGE_RESIZE;
@@ -95,16 +99,19 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SMTP_TIM
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SMTP_TLS;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SMTP_USER;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_APP_NAME;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_CSP_FONT;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_CSP_IMAGE;
+import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_CSP_STYLE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_MAX_UPLOAD_SIZE;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.DEFAULT_MINUTES_REMINDER_SEND;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.HEADER_CSP_SELF;
-import static
org.apache.openmeetings.util.OpenmeetingsVariables.HEADER_XFRAME_SELF;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.USER_LOGIN_MINIMUM_LENGTH;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.USER_PASSWORD_MINIMUM_LENGTH;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.getAudioBitrate;
import static org.apache.openmeetings.util.OpenmeetingsVariables.getAudioRate;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.getDefaultGroup;
import static
org.apache.openmeetings.util.OpenmeetingsVariables.getExtProcessTtl;
+import static org.apache.wicket.csp.CSPDirectiveSrcValue.SELF;
+import static org.apache.wicket.csp.CSPDirectiveSrcValue.STRICT_DYNAMIC;
import java.util.ArrayList;
import java.util.Date;
@@ -333,7 +340,6 @@ public class ImportInitvalues {
addCfg(list, CONFIG_REDIRECT_URL_FOR_EXTERNAL, "",
Configuration.Type.STRING,
"Users entered the room via invitationHash or
secureHash will be redirected to this URL on connection lost", VER_3_0);
addCfg(list, CONFIG_GOOGLE_ANALYTICS_CODE, null,
Configuration.Type.STRING, "Code for Google Analytics", "3.1.0");
- addCfg(list, CONFIG_HEADER_CSP, HEADER_CSP_SELF,
Configuration.Type.STRING, String.format("Value for 'Content-Security-Policy'
header (default: %s), have to be modified to enable Google analytics site:
https://content-security-policy.com/", HEADER_CSP_SELF), VER_3_3_0);
addCfg(list, CONFIG_EXT_PROCESS_TTL,
String.valueOf(getExtProcessTtl()), Configuration.Type.NUMBER,
String.format("Time to live in minutes for external processes such as
conversion via ffmpeg (default %s minutes)", getExtProcessTtl()), VER_3_3_0);
addCfg(list, CONFIG_MYROOMS_ENABLED, String.valueOf(true),
Configuration.Type.BOOL, "Users are allowed to create personal rooms", "3.3.2");
addCfg(list, CONFIG_REMINDER_MESSAGE, null,
Configuration.Type.STRING, "Reminder message to notify about upcoming
appointment, generated message will be used if not set", VER_2_0);
@@ -353,13 +359,25 @@ public class ImportInitvalues {
addCfg(list, CONFIG_MIC_RATE, "22", Configuration.Type.NUMBER,
"The rate at which the microphone should capture sound, in kHz. The default
value is 22 kHz.", VER_5_0_0);
addCfg(list, CONFIG_MIC_ECHO, String.valueOf(true),
Configuration.Type.BOOL, "Whether or not echo cancellation is preferred and/or
required.", VER_5_0_0);
addCfg(list, CONFIG_MIC_NOISE, String.valueOf(true),
Configuration.Type.BOOL, "Whether noise suppression is preferred and/or
required.", VER_5_0_0);
- addCfg(list, CONFIG_CSP_XFRAME, HEADER_XFRAME_SELF,
Configuration.Type.STRING, String.format("Value for 'frame-src' directive of
'Content-Security-Policy' header (default: %s), more info:
https://w3c.github.io/webappsec-csp/", HEADER_XFRAME_SELF), VER_5_0_0);
addCfg(list, CONFIG_DISPLAY_NAME_EDITABLE,
String.valueOf(false), Configuration.Type.BOOL, "Is user will be able to edit
his/her display name (default false).", "4.0.7");
addCfg(list, CONFIG_KEYCODE_QUICKPOLL, "Ctrl+Alt+KeyQ",
Configuration.Type.HOTKEY
, "A hot key code to start quick poll",
"4.0.10");
addCfg(list, CONFIG_AUTO_OPEN_SHARING, String.valueOf(false),
Configuration.Type.BOOL, "Whether shared screen should be auto-opened.",
VER_5_0_0);
addCfg(list, CONFIG_KEYCODE_ARRANGE_RESIZE, "Ctrl+Shift+KeyA",
Configuration.Type.HOTKEY
, "A hot key code to arrange video windows
bottom-to-top with resize to 120x90", VER_5_0_0);
+ final String cspMore = ", more info:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy";
+ addCfg(list, CONFIG_CSP_FONT, DEFAULT_CSP_FONT,
Configuration.Type.STRING, String.format("Value for 'font-src' directive of
'Content-Security-Policy' header (default: %s)"
+ + cspMore, DEFAULT_CSP_FONT), VER_5_0_0);
+ addCfg(list, CONFIG_CSP_FRAME, SELF.getValue(),
Configuration.Type.STRING, String.format("Value for 'frame-src' directive of
'Content-Security-Policy' header (default: %s)"
+ + cspMore, SELF), VER_5_0_0);
+ addCfg(list, CONFIG_CSP_IMAGE, DEFAULT_CSP_IMAGE,
Configuration.Type.STRING, String.format("Value for 'image-src' directive of
'Content-Security-Policy' header (default: %s)"
+ + cspMore, DEFAULT_CSP_IMAGE), VER_5_0_0);
+ addCfg(list, CONFIG_CSP_MEDIA, SELF.getValue(),
Configuration.Type.STRING, String.format("Value for 'media-src' directive of
'Content-Security-Policy' header (default: %s)"
+ + cspMore, SELF), VER_5_0_0);
+ addCfg(list, CONFIG_CSP_SCRIPT, STRICT_DYNAMIC.getValue(),
Configuration.Type.STRING, String.format("Value for 'script-src' directive of
'Content-Security-Policy' header (default: %s)"
+ + cspMore, STRICT_DYNAMIC), VER_5_0_0);
+ addCfg(list, CONFIG_CSP_STYLE, DEFAULT_CSP_STYLE,
Configuration.Type.STRING, String.format("Value for 'style-src' directive of
'Content-Security-Policy' header (default: %s)"
+ + cspMore, DEFAULT_CSP_STYLE), VER_5_0_0);
return list;
}
public void loadConfiguration(InstallationConfig cfg) {
diff --git
a/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
b/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
index 544ddd6..beee700 100644
---
a/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
+++
b/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
@@ -18,6 +18,9 @@
*/
package org.apache.openmeetings.util;
+import static org.apache.wicket.csp.CSPDirectiveSrcValue.SELF;
+import static org.apache.wicket.csp.CSPDirectiveSrcValue.STRICT_DYNAMIC;
+
import com.github.openjson.JSONObject;
public class OpenmeetingsVariables {
@@ -75,9 +78,7 @@ public class OpenmeetingsVariables {
public static final String CONFIG_MIC_RATE = "mic.rate";
public static final String CONFIG_MIC_ECHO = "mic.echo.cancellation";
public static final String CONFIG_MIC_NOISE = "mic.noise.suppression";
- public static final String CONFIG_CSP_XFRAME =
"header.csp.frame.options";
public static final String CONFIG_EXT_PROCESS_TTL =
"external.process.ttl";
- public static final String CONFIG_HEADER_CSP =
"header.content.security.policy";
public static final String CONFIG_EMAIL_AT_REGISTER =
"send.email.at.register";
public static final String CONFIG_EMAIL_VERIFICATION =
"send.email.with.verfication";
public static final String CONFIG_CALENDAR_ROOM_CAPACITY =
"calendar.conference.rooms.default.size";
@@ -98,9 +99,13 @@ public class OpenmeetingsVariables {
public static final String CONFIG_KEYCODE_QUICKPOLL =
"start.quickpoll.keycode";
public static final String CONFIG_AUTO_OPEN_SHARING =
"auto.open.sharing";
public static final String CONFIG_KEYCODE_ARRANGE_RESIZE =
"video.arrange.resize.keycode";
+ public static final String CONFIG_CSP_FONT = "header.csp.font";
+ public static final String CONFIG_CSP_FRAME = "header.csp.frame";
+ public static final String CONFIG_CSP_IMAGE = "header.csp.image";
+ public static final String CONFIG_CSP_MEDIA = "header.csp.media";
+ public static final String CONFIG_CSP_SCRIPT = "header.csp.script";
+ public static final String CONFIG_CSP_STYLE = "header.csp.style";
- public static final String HEADER_XFRAME_SELF = "'self'";
- public static final String HEADER_CSP_SELF = "default-src 'self';
style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'
'unsafe-eval'; img-src 'self' data:; media-src 'self' blob:;";
public static final int RECENT_ROOMS_COUNT = 5;
public static final int USER_LOGIN_MINIMUM_LENGTH = 4;
public static final int USER_PASSWORD_MINIMUM_LENGTH = 8;
@@ -110,6 +115,9 @@ public class OpenmeetingsVariables {
public static final int DEFAULT_MINUTES_REMINDER_SEND = 15;
public static final String DEFAULT_BASE_URL =
"http://localhost:5080/openmeetings/";
public static final String DEFAULT_SIP_CONTEXT = "rooms";
+ public static final String DEFAULT_CSP_FONT =
"https://fonts.gstatic.com";
+ public static final String DEFAULT_CSP_STYLE =
"https://fonts.googleapis.com/css";
+ public static final String DEFAULT_CSP_IMAGE = "data:";
private static String cryptClassName = null;
private static String wicketApplicationName = null;
@@ -140,10 +148,14 @@ public class OpenmeetingsVariables {
private static boolean allowRegisterOauth = false;
private static boolean sendVerificationEmail = false;
private static boolean sendRegisterEmail = false;
- private static String contentSecurityPolicy = HEADER_CSP_SELF;
- private static String xFrameOptions = HEADER_XFRAME_SELF;
private static boolean displayNameEditable = false;
private static boolean myRoomsEnabled = true;
+ private static String cspFontSrc = DEFAULT_CSP_FONT;
+ private static String cspFrameSrc = SELF.getValue();
+ private static String cspImageSrc = DEFAULT_CSP_IMAGE;
+ private static String cspMediaSrc = SELF.getValue();
+ private static String cspScriptSrc = STRICT_DYNAMIC.getValue();
+ private static String cspStyleSrc = DEFAULT_CSP_STYLE;
private OpenmeetingsVariables() {}
@@ -383,22 +395,6 @@ public class OpenmeetingsVariables {
sendRegisterEmail = send;
}
- public static String getxFrameOptions() {
- return xFrameOptions;
- }
-
- public static void setxFrameOptions(String options) {
- xFrameOptions = options;
- }
-
- public static String getContentSecurityPolicy() {
- return contentSecurityPolicy;
- }
-
- public static void setContentSecurityPolicy(String policy) {
- contentSecurityPolicy = policy;
- }
-
public static boolean isDisplayNameEditable() {
return displayNameEditable;
}
@@ -414,4 +410,52 @@ public class OpenmeetingsVariables {
public static void setMyRoomsEnabled(boolean enabled) {
myRoomsEnabled = enabled;
}
+
+ public static String getCspFontSrc() {
+ return cspFontSrc;
+ }
+
+ public static void setCspFontSrc(String src) {
+ cspFontSrc = src;
+ }
+
+ public static String getCspFrameSrc() {
+ return cspFrameSrc;
+ }
+
+ public static void setCspFrameSrc(String src) {
+ cspFrameSrc = src;
+ }
+
+ public static String getCspImageSrc() {
+ return cspImageSrc;
+ }
+
+ public static void setCspImageSrc(String src) {
+ cspImageSrc = src;
+ }
+
+ public static String getCspMediaSrc() {
+ return cspMediaSrc;
+ }
+
+ public static void setCspMediaSrc(String src) {
+ cspMediaSrc = src;
+ }
+
+ public static String getCspScriptSrc() {
+ return cspScriptSrc;
+ }
+
+ public static void setCspScriptSrc(String src) {
+ cspScriptSrc = src;
+ }
+
+ public static String getCspStyleSrc() {
+ return cspStyleSrc;
+ }
+
+ public static void setCspStyleSrc(String src) {
+ cspStyleSrc = src;
+ }
}
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
index 74fc3d7..7f81153 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
@@ -50,7 +50,6 @@ import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
import org.apache.openmeetings.db.dao.label.LabelDao;
import org.apache.openmeetings.db.dao.record.RecordingDao;
-import org.apache.openmeetings.db.dao.server.OAuth2Dao;
import org.apache.openmeetings.db.dao.user.UserDao;
import org.apache.openmeetings.db.entity.basic.Client;
import org.apache.openmeetings.db.entity.calendar.Appointment;
@@ -103,9 +102,6 @@ import
org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
import
org.apache.wicket.core.request.handler.BookmarkableListenerRequestHandler;
import org.apache.wicket.core.request.handler.ListenerRequestHandler;
import org.apache.wicket.core.request.mapper.MountedMapper;
-import org.apache.wicket.csp.CSPDirective;
-import org.apache.wicket.csp.CSPDirectiveSrcValue;
-import org.apache.wicket.csp.CSPHeaderConfiguration;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.filter.FilteringHeaderResponse;
import org.apache.wicket.markup.html.IHeaderResponseDecorator;
@@ -184,8 +180,6 @@ public class Application extends
AuthenticatedWebApplication implements IApplica
private ClientManager cm;
@Autowired
private AppointmentDao appointmentDao;
- @Autowired
- private OAuth2Dao oauthDao;
@Override
protected void init() {
@@ -256,7 +250,6 @@ public class Application extends
AuthenticatedWebApplication implements IApplica
//chain of Resource Loaders, if not found it will search in
Wicket's internal
//Resource Loader for a the property key
getResourceSettings().getStringResourceLoaders().add(0, new
LabelResourceLoader());
- final CSPHeaderConfiguration cspConfig =
getCspConfig().strict();
getRequestCycleListeners().add(new
WebSocketAwareCsrfPreventionRequestCycleListener() {
@Override
public void onEndRequest(RequestCycle cycle) {
@@ -267,13 +260,6 @@ public class Application extends
AuthenticatedWebApplication implements IApplica
wresp.setHeader("X-XSS-Protection", "1; mode=block");
wresp.setHeader("Strict-Transport-Security", "max-age=31536000;
includeSubDomains; preload");
wresp.setHeader("X-Content-Type-Options", "nosniff");
- /*Url reqUrl =
cycle.getRequest().getUrl();
-
wresp.setHeader("Content-Security-Policy"
- ,
String.format("%s; connect-src 'self' %s; frame-src %s;"
-
, getContentSecurityPolicy(), getWsUrl(reqUrl)
-
, getxFrameOptions()
- ));
- */
}
}
}
@@ -343,16 +329,6 @@ public class Application extends
AuthenticatedWebApplication implements IApplica
setExtProcessTtl(cfgDao.getInt(CONFIG_EXT_PROCESS_TTL,
getExtProcessTtl()));
Version.logOMStarted();
recordingDao.resetProcessingStatus(); //we are starting
so all processing recordings are now errors
-
- getCspSettings().blocking().disabled(); //FIXME TODO
due to `reporting-only enabled`
- oauthDao.getActive().forEach(oauth -> {
- if (!Strings.isEmpty(oauth.getIconUrl())) {
- cspConfig.add(CSPDirective.IMG_SRC,
oauth.getIconUrl());
- }
- });
- cspConfig.add(CSPDirective.STYLE_SRC,
"https://fonts.googleapis.com/css"); //Roboto font FIXME TODO should this be
moved to configs???
- cspConfig.add(CSPDirective.FONT_SRC,
"https://fonts.gstatic.com"); //Roboto font FIXME TODO should this be moved to
configs???
- cspConfig.add(CSPDirective.MEDIA_SRC,
CSPDirectiveSrcValue.SELF);
setInitComplete(true);
} catch (Exception err) {
log.error("[appStart]", err);
@@ -383,10 +359,6 @@ public class Application extends
AuthenticatedWebApplication implements IApplica
}
}
- public CSPHeaderConfiguration getCspConfig() {
- return getCspSettings().reporting();
- }
-
public static OmAuthenticationStrategy getAuthenticationStrategy() {
return
(OmAuthenticationStrategy)get().getSecuritySettings().getAuthenticationStrategy();
}
@@ -644,21 +616,4 @@ public class Application extends
AuthenticatedWebApplication implements IApplica
public void publishWsTopic(IClusterWsMessage msg) {
hazelWsTopic.publish(msg);
}
-
- private static String getWsUrl(Url reqUrl) {
- final boolean insecure =
"http".equalsIgnoreCase(reqUrl.getProtocol());
- String delim = ":";
- String port = reqUrl.getPort() == null || reqUrl.getPort() < 0
? "" : String.valueOf(reqUrl.getPort());
- if (!port.isEmpty() && ((insecure && 80 == reqUrl.getPort()) ||
(!insecure && 443 == reqUrl.getPort()))) {
- port = "";
- }
- if (port.isEmpty()) {
- delim = "";
- }
- return String.format("%s://%s%s%s;"
- , insecure ? "ws" : "wss"
- , reqUrl.getHost()
- , delim
- , port);
- }
}
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/confirmation/bootstrap-confirmation.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/confirmation/bootstrap-confirmation.js
index 1f0b16a..72fd81a 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/confirmation/bootstrap-confirmation.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/confirmation/bootstrap-confirmation.js
@@ -594,4 +594,3 @@
};
}));
-//# sourceMappingURL=bootstrap-confirmation.js.map
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/ActivitiesPanel.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/ActivitiesPanel.html
index 394c637..8fccb7c 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/ActivitiesPanel.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/ActivitiesPanel.html
@@ -21,7 +21,7 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
- <div class="clickable control block bg-secondary"
onclick="Activities.toggle();">
+ <div class="clickable control block bg-secondary">
<i class="fas ml-1 fa-angle-up"></i>
<span class="badge badge-secondary">42</span>
<div class="label"><wicket:message key="1363"/></div>
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
index 8126993..6ac0b1e 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
@@ -111,6 +111,7 @@ var Activities = function() {
return;
}
activities = $('#activities');
+
activities.find('.control.block').off().click(Activities.toggle);
activities.resizable({
handles: 'n'
, disabled: isClosed()
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.html
index ed2b904..1d173f8 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.html
@@ -30,7 +30,7 @@
<span wicket:id="ask" class="detail-btn btn
btn-outline-secondary ask">
<i class="fas fa-hand-paper m-0"></i>
</span>
- <span wicket:id="share" class="detail-btn btn
btn-outline-secondary share" wicket:message="title:732"
onclick="Sharer.open();">
+ <span id="share-dlg-btn" wicket:id="share" class="detail-btn
btn btn-outline-secondary share" wicket:message="title:732">
<i class="fas fa-desktop m-0"></i>
</span>
<span wicket:id="roomName" class="room name"></span>
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.java
index 3fd0f22..063e7db 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.java
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/RoomMenuPanel.java
@@ -237,6 +237,7 @@ public class RoomMenuPanel extends Panel {
handler.add(roomName.add(AttributeModifier.replace(ATTR_CLASS,
roomClass), AttributeModifier.replace(ATTR_TITLE, roomTitle)));
handler.add(askBtn.setVisible(!moder &&
r.isAllowUserQuestions()));
handler.add(shareBtn.setVisible(room.screenShareAllowed()));
+
handler.appendJavaScript("$('#share-dlg-btn').off().click(Sharer.open);");
}
public void updatePoll(IPartialPageRequestHandler handler, Long
createdBy) {
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/SipDialerDialog.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/SipDialerDialog.html
index 8adbc61..2b4b38d 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/SipDialerDialog.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/menu/SipDialerDialog.html
@@ -49,10 +49,5 @@
</div>
</div>
<div wicket:id="feedback"></div>
- <script type="text/javascript">
- $('.sip').on('keydown', sipKeyDown).on('keyup', sipKeyUp);
- $('.sip .button-row button').button().on('click', sipBtnClick);
- $('#sip-dialer-btn-erase').button().on('click',
sipBtnEraseClick);
- </script>
</wicket:panel>
</html>
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
index dc58aad..6329315 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
@@ -26,6 +26,14 @@ var Room = (function() {
});
});
__dockSetMode(true);
+ const header = $('#room-sidebar-tab-users .header');
+
header.find('.om-icon.settings').off().click(VideoSettings.open);
+ header.find('.om-icon.activity.cam').off().click(function() {
+ VideoManager.toggleActivity('VIDEO');
+ });
+ header.find('.om-icon.activity.mic').off().click(function() {
+ VideoManager.toggleActivity('AUDIO');
+ });
menuHeight = menu.length === 0 ? 0 : menu.height();
VideoManager.init();
if (typeof(Activities) !== 'undefined') {
@@ -505,3 +513,8 @@ function typingActivity(uid, active) {
u.removeClass("typing");
}
}
+$(function() {
+ $('.sip').on('keydown', sipKeyDown).on('keyup', sipKeyUp);
+ $('.sip .button-row button').button().click(sipBtnClick);
+ $('#sip-dialer-btn-erase').button().click(sipBtnEraseClick);
+});
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-settings.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-settings.js
index 444bee7..60f26c2 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-settings.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-settings.js
@@ -304,6 +304,9 @@ var VideoSettings = (function() {
options
, function(error) {
if (error) {
+ if (true ===
this.cleaned) {
+ return;
+ }
return
OmUtil.error(error);
}
if (cnts.audio) {
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
index ea936d8..7b37644 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
@@ -43,9 +43,9 @@
<div class="tab-content">
<div id="room-sidebar-tab-users" class="tab-pane fade
show active" role="tabpanel" aria-labelledby="room-sidebar-users-tab">
<div class="header">
- <span class="om-icon align-left
settings clickable" onclick="VideoSettings.open();"
wicket:message="title:306"></span>
- <span class="om-icon align-left
activity cam clickable" onclick="VideoManager.toggleActivity('VIDEO');"
wicket:message="data-on:camera.on,data-off:camera.off"></span>
- <span class="om-icon align-left
activity mic bumper clickable" onclick="VideoManager.toggleActivity('AUDIO');"
wicket:message="data-on:microphone.on,data-off:microphone.off"></span>
+ <span class="om-icon align-left
settings clickable" wicket:message="title:306"></span>
+ <span class="om-icon align-left
activity cam clickable"
wicket:message="data-on:camera.on,data-off:camera.off"></span>
+ <span class="om-icon align-left
activity mic bumper clickable"
wicket:message="data-on:microphone.on,data-off:microphone.off"></span>
</div>
<div class="user-list clear"> <!--
auto-scrollable -->
<div class="users"> <!-- content -->
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/MathJax.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/MathJax.js
index 319e008..3397d05 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/MathJax.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/MathJax.js
@@ -994,6 +994,9 @@ MathJax.cdnFileVersions = {}; // can be used to specify
revisions for individua
// and values).
//
Styles: function (styles,callback) {
+ callback = BASE.Callback(callback);
+ callback();
+ /* MODIFIED BY SOLOMAX TO COMPLY WITH CSP
var styleString = this.StyleString(styles);
if (styleString === "") {
callback = BASE.Callback(callback);
@@ -1008,7 +1011,7 @@ MathJax.cdnFileVersions = {}; // can be used to specify
revisions for individua
style.appendChild(document.createTextNode(styleString));
}
callback = this.timer.create.call(this,callback,style);
- }
+ }*/
return callback;
},
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
index 31af989..217872b 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
@@ -176,7 +176,7 @@ var DrawWbArea = function() {
elems.find('button').remove();
}
links.off()
- .on('click', function(e) {
+ .click(function(e) {
e.preventDefault();
if (role === PRESENTER) {
_actionActivateWb($(this).data('wb-id'));
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js
index 884feaf..387a7a6 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-board.js
@@ -766,10 +766,14 @@ var Wb = function() {
sc.off('scroll', scrollHandler);
} else {
tools = OmUtil.tmpl('#wb-tools');
- settings = OmUtil.tmpl('#wb-tool-settings')
- .attr('style', 'display: none; bottom:
100px; ' + (Settings.isRtl ? 'left' : 'right') + ': 100px;');
- math = OmUtil.tmpl('#wb-formula')
- .attr('style', 'display: none; bottom:
100px; ' + (Settings.isRtl ? 'left' : 'right') + ': 100px;');
+ settings = OmUtil.tmpl('#wb-tool-settings');
+ settings[0].style.display = 'none';
+ settings[0].style.bottom = '100px';
+ settings[0].style[(Settings.isRtl ? 'left' :
'right')] = '100px';
+ math = OmUtil.tmpl('#wb-formula');
+ math[0].style.display = 'none';
+ math[0].style.bottom = '100px';
+ math[0].style[(Settings.isRtl ? 'left' :
'right')] = '100px';
wbEl.append(settings, math);
sc.on('scroll', scrollHandler);
}
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/ChatToolbar.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/ChatToolbar.html
index e532de0..c5df779 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/ChatToolbar.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/ChatToolbar.html
@@ -55,7 +55,7 @@
<i class="fas fa-link"></i>
</a>
<div class="dropdown-menu input-append">
- <input class="span2" placeholder="URL"
type="text" onkeypress="if (event.keyCode === 13)
{$(this).parent().find('button').trigger('click');}; return event.keyCode !==
13;"/>
+ <input class="span2 link-field"
placeholder="URL" type="text"/>
<button class="btn btn-outline-secondary"
type="button"><wicket:message key="1261"/></button>
</div>
</div>
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/raw-chat.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/raw-chat.js
index 6f30673..30b90a4 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/raw-chat.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/chat/raw-chat.js
@@ -199,6 +199,12 @@ var Chat = function() {
typingTimer = setTimeout(doneTyping,
doneTypingInterval);
}
});
+ $('#chat .chat-toolbar .link-field').off().on('keypress',
function() {
+ if (event.keyCode === 13) {
+
$(this).parent().find('button').trigger('click');
+ };
+ return event.keyCode !== 13;
+ });
inited = true;
}
function _removeTab(id) {
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.html
index 0beed67..18a605d 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.html
@@ -26,8 +26,7 @@
<table class="messages">
<tr>
<td class="side left">
- <div class="email new btn btn-sm
btn-outline-primary
- " onclick="privateMessage();"
wicket:message="title:1208">
+ <div class="email new btn btn-sm
btn-outline-primary" wicket:message="title:1208">
<i class="fas fa-envelope"></i>
<wicket:message key="1207"/>
</div>
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java
index 5cc1fb9..a5c7700 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java
@@ -25,7 +25,6 @@ import static
org.apache.openmeetings.util.OpenmeetingsVariables.ATTR_CLASS;
import static org.apache.openmeetings.web.app.WebSession.getDateFormat;
import static org.apache.openmeetings.web.app.WebSession.getUserId;
import static
org.apache.openmeetings.web.common.confirmation.ConfirmableAjaxBorder.newOkCancelDangerConfirm;
-import static
org.apache.openmeetings.web.util.CallbackFunctionHelper.addOnClick;
import java.util.ArrayList;
import java.util.HashSet;
@@ -480,8 +479,8 @@ public class MessagesContactsPanel extends UserBasePanel {
updateContacts(target);
}
}).setVisible(uc.isPending()));
- item.add(new
WebMarkupContainer("view").add(addOnClick(String.format("showUserInfo(%s);",
userId))));
- item.add(new
WebMarkupContainer("message").add(addOnClick(String.format("privateMessage(%s);",
userId))).setVisible(!uc.isPending()));
+ item.add(new
WebMarkupContainer("view").add(AttributeModifier.append("data-user-id",
userId)));
+ item.add(new
WebMarkupContainer("message").add(AttributeModifier.append("data-user-id",
userId)).setVisible(!uc.isPending()));
BootstrapAjaxLink<String> del = new
BootstrapAjaxLink<>("delete", Buttons.Type.Outline_Danger) {
private static final long
serialVersionUID = 1L;
@@ -626,10 +625,18 @@ public class MessagesContactsPanel extends UserBasePanel {
allContacts.setDefaultModelObject(contactDao.getContactsByUserAndStatus(getUserId(),
false).size());
if (target != null) {
target.add(contacts);
+ target.appendJavaScript("$('.messages
.user.om-icon.clickable').off().click(function()
{showUserInfo($(this).data('user-id'));});");
+ target.appendJavaScript("$('.messages
.new-email.om-icon.clickable').click(function()
{privateMessage($(this).data('user-id'));});");
}
}
@Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+
response.render(OnDomReadyHeaderItem.forScript("$('.email.new.btn').click(privateMessage)"));
+ }
+
+ @Override
public void onNewMessageClose(IPartialPageRequestHandler handler) {
handler.add(container);
}
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.html
index 9d7402a..752df1c 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.html
@@ -54,10 +54,10 @@
<td class="col-2"
wicket:id="offer"></td>
<td class="col-3"
wicket:id="search"></td>
<td class="col-2 text-nowrap">
- <div wicket:id="add"
class="om-icon clickable" wicket:message="title:1186"><i class="fas
fa-plus-circle"></i></div>
- <div
wicket:id="message" class="om-icon clickable" wicket:message="title:1253"><i
class="fas fa-envelope"></i></div>
- <div wicket:id="view"
class="om-icon clickable" wicket:message="title:1236"><i class="fas
fa-address-card"></i></div>
- <div wicket:id="invite"
class="om-icon clickable" wicket:message="title:1131"><i class="fas
fa-link"></i></div></td>
+ <div wicket:id="add"
class="contact-add om-icon clickable" wicket:message="title:1186"><i class="fas
fa-plus-circle"></i></div>
+ <div
wicket:id="message" class="new-msg om-icon clickable"
wicket:message="title:1253"><i class="fas fa-envelope"></i></div>
+ <div wicket:id="view"
class="profile om-icon clickable" wicket:message="title:1236"><i class="fas
fa-address-card"></i></div>
+ <div wicket:id="invite"
class="invite om-icon clickable" wicket:message="title:1131"><i class="fas
fa-link"></i></div></td>
</tr>
</tbody>
</table>
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
index 5d6566c..04a47af 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
@@ -21,7 +21,6 @@ package org.apache.openmeetings.web.user.profile;
import static org.apache.openmeetings.db.util.TimezoneUtil.getTimeZone;
import static org.apache.openmeetings.util.OpenmeetingsVariables.ATTR_CLASS;
import static org.apache.openmeetings.web.app.WebSession.getUserId;
-import static
org.apache.openmeetings.web.util.CallbackFunctionHelper.addOnClick;
import java.util.ArrayList;
import java.util.Iterator;
@@ -122,11 +121,11 @@ public class UserSearchPanel extends UserBasePanel {
item.add(new Label("tz",
getTimeZone(u).getID()));
item.add(new Label("offer", u.getUserOffers()));
item.add(new Label("search",
u.getUserSearchs()));
- item.add(new
WebMarkupContainer("view").add(addOnClick(String.format("showUserInfo(%s);",
userId))));
+ item.add(new
WebMarkupContainer("view").add(AttributeModifier.append("data-user-id",
userId)));
item.add(new
WebMarkupContainer("add").setVisible(userId != getUserId() &&
!contactDao.isContact(userId, getUserId()))
-
.add(addOnClick(String.format("addContact(%s);", userId))));
- item.add(new
WebMarkupContainer("message").setVisible(userId !=
getUserId()).add(addOnClick(String.format("privateMessage(%s);", userId))));
- item.add(new
WebMarkupContainer("invite").setVisible(userId !=
getUserId()).add(addOnClick(String.format("inviteUser(%s);", userId))));
+
.add(AttributeModifier.append("data-user-id", userId)));
+ item.add(new
WebMarkupContainer("message").setVisible(userId !=
getUserId()).add(AttributeModifier.append("data-user-id", userId)));
+ item.add(new
WebMarkupContainer("invite").setVisible(userId !=
getUserId()).add(AttributeModifier.append("data-user-id", userId)));
}
};
@@ -142,6 +141,10 @@ public class UserSearchPanel extends UserBasePanel {
private void refresh(IPartialPageRequestHandler handler) {
handler.add(container);
+ handler.appendJavaScript("$('#searchUsersTable
.contact-add.om-icon.clickable').off().click(function()
{addContact($(this).data('user-id'));});");
+ handler.appendJavaScript("$('#searchUsersTable
.new-msg.om-icon.clickable').off().click(function()
{privateMessage($(this).data('user-id'));});");
+ handler.appendJavaScript("$('#searchUsersTable
.profile.om-icon.clickable').off().click(function()
{showUserInfo($(this).data('user-id'));});");
+ handler.appendJavaScript("$('#searchUsersTable
.invite.om-icon.clickable').off().click(function()
{inviteUser($(this).data('user-id'));});");
}
private static String getName(User u) {
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/CallbackFunctionHelper.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/CallbackFunctionHelper.java
index c9d1808..7e1057c 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/CallbackFunctionHelper.java
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/CallbackFunctionHelper.java
@@ -18,9 +18,6 @@ package org.apache.openmeetings.web.util;
import static java.util.UUID.randomUUID;
-import java.io.Serializable;
-
-import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.attributes.CallbackParameter;
@@ -58,8 +55,4 @@ public class CallbackFunctionHelper {
String uid = randomUUID().toString();
return JavaScriptHeaderItem.forScript(getNamedFunctionStr(name,
b, extraParameters), String.format("%s-%s", name, uid));
}
-
- public static AttributeModifier addOnClick(Serializable handler) {
- return AttributeModifier.replace("onclick", handler);
- }
}
diff --git a/openmeetings-web/src/main/webapp/css/raw-wb.css
b/openmeetings-web/src/main/webapp/css/raw-wb.css
index b49f668..9f1587c 100644
--- a/openmeetings-web/src/main/webapp/css/raw-wb.css
+++ b/openmeetings-web/src/main/webapp/css/raw-wb.css
@@ -329,3 +329,22 @@ html[dir="rtl"] .room-block .sb-wb .wb-block {
#wb-rename-menu {
display: none;
}
+/* MathJax*/
+.MathJax_SVG_Display {text-align: center; margin: 1em 0em; position: relative;
display: block!important; text-indent: 0; max-width: none; max-height: none;
min-width: 0; min-height: 0; width: 100%}
+.MathJax_SVG .MJX-monospace {font-family: monospace}
+.MathJax_SVG .MJX-sans-serif {font-family: sans-serif}
+#MathJax_SVG_Tooltip {background-color: InfoBackground; color: InfoText;
border: 1px solid black; box-shadow: 2px 2px 5px #AAAAAA; -webkit-box-shadow:
2px 2px 5px #AAAAAA; -moz-box-shadow: 2px 2px 5px #AAAAAA; -khtml-box-shadow:
2px 2px 5px #AAAAAA; padding: 3px 4px; z-index: 401; position: absolute; left:
0; top: 0; width: auto; height: auto; display: none}
+.MathJax_SVG {display: inline; font-style: normal; font-weight: normal;
line-height: normal; font-size: 100%; font-size-adjust: none; text-indent: 0;
text-align: left; text-transform: none; letter-spacing: normal; word-spacing:
normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr;
max-width: none; max-height: none; min-width: 0; min-height: 0; border: 0;
padding: 0; margin: 0}
+.MathJax_SVG * {transition: none; -webkit-transition: none; -moz-transition:
none; -ms-transition: none; -o-transition: none}
+.MathJax_SVG > div {display: inline-block}
+.mjx-svg-href {fill: blue; stroke: blue}
+.MathJax_SVG_Processing {visibility: hidden; position: absolute; top: 0; left:
0; width: 0; height: 0; overflow: hidden; display: block!important}
+.MathJax_SVG_Processed {display: none!important}
+.MathJax_SVG_test {font-style: normal; font-weight: normal; font-size: 100%;
font-size-adjust: none; text-indent: 0; text-transform: none; letter-spacing:
normal; word-spacing: normal; overflow: hidden; height: 1px}
+.MathJax_SVG_test.mjx-test-display {display: table!important}
+.MathJax_SVG_test.mjx-test-inline {display: inline!important; margin-right:
-1px}
+.MathJax_SVG_test.mjx-test-default {display: block!important; clear: both}
+.MathJax_SVG_ex_box {display: inline-block!important; position: absolute;
overflow: hidden; min-height: 0; max-height: none; padding: 0; border: 0;
margin: 0; width: 1px; height: 60ex}
+.mjx-test-inline .MathJax_SVG_left_box {display: inline-block; width: 0;
float: left}
+.mjx-test-inline .MathJax_SVG_right_box {display: inline-block; width: 0;
float: right}
+.mjx-test-display .MathJax_SVG_right_box {display: table-cell!important;
width: 10000em!important; min-width: 0; max-width: none; padding: 0; border: 0;
margin: 0}