Changeset 32944 for main


Ignore:
Timestamp:
2019-04-01T12:38:16+13:00 (5 years ago)
Author:
kjdon
Message:

making some methods/variables public so we can access them from other places. Making verifyRecaptcha static so can be called from anywhere

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/Authentication.java

    r32451 r32944  
    4646
    4747    //Error codes
    48     protected static final int NO_ERROR = 0;
     48    public static final int NO_ERROR = 0;
    4949    protected static final int ERROR_NOT_LOGGED_IN = -1;
    5050    protected static final int ERROR_ADMIN_NOT_LOGGED_IN = -2;
     
    143143    protected static final String LOGIN = "Login";
    144144  protected static final String BLANK = "Info"; // a dummy page just for showing an error message
     145 
    145146    //the services on offer
    146     protected static final String AUTHENTICATION_SERVICE = "Authentication";
     147    public static final String AUTHENTICATION_SERVICE = "Authentication";
    147148    protected static final String GET_USER_INFORMATION_SERVICE = "GetUserInformation";
    148149    protected static final String CHANGE_USER_EDIT_MODE_SERVICE = "ChangeUserEditMode";
     
    150151
    151152    protected static boolean _derbyWrapperDoneForcedShutdown = false;
    152 
     153 
    153154  // some XML strings
    154155  protected static final String RECAPTCHA_ELEM = "recaptcha";
     
    239240        remoteAuthentication_service.setAttribute(GSXML.NAME_ATT, REMOTE_AUTHENTICATION_SERVICE);
    240241        this.short_service_info.appendChild(remoteAuthentication_service);
    241        
    242242
    243243        DerbyWrapper.createDatabaseIfNeeded();
     
    276276        // check recaptcha
    277277        if (_recaptchaSecretKey == null || _recaptchaSecretKey.length() == 0 || _recaptchaSiteKey == null || _recaptchaSiteKey.length() == 0) {
     278          _recaptchaSecretKey = null;
     279          _recaptchaSiteKey = null;
    278280          _recaptchaOpList = null;
    279281        }
     
    290292    }
    291293
     294  public String getRecaptchaSiteKey() {
     295    return _recaptchaSiteKey;
     296  }
     297
     298  public String getRecaptchaSecretKey() {
     299
     300    return _recaptchaSecretKey;
     301  }
    292302  protected Element getServiceDescription(Document doc, String service_id, String lang, String subset)
    293303    {
     
    346356     
    347357    }
     358  public static String getErrorKey(int error_code) {
     359   
     360    return _errorKeyMap.get(error_code);
     361  }
    348362    protected Element processChangeUserEditMode(Element request)
    349363    {
     
    978992    }
    979993
    980   public int verifyRecaptcha(String secret_key, String user_response) {
     994  public static int verifyRecaptcha(String secret_key, String user_response) {
    981995
    982996    if (user_response == null || user_response.length() == 0) {
Note: See TracChangeset for help on using the changeset viewer.