Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 97677 Details for
Bug 228943
Alter Logout button depending on the state
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
patch secure storage Logout.txt (text/plain), 8.12 KB, created by
Oleg Besedin
on 2008-04-25 15:51:57 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Oleg Besedin
Created:
2008-04-25 15:51:57 EDT
Size:
8.12 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.security >Index: src/org/eclipse/equinox/internal/security/storage/friends/InternalExchangeUtils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/security/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/friends/InternalExchangeUtils.java,v >retrieving revision 1.10 >diff -u -r1.10 InternalExchangeUtils.java >--- src/org/eclipse/equinox/internal/security/storage/friends/InternalExchangeUtils.java 25 Apr 2008 17:53:58 -0000 1.10 >+++ src/org/eclipse/equinox/internal/security/storage/friends/InternalExchangeUtils.java 25 Apr 2008 19:48:50 -0000 >@@ -42,13 +42,6 @@ > } > > /** >- * Clears cached passwords from the open storages and password providers. >- */ >- static public void passwordProvidersLogout() { >- SecurePreferencesMapper.clearPasswordCache(); >- } >- >- /** > * Gathers list of available password providers. Note: this method does not try > * to instantiate providers, hence, providers listed as available by this method > * might fail on instantiation and not be available for the actual use. >@@ -71,6 +64,10 @@ > PasswordProviderSelector.getInstance().clearCaches(); > } > >+ static public boolean isLoggedIn() { >+ return PasswordProviderSelector.getInstance().isLoggedIn(); >+ } >+ > /** > * Returns location of default storage > * @return location of the default storage, might be null >Index: src/org/eclipse/equinox/internal/security/storage/PasswordProviderSelector.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/security/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/PasswordProviderSelector.java,v >retrieving revision 1.5 >diff -u -r1.5 PasswordProviderSelector.java >--- src/org/eclipse/equinox/internal/security/storage/PasswordProviderSelector.java 25 Apr 2008 17:53:58 -0000 1.5 >+++ src/org/eclipse/equinox/internal/security/storage/PasswordProviderSelector.java 25 Apr 2008 19:48:50 -0000 >@@ -207,6 +207,12 @@ > } > } > >+ public boolean isLoggedIn() { >+ synchronized (modules) { >+ return (modules.size() != 0); >+ } >+ } >+ > protected HashSet getDisabledModules() { > IEclipsePreferences node = new ConfigurationScope().getNode(AuthPlugin.PI_AUTH); > String tmp = node.get(IStorageConstants.DISABLED_PROVIDERS_KEY, null); >#P org.eclipse.equinox.security.ui >Index: src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/security/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java,v >retrieving revision 1.6 >diff -u -r1.6 StoragePreferencePage.java >--- src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java 21 Apr 2008 17:46:55 -0000 1.6 >+++ src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java 25 Apr 2008 19:48:51 -0000 >@@ -13,6 +13,8 @@ > import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.preference.PreferencePage; > import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.RowLayout; > import org.eclipse.swt.widgets.*; >@@ -37,12 +39,25 @@ > Composite pageArea = new Composite(parent, SWT.NONE); > pageArea.setLayout(new RowLayout()); > >- TabFolder folder = new TabFolder(parent, SWT.TOP); >+ final TabFolder folder = new TabFolder(parent, SWT.TOP); > passwordTab = new TabPassword(folder, 0, getShell()); > contentsTab = new TabContents(folder, 1, getShell(), convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH)); > advancedTab = new TabAdvanced(folder, 2, getShell()); > folder.setSelection(0); > folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); >+ >+ folder.addSelectionListener(new SelectionListener() { >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ // nothing to do >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ int i = folder.getSelectionIndex(); >+ if (i == 0 && passwordTab != null) // password page >+ passwordTab.onActivated(); >+ } >+ }); > return folder; > } > >Index: src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/security/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java,v >retrieving revision 1.3 >diff -u -r1.3 TabPassword.java >--- src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java 25 Apr 2008 17:53:58 -0000 1.3 >+++ src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java 25 Apr 2008 19:48:51 -0000 >@@ -21,8 +21,7 @@ > import org.eclipse.jface.layout.GridLayoutFactory; > import org.eclipse.jface.layout.LayoutConstants; > import org.eclipse.swt.SWT; >-import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.events.*; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.*; >@@ -36,6 +35,7 @@ > > protected Table providerTable; > >+ protected Button buttonClearPassword; > protected Button buttonChangePassword; > protected Button buttonRecoverPassword; > >@@ -78,17 +78,14 @@ > Composite rightPart = new Composite(page, SWT.NONE); > rightPart.setLayout(new GridLayout()); > >- Button buttonClearPassword = new Button(rightPart, SWT.NONE); >+ buttonClearPassword = new Button(rightPart, SWT.NONE); > buttonClearPassword.setText(SecUIMessages.logoutButton); > buttonClearPassword.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false)); >- buttonClearPassword.addSelectionListener(new SelectionListener() { >- >- public void widgetDefaultSelected(SelectionEvent e) { >- widgetSelected(e); >- } >+ buttonClearPassword.addSelectionListener(new SelectionAdapter() { > > public void widgetSelected(SelectionEvent e) { >- InternalExchangeUtils.passwordProvidersLogout(); >+ InternalExchangeUtils.passwordProvidersReset(); >+ enableLogout(); > } > }); > >@@ -106,6 +103,7 @@ > ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); > ChangePasswordWizardDialog dialog = new ChangePasswordWizardDialog(shell, rootNode, moduleID); > dialog.open(); >+ enableLogout(); > } > }); > >@@ -126,6 +124,7 @@ > return; // no password recovery questions were setup > PasswordRecoveryDialog dialog = new PasswordRecoveryDialog(questions, shell, moduleID); > dialog.open(); >+ enableLogout(); > } > }); > >@@ -185,6 +184,7 @@ > boolean recoveryAvailable = rootNode.nodeExists(path); > buttonRecoverPassword.setEnabled(recoveryAvailable); > } >+ enableLogout(); > } > > protected HashSet getDisabledModules() { >@@ -244,4 +244,12 @@ > InternalExchangeUtils.passwordProvidersReset(); > } > >+ public void onActivated() { >+ enableLogout(); >+ } >+ >+ protected void enableLogout() { >+ buttonClearPassword.setEnabled(InternalExchangeUtils.isLoggedIn()); >+ } >+ > } >Index: src/org/eclipse/equinox/internal/security/ui/nls/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/security/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/nls/messages.properties,v >retrieving revision 1.19 >diff -u -r1.19 messages.properties >--- src/org/eclipse/equinox/internal/security/ui/nls/messages.properties 25 Apr 2008 17:53:58 -0000 1.19 >+++ src/org/eclipse/equinox/internal/security/ui/nls/messages.properties 25 Apr 2008 19:48:51 -0000 >@@ -45,7 +45,7 @@ > changePasswordButton = &Change > recoverPasswordButton = &Recover > deleteButton = D&elete >-logoutButton = &Logout >+logoutButton = &Logout All > providersTable = Providers: > enabledColumn = Enabled > priorityColumn = Priority
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228943
: 97677