projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added skeleton of new operation to detect authentication method in the server side
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
authentication
/
AuthenticatorActivity.java
diff --git
a/src/com/owncloud/android/authentication/AuthenticatorActivity.java
b/src/com/owncloud/android/authentication/AuthenticatorActivity.java
index
33ddbf7
..
a8293c3
100644
(file)
--- a/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
+++ b/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
@@
-176,7
+176,7
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
\r
public static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";
\r
\r
\r
public static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";
\r
\r
- private boolean m
TryEmptyAuthorization
= false;
\r
+ private boolean m
DetectAuthorizationMethod
= false;
\r
\r
\r
/**
\r
\r
\r
/**
\r
@@
-905,7
+905,7
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
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
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
} else {
\r
showRefreshButton();
\r
// Show server status
\r
@@
-926,8
+926,8
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
/**
\r
* Try to access with user/pass ""/"", to know if it is a regular server
\r
*/
\r
/**
\r
* Try to access with user/pass ""/"", to know if it is a regular server
\r
*/
\r
- private void
tryEmptyAuthorization
() {
\r
- m
TryEmptyAuthorization
= true;
\r
+ private void
detectAuthorizationMethod
() {
\r
+ m
DetectAuthorizationMethod
= true;
\r
\r
Log_OC.d(TAG, "Trying empty authorization to detect authentication method");
\r
\r
\r
Log_OC.d(TAG, "Trying empty authorization to detect authentication method");
\r
\r
@@
-1149,7
+1149,7
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
\r
private void updateServerStatusIconNoRegularAuth(){
\r
mServerStatusIcon = R.drawable.common_error;
\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
/**
\r
@@
-1203,11
+1203,10
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
}
\r
\r
if (result.isSuccess()) {
\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
mOkButton.setEnabled(false);
\r
- m
TryEmptyAuthorization
= false;
\r
+ m
DetectAuthorizationMethod
= false;
\r
mServerIsValid = false;
\r
//show an alert message ( Server Status )
\r
updateServerStatusIconNoRegularAuth();
\r
mServerIsValid = false;
\r
//show an alert message ( Server Status )
\r
updateServerStatusIconNoRegularAuth();
\r
@@
-1231,8
+1230,9
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
}
\r
\r
} else {
\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
mOkButton.setEnabled(true);
\r
\r
// Show server status
\r