mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Merge pull request #1649 from eugene7646/disable_mu_linux
Disable multi-user cases for non-Windows platforms
This commit is contained in:
commit
2e97b0c585
@ -30,6 +30,7 @@ import javax.crypto.spec.PBEKeySpec;
|
||||
import javax.crypto.spec.PBEParameterSpec;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
import org.sleuthkit.datamodel.CaseDbConnectionInfo;
|
||||
import org.sleuthkit.datamodel.TskData.DbType;
|
||||
|
||||
@ -39,6 +40,7 @@ import org.sleuthkit.datamodel.TskData.DbType;
|
||||
*/
|
||||
public final class UserPreferences {
|
||||
|
||||
private static final boolean isWindowsOS = PlatformUtil.isWindowsOS();
|
||||
private static final Preferences preferences = NbPreferences.forModule(UserPreferences.class);
|
||||
public static final String KEEP_PREFERRED_VIEWER = "KeepPreferredViewer"; // NON-NLS
|
||||
public static final String HIDE_KNOWN_FILES_IN_DATA_SOURCES_TREE = "HideKnownFilesInDataSourcesTree"; //NON-NLS
|
||||
@ -177,6 +179,9 @@ public final class UserPreferences {
|
||||
}
|
||||
|
||||
public static boolean getIsMultiUserModeEnabled() {
|
||||
if (!isWindowsOS) {
|
||||
return false;
|
||||
}
|
||||
return preferences.getBoolean(IS_MULTI_USER_MODE_ENABLED, false);
|
||||
}
|
||||
|
||||
|
@ -153,6 +153,7 @@ MultiUserSettingsPanel.lbSolrSettings.text=Solr Settings
|
||||
MultiUserSettingsPanel.cbEnableMultiUser.text=Enable Multi-user cases
|
||||
MultiUserSettingsPanel.lbDatabaseSettings.text=Database Settings
|
||||
MultiUserSettingsPanel.validationErrMsg.incomplete=Fill in all values
|
||||
MultiUserSettingsPanel.nonWindowsOs.msg=Multi-user cases are only available on Windows platforms
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidDatabasePort=Invalid database port number
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidMessageServicePort=Invalid message service port number
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidIndexingServerPort=Invalid Solr server port number
|
||||
|
@ -23,6 +23,7 @@ import javax.swing.ImageIcon;
|
||||
import org.openide.util.ImageUtilities;
|
||||
import org.openide.util.Lookup;
|
||||
import org.sleuthkit.autopsy.core.UserPreferencesException;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
import org.sleuthkit.autopsy.events.MessageServiceException;
|
||||
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
|
||||
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
|
||||
@ -39,7 +40,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
||||
private static final String INVALID_DB_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidDatabasePort");
|
||||
private static final String INVALID_MESSAGE_SERVICE_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidMessageServicePort");
|
||||
private static final String INVALID_INDEXING_SERVER_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidIndexingServerPort");
|
||||
private static final int DEFAULT_MESSAGE_SERVICE_PORT = 61616;
|
||||
private static final String NON_WINDOWS_OS_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.nonWindowsOs.msg");
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final MultiUserSettingsPanelController controller;
|
||||
private final Collection<JTextField> textBoxes = new ArrayList<>();
|
||||
@ -47,6 +48,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
||||
private static final Logger logger = Logger.getLogger(MultiUserSettingsPanel.class.getName());
|
||||
private final ImageIcon goodIcon;
|
||||
private final ImageIcon badIcon;
|
||||
private static final boolean isWindowsOS = PlatformUtil.isWindowsOS();
|
||||
|
||||
/**
|
||||
* Creates new form AutopsyMultiUserSettingsPanel
|
||||
@ -105,6 +107,10 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
||||
addDocumentListeners(textBoxes, textBoxChangedListener);
|
||||
goodIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/good.png", false));
|
||||
badIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/bad.png", false));
|
||||
if (!isWindowsOS) {
|
||||
cbEnableMultiUser.setEnabled(false);
|
||||
cbEnableMultiUser.setSelected(false);
|
||||
}
|
||||
enableMultiUserComponents(textBoxes, cbEnableMultiUser.isSelected());
|
||||
}
|
||||
|
||||
@ -460,7 +466,11 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
private void cbEnableMultiUserItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbEnableMultiUserItemStateChanged
|
||||
if (!cbEnableMultiUser.isSelected()) {
|
||||
tbOops.setText("");
|
||||
if (!isWindowsOS) {
|
||||
tbOops.setText(NON_WINDOWS_OS_MSG);
|
||||
} else {
|
||||
tbOops.setText("");
|
||||
}
|
||||
bnTestDatabase.setEnabled(false);
|
||||
lbTestDatabase.setIcon(null);
|
||||
bnTestSolr.setEnabled(false);
|
||||
@ -643,6 +653,10 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
void store() {
|
||||
if (!isWindowsOS) {
|
||||
return;
|
||||
}
|
||||
|
||||
DbType dbType = DbType.SQLITE;
|
||||
|
||||
if (cbEnableMultiUser.isSelected()) {
|
||||
@ -694,7 +708,11 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel {
|
||||
* @return true if it's okay, false otherwise.
|
||||
*/
|
||||
boolean valid() {
|
||||
tbOops.setText("");
|
||||
if (!isWindowsOS) {
|
||||
tbOops.setText(NON_WINDOWS_OS_MSG);
|
||||
} else {
|
||||
tbOops.setText("");
|
||||
}
|
||||
|
||||
if (cbEnableMultiUser.isSelected()) {
|
||||
return checkFieldsAndEnableButtons()
|
||||
|
Loading…
x
Reference in New Issue
Block a user