Skip to content

Commit 4cd146e

Browse files
committed
implemented more SAML settings
1 parent 7a4c8af commit 4cd146e

File tree

8 files changed

+48
-11
lines changed

8 files changed

+48
-11
lines changed

logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/preview/PreviewPopup.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public PreviewPopup(GUIDocument[] docs, int index) {
8080
prev.setShowRollOver(true);
8181
prev.setShowDisabled(true);
8282
prev.setShowDown(true);
83-
prev.setIcon("[SKIN]/headerIcons/arrow_left.gif");
83+
prev.setIcon("[SKIN]/headerIcons/arrow_left.png");
8484
prev.addClickHandler(event -> {
8585
if (currentIndex <= 0)
8686
currentIndex = PreviewPopup.this.docs.length - 1;
@@ -95,7 +95,7 @@ public PreviewPopup(GUIDocument[] docs, int index) {
9595
next.setShowRollOver(true);
9696
next.setShowDisabled(true);
9797
next.setShowDown(true);
98-
next.setIcon("[SKIN]/headerIcons/arrow_right.gif");
98+
next.setIcon("[SKIN]/headerIcons/arrow_right.png");
9999
next.addClickHandler(event -> {
100100
if (currentIndex >= PreviewPopup.this.docs.length)
101101
currentIndex = 0;

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/document/reading/ReadingRequestDialog.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.logicaldoc.gui.common.client.log.GuiLog;
66
import com.logicaldoc.gui.common.client.util.ItemFactory;
77
import com.logicaldoc.gui.common.client.util.LD;
8+
import com.logicaldoc.gui.common.client.widgets.GroupSelectorCombo;
89
import com.logicaldoc.gui.common.client.widgets.StickyWindow;
910
import com.logicaldoc.gui.common.client.widgets.UserSelectorCombo;
1011
import com.logicaldoc.gui.frontend.client.services.ReadingRequestService;
@@ -28,6 +29,8 @@ public class ReadingRequestDialog extends StickyWindow {
2829

2930
private UserSelectorCombo usersItem;
3031

32+
private GroupSelectorCombo groupsItem;
33+
3134
public ReadingRequestDialog(Long[] docIds) {
3235
super(I18N.message("requesttoconfirmreading"));
3336
setCanDragResize(true);
@@ -43,7 +46,8 @@ public ReadingRequestDialog(Long[] docIds) {
4346
form.setHeight100();
4447

4548
usersItem = new UserSelectorCombo("users", "users", null, true, true);
46-
usersItem.setRequired(true);
49+
50+
groupsItem = new GroupSelectorCombo("groups", "groups");
4751

4852
TextAreaItem message = ItemFactory.newTextAreaItem("message", null);
4953
message.setMinHeight(80);
@@ -52,7 +56,7 @@ public ReadingRequestDialog(Long[] docIds) {
5256
CheckboxItem alertConfirmation = ItemFactory.newCheckbox("notifyreadingconfirmation");
5357
alertConfirmation.setValue(true);
5458

55-
form.setItems(usersItem, message, alertConfirmation);
59+
form.setItems(usersItem, groupsItem, message, alertConfirmation);
5660

5761
addItem(form);
5862
addItem(prepareButtons());
@@ -64,6 +68,7 @@ protected ToolStrip prepareButtons() {
6468
if (form.validate()) {
6569
LD.contactingServer();
6670
ReadingRequestService.Instance.get().askReadingConfirmation(docIds, usersItem.getUserIds(),
71+
groupsItem.getGroupIds(),
6772
Boolean.parseBoolean(form.getValueAsString("notifyreadingconfirmation")),
6873
form.getValueAsString("message"), new AsyncCallback<Void>() {
6974

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/security/saml/GUISamlSettings.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class GUISamlSettings implements Serializable {
3838

3939
private String group = "group";
4040

41+
private boolean keepLocalMemberships = true;
42+
4143
public boolean isEnabled() {
4244
return enabled;
4345
}
@@ -141,4 +143,12 @@ public String getGroup() {
141143
public void setGroup(String group) {
142144
this.group = group;
143145
}
146+
147+
public boolean isKeepLocalMemberships() {
148+
return keepLocalMemberships;
149+
}
150+
151+
public void setKeepLocalMemberships(boolean keepLocalMemberships) {
152+
this.keepLocalMemberships = keepLocalMemberships;
153+
}
144154
}

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/security/saml/SamlPanel.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public class SamlPanel extends VLayout {
5757

5858
private static final String NAMEID_ENCRYPTED = "nameidencrypted";
5959

60+
private static final String KEEPMEMBERSHIP = "keepmembership";
61+
6062
public SamlPanel() {
6163
setWidth100();
6264
setMembersMargin(5);
@@ -106,6 +108,10 @@ private void initGUI(GUISamlSettings settings) {
106108
TextItem groups = ItemFactory.newTextItem(GROUPS, GROUPS, settings.getGroup());
107109
groups.setWrapTitle(false);
108110

111+
RadioGroupItem keepMembership = ItemFactory.newBooleanSelector(KEEPMEMBERSHIP, "keepmembershiplocalgroups");
112+
keepMembership.setValue(settings.isKeepLocalMemberships() ? "yes" : "no");
113+
keepMembership.setRequired(true);
114+
109115
RadioGroupItem authnRequestSigned = ItemFactory.newBooleanSelector(AUTHNREQUEST_SIGNED);
110116
authnRequestSigned.setWrapTitle(true);
111117
authnRequestSigned.setRequired(true);
@@ -183,11 +189,11 @@ private void initGUI(GUISamlSettings settings) {
183189
attributeMappingsForm.setValuesManager(vm);
184190
attributeMappingsForm.setIsGroup(true);
185191
attributeMappingsForm.setGroupTitle(I18N.message("attrtibutemappings"));
186-
attributeMappingsForm.setTitleOrientation(TitleOrientation.LEFT);
192+
attributeMappingsForm.setTitleOrientation(TitleOrientation.TOP);
187193
attributeMappingsForm.setAlign(Alignment.LEFT);
188194
attributeMappingsForm.setHeight(1);
189195
attributeMappingsForm.setWidth(590);
190-
attributeMappingsForm.setFields(username, firstName, lastName, email, groups);
196+
attributeMappingsForm.setFields(username, firstName, lastName, email, groups, keepMembership);
191197

192198
VLayout forms = new VLayout();
193199
forms.setMembersMargin(10);
@@ -224,6 +230,7 @@ private IButton prepareSaveButton(ValuesManager form) {
224230
settings.setAuthnRequestSigned("yes".equals(form.getValue(AUTHNREQUEST_SIGNED)));
225231
settings.setWantAssertionsEncrypted("yes".equals(form.getValue(ASSERTIONS_ENCRYPTED)));
226232
settings.setWantNameIdEncrypted("yes".equals(form.getValue(NAMEID_ENCRYPTED)));
233+
settings.setKeepLocalMemberships("yes".equals(form.getValue(KEEPMEMBERSHIP)));
227234
settings.setCertificate(form.getValueAsString(CERTIFICATE));
228235
settings.setPrivateKey(form.getValueAsString(PRIVATEKEY));
229236
settings.setIdpMetadata(form.getValueAsString(IDP_METADATA));

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/services/ReadingRequestService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ public interface ReadingRequestService extends RemoteService {
2222
* Asks some users to confirm the reading of a set of documents
2323
*
2424
* @param docIds identifiers of the documents
25-
* @param recipientIds identifiers of the recipients
25+
* @param userIds identifiers of the recipients
26+
* @param groupIds identifiers of the groups
2627
* @param comment an optional message to include in the notification
2728
* @param alertConfirmation if the requestor must be notified on reading confirmation
2829
*
2930
* @throws ServerException an error happened in the server application
3031
*/
31-
public void askReadingConfirmation(Long[] docIds, long[] recipientIds, boolean alertConfirmation, String comment) throws ServerException;
32+
public void askReadingConfirmation(Long[] docIds, long[] userIds, long[] groupIds, boolean alertConfirmation, String comment) throws ServerException;
3233

3334
/**
3435
* Confirms the read completion of a given file version

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/services/ReadingRequestServiceAsync.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
public interface ReadingRequestServiceAsync {
77

8-
void askReadingConfirmation(Long[] docIds, long[] recipientIds, boolean alertConfirmation, String comment,
9-
AsyncCallback<Void> callback);
8+
void askReadingConfirmation(Long[] docIds, long[] userIds, long[] groupIds, boolean alertConfirmation,
9+
String comment, AsyncCallback<Void> callback);
1010

1111
void confirmReadings(long[] readingIds, String version, AsyncCallback<Void> callback);
1212

logicaldoc-webapp/src/main/java/com/logicaldoc/web/service/SettingServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public GUIParameter[] loadSettings() throws ServerException {
191191
|| name.startsWith("cas.") || name.startsWith("cache.") || name.startsWith("jdbc.")
192192
|| name.startsWith("comparator.") || name.contains(".via.") || name.contains(".downloadticket.")
193193
|| name.startsWith("zonalocr.") || name.endsWith(CHARSET) || name.startsWith("policy.")
194-
|| name.startsWith("cookies."))
194+
|| name.startsWith("cookies.") || name.startsWith("saml."))
195195
continue;
196196

197197
sortedSet.add(key.toString());

logicaldoc-webapp/src/main/resources/context.properties

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,3 +858,17 @@ policy.google = https://www.logicaldoc.com/google-integration-privacy-policy
858858
parse.email.includes=
859859
parse.email.excludes=*
860860

861+
saml.enabled = true
862+
saml.sp.entityid =
863+
saml.sp.certificate =
864+
saml.sp.privatekey = MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQC88Ne1VZJgbtmU3IRIhMJH/uNYbhj5tZ2ZaqDVRwtPR8Ou5KLQmy4lSOw4kgUYwOL320BUW2M+BjdwFrxJf1B+7H2sFJtEdB4XBMX9zAvi4ZnBzkqsXMJK+shs24oXczpPpSyutXF0JrvrSWVCUWU6b4udP0vkxh/VJDH1eqorEG4iSyn+TkZ0GDChfLtlvYM1VUSxQVwnfGAJ68XUNmSI3pa/0R28KVUZ8CimFQDQ15AYHNavMEuz4JjCkmHI2Sr4kjc3p5EpxtkSKpjuN5BB0xE3c8ccCOsNoVoMvK09qL/Lz/9wsCzt/Fi3sNufg/5MUJ4///Rin01nz7JrByhnAgMBAAECgf9Zq/S0m2hdXD7n58DgqiGLCe3cimRQH2Is7e5nStCTT/wPhXPAjeXYzENQlfzVQrZ17Bkb8EOprEmjaSbzuvj5RERg52bJllKxmhJd4fnCNFBFKyNFqsCL1XpKL+faOVXzdvE9+d9ewQNvJ+ZnEzp4AXjBqMjcSyvQfN05JH6e8NrhMToUQde2BmypEQ5HrsKqOxbPZPQz1sWM9sQcEZGzG+/cGqdeQDGf6LZGv7wXQ3cF1NhNHDXYHWM9+efnR7AUvtoZV2HjiGr+6yRchKvokvkF2SM1j4PDes+4W/iaZE1tDDQQp4jy944upX8J5Vuzdg8ckIf1SKSV6vHQnGECgYEA+b5EuKKceaEpaBAmeion/xQTtheah2GbrC38N7VrXCtUDPXIVol0kXnI8MnnwzjEQcSxBoUsH05iilKw75urD+qVxfHcumcmY+Wz/CXOdHkvvx9nnpZpK20967QjjOjLyDTBB4u/cHmWiFPn2Z7JeovC/lWW2SoauD0kdosbV2ECgYEAwayd7AupiXeOoTKKeWQrBxWvo5V4+XD7GCyPBQKybO+aDYq85c7TL1hMb04JZfbk1Z+zutCQQ6tkSK5S6XmxmcRhuC9C+hgjf6X1y5m4DTBqrpjzlwSuBpTPyIaXq3j4jp/NYQGvNWOJn51NX1/FRFaHzyt3jgESl4yEMNl7vMcCgYBA36v6SkNbVQHshkV4dnrtR8nXA0qg4DoP/+IElpvM1XR/6VihIhOltnz8D3akv5o7e1yA1RchCruOMuzDUSyeddFyGeG8ig7u5Dxcw3VdzB0bCI1iJLAtF7N+Bs01TUOiPhHmY+bW0L7JqwIPBbBQpP2CE7mbr9RBB6DxKjFwAQKBgHjKWewgEerkoBY1WVwAdz2B7vtNfBfGuTQIhmKPngyHG0Oa5dlGNzxuC63Xs9DePTZm1keLUI6D1JXn81oeRgArFO80uscUSv+P2E7VXo8LRV4Dktj7WDZOlZDxMKMHXa5GSGdaD5ZysCDWkK0NJBFNDoLND1GHpbrTLpbw7VV9AoGBANLD5hcRbA7rHdmVedGCMRuFFZ+GJ/efNNd0yvpq3ocFxJXeye8PCWp7cramQOfpcEbQCpsUXqbvliNFrMOt8qzAD+zkri+Z+a593tnkjyjD5Bp4TbYiROY/wuB9ZGhonzE6+RmbEaaLTblBdqrGSBG6L+NMGP8TNdGdyTqP64Ni
865+
saml.security.authnrequest_signed = false
866+
saml.security.want_assertions_encrypted = false
867+
saml.security.want_nameid_encrypted = false
868+
saml.idp.metadata =
869+
saml.attribute.username = username
870+
saml.attribute.firstname = firstName
871+
saml.attribute.lastname = lastName
872+
saml.attribute.email = email
873+
saml.attribute.group = group
874+
saml.attribute.group.keeplocal = true

0 commit comments

Comments
 (0)