Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 228943
Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/security/storage/friends/InternalExchangeUtils.java (-7 / +4 lines)
Lines 42-54 Link Here
42
	}
42
	}
43
43
44
	/**
44
	/**
45
	 * Clears cached passwords from the open storages and password providers.
46
	 */
47
	static public void passwordProvidersLogout() {
48
		SecurePreferencesMapper.clearPasswordCache();
49
	}
50
51
	/**
52
	 * Gathers list of available password providers. Note: this method does not try
45
	 * Gathers list of available password providers. Note: this method does not try
53
	 * to instantiate providers, hence, providers listed as available by this method
46
	 * to instantiate providers, hence, providers listed as available by this method
54
	 * might fail on instantiation and not be available for the actual use.
47
	 * might fail on instantiation and not be available for the actual use.
Lines 71-76 Link Here
71
		PasswordProviderSelector.getInstance().clearCaches();
64
		PasswordProviderSelector.getInstance().clearCaches();
72
	}
65
	}
73
66
67
	static public boolean isLoggedIn() {
68
		return PasswordProviderSelector.getInstance().isLoggedIn();
69
	}
70
74
	/**
71
	/**
75
	 * Returns location of default storage
72
	 * Returns location of default storage
76
	 * @return location of the default storage, might be null
73
	 * @return location of the default storage, might be null
(-)src/org/eclipse/equinox/internal/security/storage/PasswordProviderSelector.java (+6 lines)
Lines 207-212 Link Here
207
		}
207
		}
208
	}
208
	}
209
209
210
	public boolean isLoggedIn() {
211
		synchronized (modules) {
212
			return (modules.size() != 0);
213
		}
214
	}
215
210
	protected HashSet getDisabledModules() {
216
	protected HashSet getDisabledModules() {
211
		IEclipsePreferences node = new ConfigurationScope().getNode(AuthPlugin.PI_AUTH);
217
		IEclipsePreferences node = new ConfigurationScope().getNode(AuthPlugin.PI_AUTH);
212
		String tmp = node.get(IStorageConstants.DISABLED_PROVIDERS_KEY, null);
218
		String tmp = node.get(IStorageConstants.DISABLED_PROVIDERS_KEY, null);
(-)src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java (-1 / +16 lines)
Lines 13-18 Link Here
13
import org.eclipse.jface.dialogs.IDialogConstants;
13
import org.eclipse.jface.dialogs.IDialogConstants;
14
import org.eclipse.jface.preference.PreferencePage;
14
import org.eclipse.jface.preference.PreferencePage;
15
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.events.SelectionEvent;
17
import org.eclipse.swt.events.SelectionListener;
16
import org.eclipse.swt.layout.GridData;
18
import org.eclipse.swt.layout.GridData;
17
import org.eclipse.swt.layout.RowLayout;
19
import org.eclipse.swt.layout.RowLayout;
18
import org.eclipse.swt.widgets.*;
20
import org.eclipse.swt.widgets.*;
Lines 37-48 Link Here
37
		Composite pageArea = new Composite(parent, SWT.NONE);
39
		Composite pageArea = new Composite(parent, SWT.NONE);
38
		pageArea.setLayout(new RowLayout());
40
		pageArea.setLayout(new RowLayout());
39
41
40
		TabFolder folder = new TabFolder(parent, SWT.TOP);
42
		final TabFolder folder = new TabFolder(parent, SWT.TOP);
41
		passwordTab = new TabPassword(folder, 0, getShell());
43
		passwordTab = new TabPassword(folder, 0, getShell());
42
		contentsTab = new TabContents(folder, 1, getShell(), convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH));
44
		contentsTab = new TabContents(folder, 1, getShell(), convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH));
43
		advancedTab = new TabAdvanced(folder, 2, getShell());
45
		advancedTab = new TabAdvanced(folder, 2, getShell());
44
		folder.setSelection(0);
46
		folder.setSelection(0);
45
		folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
47
		folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
48
49
		folder.addSelectionListener(new SelectionListener() {
50
51
			public void widgetDefaultSelected(SelectionEvent e) {
52
				// nothing to do
53
			}
54
55
			public void widgetSelected(SelectionEvent e) {
56
				int i = folder.getSelectionIndex();
57
				if (i == 0 && passwordTab != null) // password page
58
					passwordTab.onActivated();
59
			}
60
		});
46
		return folder;
61
		return folder;
47
	}
62
	}
48
63
(-)src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java (-9 / +17 lines)
Lines 21-28 Link Here
21
import org.eclipse.jface.layout.GridLayoutFactory;
21
import org.eclipse.jface.layout.GridLayoutFactory;
22
import org.eclipse.jface.layout.LayoutConstants;
22
import org.eclipse.jface.layout.LayoutConstants;
23
import org.eclipse.swt.SWT;
23
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.events.SelectionEvent;
24
import org.eclipse.swt.events.*;
25
import org.eclipse.swt.events.SelectionListener;
26
import org.eclipse.swt.layout.GridData;
25
import org.eclipse.swt.layout.GridData;
27
import org.eclipse.swt.layout.GridLayout;
26
import org.eclipse.swt.layout.GridLayout;
28
import org.eclipse.swt.widgets.*;
27
import org.eclipse.swt.widgets.*;
Lines 36-41 Link Here
36
35
37
	protected Table providerTable;
36
	protected Table providerTable;
38
37
38
	protected Button buttonClearPassword;
39
	protected Button buttonChangePassword;
39
	protected Button buttonChangePassword;
40
	protected Button buttonRecoverPassword;
40
	protected Button buttonRecoverPassword;
41
41
Lines 78-94 Link Here
78
		Composite rightPart = new Composite(page, SWT.NONE);
78
		Composite rightPart = new Composite(page, SWT.NONE);
79
		rightPart.setLayout(new GridLayout());
79
		rightPart.setLayout(new GridLayout());
80
80
81
		Button buttonClearPassword = new Button(rightPart, SWT.NONE);
81
		buttonClearPassword = new Button(rightPart, SWT.NONE);
82
		buttonClearPassword.setText(SecUIMessages.logoutButton);
82
		buttonClearPassword.setText(SecUIMessages.logoutButton);
83
		buttonClearPassword.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
83
		buttonClearPassword.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
84
		buttonClearPassword.addSelectionListener(new SelectionListener() {
84
		buttonClearPassword.addSelectionListener(new SelectionAdapter() {
85
86
			public void widgetDefaultSelected(SelectionEvent e) {
87
				widgetSelected(e);
88
			}
89
85
90
			public void widgetSelected(SelectionEvent e) {
86
			public void widgetSelected(SelectionEvent e) {
91
				InternalExchangeUtils.passwordProvidersLogout();
87
				InternalExchangeUtils.passwordProvidersReset();
88
				enableLogout();
92
			}
89
			}
93
		});
90
		});
94
91
Lines 106-111 Link Here
106
				ISecurePreferences rootNode = SecurePreferencesFactory.getDefault();
103
				ISecurePreferences rootNode = SecurePreferencesFactory.getDefault();
107
				ChangePasswordWizardDialog dialog = new ChangePasswordWizardDialog(shell, rootNode, moduleID);
104
				ChangePasswordWizardDialog dialog = new ChangePasswordWizardDialog(shell, rootNode, moduleID);
108
				dialog.open();
105
				dialog.open();
106
				enableLogout();
109
			}
107
			}
110
		});
108
		});
111
109
Lines 126-131 Link Here
126
					return; // no password recovery questions were setup
124
					return; // no password recovery questions were setup
127
				PasswordRecoveryDialog dialog = new PasswordRecoveryDialog(questions, shell, moduleID);
125
				PasswordRecoveryDialog dialog = new PasswordRecoveryDialog(questions, shell, moduleID);
128
				dialog.open();
126
				dialog.open();
127
				enableLogout();
129
			}
128
			}
130
		});
129
		});
131
130
Lines 185-190 Link Here
185
			boolean recoveryAvailable = rootNode.nodeExists(path);
184
			boolean recoveryAvailable = rootNode.nodeExists(path);
186
			buttonRecoverPassword.setEnabled(recoveryAvailable);
185
			buttonRecoverPassword.setEnabled(recoveryAvailable);
187
		}
186
		}
187
		enableLogout();
188
	}
188
	}
189
189
190
	protected HashSet getDisabledModules() {
190
	protected HashSet getDisabledModules() {
Lines 244-247 Link Here
244
		InternalExchangeUtils.passwordProvidersReset();
244
		InternalExchangeUtils.passwordProvidersReset();
245
	}
245
	}
246
246
247
	public void onActivated() {
248
		enableLogout();
249
	}
250
251
	protected void enableLogout() {
252
		buttonClearPassword.setEnabled(InternalExchangeUtils.isLoggedIn());
253
	}
254
247
}
255
}
(-)src/org/eclipse/equinox/internal/security/ui/nls/messages.properties (-1 / +1 lines)
Lines 45-51 Link Here
45
changePasswordButton = &Change
45
changePasswordButton = &Change
46
recoverPasswordButton = &Recover
46
recoverPasswordButton = &Recover
47
deleteButton = D&elete
47
deleteButton = D&elete
48
logoutButton = &Logout
48
logoutButton = &Logout All
49
providersTable = Providers:
49
providersTable = Providers:
50
enabledColumn = Enabled
50
enabledColumn = Enabled
51
priorityColumn = Priority
51
priorityColumn = Priority

Return to bug 228943