Changeset 37312
- Timestamp:
- 2023-02-13T12:11:19+13:00 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r37236 r37312 284 284 webswingAuthenticator = new WebswingAuthenticator(); 285 285 if (!webswingAuthenticator.authenticate(library_url_string)) { 286 System.err.println(" authentication error");286 System.err.println("Authentication error, quitting GLI"); 287 287 System.exit(0); 288 288 } … … 1968 1968 static protected HashSet<String> groups; 1969 1969 1970 protected void displayError(String error_message) { 1971 WarningDialog dialog = new WarningDialog("warning.AuthenticationError", Dictionary.get("WebswingAuthenticationError.Title"), error_message, null, false, false); 1972 1973 dialog.display(); 1974 dialog.dispose(); 1975 dialog = null; 1976 } 1977 1970 1978 public boolean authenticate(String library_url_string) { 1971 1979 PasswordAuthentication pa = getPasswordAuthentication(); 1972 1980 if (pa == null) { 1973 // user cancelled - how do we show error? 1974 System.err.println("Authentication cancelled. You cannot access webswing gli without Greenstone user account"); 1981 // user cancelled 1982 System.err.println("Authentication cancelled."); 1983 displayError(Dictionary.get("WenswingAuthenticationError.Cancelled")); 1975 1984 return false; 1976 1985 … … 1993 2002 } catch (Exception e) { 1994 2003 System.err.println("There was an exception "+e.getMessage()); 2004 displayError("There was an exception "+e.getMessage()); 1995 2005 return false; 1996 2006 } … … 2005 2015 if (result.startsWith("Authentication failed:")) { 2006 2016 System.err.println("Authentication Error: "+result); 2017 displayError(result.replaceAll("'", "'")); 2007 2018 return false; 2008 2019 } … … 2016 2027 } 2017 2028 if (groups.size()==0) { 2029 System.err.println("User not in any collection editing groups"); 2030 displayError(Dictionary.get("WebswingAuthenticationError.NoPermissions")); 2018 2031 return false; // user has no editing priveleges 2019 2032 }
Note:
See TracChangeset
for help on using the changeset viewer.