\r
public static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";\r
\r
- private boolean mTryEmptyAuthorization = false;\r
+ private boolean mDetectAuthorizationMethod = false;\r
\r
\r
/**\r
hideRefreshButton();\r
// Try to create an account with user and pass "", to know if it is a regular server\r
// Update connect button in the answer of this method\r
- tryEmptyAuthorization();\r
+ detectAuthorizationMethod();\r
} else {\r
showRefreshButton();\r
// Show server status\r
/**\r
* Try to access with user/pass ""/"", to know if it is a regular server\r
*/\r
- private void tryEmptyAuthorization() {\r
- mTryEmptyAuthorization = true;\r
+ private void detectAuthorizationMethod() {\r
+ mDetectAuthorizationMethod = true;\r
\r
Log_OC.d(TAG, "Trying empty authorization to detect authentication method");\r
\r
\r
private void updateServerStatusIconNoRegularAuth(){\r
mServerStatusIcon = R.drawable.common_error;\r
- mServerStatusText = R.string.auth_unsupported_auth_method;\r
+ mServerStatusText = R.string.auth_can_not_auth_against_server;\r
}\r
\r
/**\r
}\r
\r
if (result.isSuccess()) {\r
- \r
- if (mTryEmptyAuthorization) {\r
- //allow or not the user try to access the server\r
+ //allow or not the user try to access the server\r
+ if (mDetectAuthorizationMethod) {\r
mOkButton.setEnabled(false);\r
- mTryEmptyAuthorization = false;\r
+ mDetectAuthorizationMethod = false;\r
mServerIsValid = false;\r
//show an alert message ( Server Status )\r
updateServerStatusIconNoRegularAuth();\r
}\r
\r
} else {\r
- if (mTryEmptyAuthorization) {\r
- mTryEmptyAuthorization = false;\r
+ if (mDetectAuthorizationMethod && \r
+ ( result.getCode() == ResultCode.UNAUTHORIZED && result.isBasicAuthentication())) {\r
+ mDetectAuthorizationMethod = false;\r
mOkButton.setEnabled(true);\r
\r
// Show server status\r