Changeset 17651 for gli


Ignore:
Timestamp:
2008-10-31T14:23:48+13:00 (15 years ago)
Author:
ak19
Message:

Corrected my mistake: fixed authentication to work with both wget Downloads and GLI applet

Location:
gli/trunk/src/org/greenstone/gatherer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/GAuthenticator.java

    r17621 r17651  
    9191    protected PasswordAuthentication getPasswordAuthentication(String username_str, String password_str) {
    9292    if(operationMode == DOWNLOAD) { // special handling of proxy authentication popup for Wget downloads
    93 
     93       
    9494        // Don't prompt if the details were already saved for the same host and port. This is necessary
    9595        // when running wget because wget requires proxy authentication. And without the following, the
     
    107107            password_str = value.substring(value.indexOf("@") + 1);
    108108        }
     109        operationMode = REGULAR; // reset the state of the Authenticator to normal mode
    109110        return new PasswordAuthentication(username_str, password_str.toCharArray());
    110111        }
  • gli/trunk/src/org/greenstone/gatherer/gui/DownloadPane.java

    r17621 r17651  
    636636        // Only for wget, need to avoid a second automatic authentication popup (first asks
    637637        // the proxy authentication for wget, and the second will ask the same for the realm)
     638        // Once the authentication has been reused, it will set the GAuthenticator state back to REGULAR
    638639        GAuthenticator.setMode(GAuthenticator.DOWNLOAD);
    639640        while(count < 3 && (user_pass = (String) GAuthenticator.authentications.get(address)) == null) {
     
    641642        count++;
    642643        }
    643         GAuthenticator.setMode(GAuthenticator.REGULAR); // reset the state to default (of how the authentication popup functions)
    644644        if(count >= 3) {
    645645        return false;
     
    648648        if(user_pass.indexOf("@") != -1) {
    649649           
    650         // Write the use proxy command - we don't do this anymore, instead we set environment variables - hopefully these can't be spied on like the follwoing can (using ps) - actually the environment stuff didn't work for windows, so lets go back to this
     650        // Write the use proxy command - we don't do this anymore, instead we set environment variables - hopefully these can't be spied on like the following can (using ps) - actually the environment stuff didn't work for windows, so lets go back to this
    651651        if (Utility.isWindows()) {
    652652             
     
    676676           
    677677           }
    678 
     678       
    679679           return true;
    680680        }
     
    684684
    685685    }
    686 
     686   
    687687    return true;
    688688    }
Note: See TracChangeset for help on using the changeset viewer.