projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7c4fc04
)
Add webdav url to DetectAuthenticationMethodOperation
author
masensio
<masensio@solidgear.es>
Fri, 28 Mar 2014 13:51:36 +0000
(14:51 +0100)
committer
masensio
<masensio@solidgear.es>
Fri, 28 Mar 2014 13:51:36 +0000
(14:51 +0100)
src/com/owncloud/android/authentication/AuthenticatorActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/services/OperationsService.java
patch
|
blob
|
blame
|
history
diff --git
a/src/com/owncloud/android/authentication/AuthenticatorActivity.java
b/src/com/owncloud/android/authentication/AuthenticatorActivity.java
index
638b5dd
..
cf76883
100644
(file)
--- a/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
+++ b/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
@@
-518,7
+518,6
@@
SsoWebViewClientListener, OnSslUntrustedCertListener {
// refresh button enabled
\r
outState.putBoolean(KEY_REFRESH_BUTTON_ENABLED, (mRefreshButton.getVisibility() == View.VISIBLE));
\r
\r
// refresh button enabled
\r
outState.putBoolean(KEY_REFRESH_BUTTON_ENABLED, (mRefreshButton.getVisibility() == View.VISIBLE));
\r
\r
-
\r
}
\r
\r
\r
}
\r
\r
\r
@@
-538,7
+537,6
@@
SsoWebViewClientListener, OnSslUntrustedCertListener {
}
\r
}
\r
\r
}
\r
}
\r
\r
-
\r
/**
\r
* The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION, and
\r
* deferred in {@link #onNewIntent(Intent)}, is processed here.
\r
/**
\r
* The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION, and
\r
* deferred in {@link #onNewIntent(Intent)}, is processed here.
\r
@@
-1014,11
+1012,14
@@
SsoWebViewClientListener, OnSslUntrustedCertListener {
private void detectAuthorizationMethod() {
\r
\r
Log_OC.d(TAG, "Trying empty authorization to detect authentication method");
\r
private void detectAuthorizationMethod() {
\r
\r
Log_OC.d(TAG, "Trying empty authorization to detect authentication method");
\r
-
\r
+
\r
+ String webdav_path = AccountUtils.getWebdavPath(mDiscoveredVersion, mAuthTokenType);
\r
+
\r
/// test credentials
\r
/// test credentials
\r
- Intent service = new Intent(this, OperationsService.class);
\r
+ Intent service = new Intent(this, OperationsService.class);
\r
service.setAction(OperationsService.ACTION_DETECT_AUTHENTICATION_METHOD);
\r
service.putExtra(OperationsService.EXTRA_SERVER_URL, mHostBaseUrl);
\r
service.setAction(OperationsService.ACTION_DETECT_AUTHENTICATION_METHOD);
\r
service.putExtra(OperationsService.EXTRA_SERVER_URL, mHostBaseUrl);
\r
+ service.putExtra(OperationsService.EXTRA_WEBDAV_PATH, webdav_path);
\r
startService(service);
\r
}
\r
\r
startService(service);
\r
}
\r
\r
diff --git
a/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java
b/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java
index
c670316
..
6bc8750
100644
(file)
--- a/
src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java
+++ b/
src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java
@@
-64,14
+64,17
@@
public class DetectAuthenticationMethodOperation extends RemoteOperation {
}
private Context mContext;
}
private Context mContext;
+ private String mWebDavUrl;
/**
* Constructor
*
* @param context Android context of the caller.
/**
* Constructor
*
* @param context Android context of the caller.
+ * @param webdavUrl
*/
*/
- public DetectAuthenticationMethodOperation(Context context) {
+ public DetectAuthenticationMethodOperation(Context context
, String webdavUrl
) {
mContext = context;
mContext = context;
+ mWebDavUrl = webdavUrl;
}
}
@@
-90,6
+93,7
@@
public class DetectAuthenticationMethodOperation extends RemoteOperation {
AuthenticationMethod authMethod = AuthenticationMethod.UNKNOWN;
RemoteOperation operation = new ExistenceCheckRemoteOperation("", mContext, false);
AuthenticationMethod authMethod = AuthenticationMethod.UNKNOWN;
RemoteOperation operation = new ExistenceCheckRemoteOperation("", mContext, false);
+ client.setWebdavUri(Uri.parse(mWebDavUrl));
client.setBasicCredentials("", "");
client.setFollowRedirects(false);
client.setBasicCredentials("", "");
client.setFollowRedirects(false);
diff --git
a/src/com/owncloud/android/services/OperationsService.java
b/src/com/owncloud/android/services/OperationsService.java
index
4d1789e
..
0df160a
100644
(file)
--- a/
src/com/owncloud/android/services/OperationsService.java
+++ b/
src/com/owncloud/android/services/OperationsService.java
@@
-59,6
+59,7
@@
public class OperationsService extends Service {
public static final String EXTRA_REMOTE_PATH = "REMOTE_PATH";
public static final String EXTRA_SEND_INTENT = "SEND_INTENT";
public static final String EXTRA_RESULT = "RESULT";
public static final String EXTRA_REMOTE_PATH = "REMOTE_PATH";
public static final String EXTRA_SEND_INTENT = "SEND_INTENT";
public static final String EXTRA_RESULT = "RESULT";
+ public static final String EXTRA_WEBDAV_PATH = "WEBDAV_PATH";
public static final String ACTION_CREATE_SHARE = "CREATE_SHARE";
public static final String ACTION_UNSHARE = "UNSHARE";
public static final String ACTION_CREATE_SHARE = "CREATE_SHARE";
public static final String ACTION_UNSHARE = "UNSHARE";
@@
-136,7
+137,8
@@
public class OperationsService extends Service {
operation = new UnshareLinkOperation(remotePath, this.getApplicationContext());
}
} else if (action.equals(ACTION_DETECT_AUTHENTICATION_METHOD)) { // Detect Authentication Method
operation = new UnshareLinkOperation(remotePath, this.getApplicationContext());
}
} else if (action.equals(ACTION_DETECT_AUTHENTICATION_METHOD)) { // Detect Authentication Method
- operation = new DetectAuthenticationMethodOperation(this.getApplicationContext());
+ String webdav_url = serverUrl + intent.getStringExtra(EXTRA_WEBDAV_PATH);
+ operation = new DetectAuthenticationMethodOperation(this.getApplicationContext(), webdav_url);
} else {
// nothing we are going to handle
} else {
// nothing we are going to handle