Project

General

Profile

« Previous | Next » 

Revision 1a60427a

Added by Katja Luther about 6 years ago

remove login information pref when 'remember me' is unselected

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java
918 918
         credentialsPrefs.put(getPasswordPrefKey(), txtPassword.getText());
919 919
         flushPreferences(credentialsPrefs);
920 920
    }
921

  
921
    
922
    private void removePrefCredentials() {
923
        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
924
        Preferences credentialsPrefs = preferences.node(LOGIN_NODE);
925
        credentialsPrefs.put(getUsernamePrefKey(), txtLogin.getText());
926
        credentialsPrefs.put(getPasswordPrefKey(), txtPassword.getText());
927
        removePreferences(credentialsPrefs);
928
   }
929
    private void removePreferences(Preferences prefs) {
930
        try {
931
            prefs.removeNode();
932
        } catch (BackingStoreException bse) {
933
            setMessage(bse.getMessage());
934
        }
935
    }
922 936
    private void flushPreferences(Preferences prefs) {
923 937
        try {
924 938
            prefs.flush();
......
926 940
            setMessage(bse.getMessage());
927 941
        }
928 942
    }
943
    
944
    
929 945

  
930 946
    private void readPrefCredentials() {
931 947
        String username, password;
......
1045 1061
                if(!isDevRemoteSource) {
1046 1062
                    if(isRememberMe()) {
1047 1063
                        persistPrefCredentials();
1064
                    }else{
1065
                    	removePrefCredentials();
1048 1066
                    }
1049 1067
                    persistPrefLastServerInstance();
1050 1068
                }

Also available in: Unified diff