From: masensio Date: Mon, 16 Jun 2014 11:18:29 +0000 (+0200) Subject: Update branding: instead of specific option, make that using SAML authentication... X-Git-Tag: oc-android-1.7.0_signed~264^2~10 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/f2320691b3b5918559ece222e80926dd4e119ddd?ds=inline Update branding: instead of specific option, make that using SAML authentication implies enabling the SingleSessionManager. --- diff --git a/owncloud-android-library b/owncloud-android-library index 1d953202..2e4fc047 160000 --- a/owncloud-android-library +++ b/owncloud-android-library @@ -1 +1 @@ -Subproject commit 1d95320277846c082cda2bfcfbbfeb251d03fcc4 +Subproject commit 2e4fc047aff99c238784e7d6091d08f4a3d8c0d5 diff --git a/res/values/setup.xml b/res/values/setup.xml index 6d987118..932612ea 100644 --- a/res/values/setup.xml +++ b/res/values/setup.xml @@ -48,8 +48,6 @@ "mailto:" "mailto:apps@owncloud.com" "https://play.google.com/store/apps/details?id=com.owncloud.android" - - always new client diff --git a/src/com/owncloud/android/MainApp.java b/src/com/owncloud/android/MainApp.java index 4f77b2b4..08efe342 100644 --- a/src/com/owncloud/android/MainApp.java +++ b/src/com/owncloud/android/MainApp.java @@ -31,7 +31,10 @@ import android.content.Context; * @author David A. Velasco */ public class MainApp extends Application { - + + private static final String AUTH_ON = "on"; + + @SuppressWarnings("unused") private static final String POLICY_SINGLE_SESSION_PER_ACCOUNT = "single session per account"; @SuppressWarnings("unused") private static final String POLICY_ALWAYS_NEW_CLIENT = "always new client"; @@ -42,10 +45,9 @@ public class MainApp extends Application { super.onCreate(); MainApp.mContext = getApplicationContext(); - String clientPolicy = getString(R.string.client_creation_policy); - if (clientPolicy != null && - POLICY_SINGLE_SESSION_PER_ACCOUNT.equals(clientPolicy.toLowerCase())) { - + boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso)); + + if (isSamlAuth) { OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT); } else { diff --git a/src/com/owncloud/android/authentication/AuthenticatorActivity.java b/src/com/owncloud/android/authentication/AuthenticatorActivity.java index fccd6154..91ff58fa 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -840,15 +840,14 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { /// test credentials accessing the root folder String remotePath =""; boolean successIfAbsent = false; - boolean followRedirects = true; startExistenceCheckRemoteOperation( - remotePath, this, successIfAbsent, username, password, followRedirects); + remotePath, this, successIfAbsent, username, password); } private void startExistenceCheckRemoteOperation( String remotePath, Context context, boolean successIfAbsent, - String username, String password, boolean followRedirects) { + String username, String password) { Intent existenceCheckIntent = new Intent(); existenceCheckIntent.setAction(OperationsService.ACTION_EXISTENCE_CHECK); existenceCheckIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl); @@ -857,7 +856,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { existenceCheckIntent.putExtra(OperationsService.EXTRA_USERNAME, username); existenceCheckIntent.putExtra(OperationsService.EXTRA_PASSWORD, password); existenceCheckIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN, mAuthToken); - existenceCheckIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects); if (mOperationsServiceBinder != null) { //Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." ); @@ -905,9 +903,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { /// test credentials accessing the root folder String remotePath =""; boolean successIfAbsent = false; - boolean followRedirections = false; startExistenceCheckRemoteOperation( - remotePath, this, successIfAbsent, "", "", followRedirections); + remotePath, this, successIfAbsent, "", ""); } @@ -1295,9 +1292,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { String remotePath =""; boolean successIfAbsent = false; - boolean followRedirects = true; startExistenceCheckRemoteOperation( - remotePath, this, successIfAbsent, "", "", followRedirects); + remotePath, this, successIfAbsent, "", ""); } else { updateAuthStatusIconAndText(result); @@ -1636,7 +1632,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { getUserNameIntent.setAction(OperationsService.ACTION_GET_USER_NAME); getUserNameIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl); getUserNameIntent.putExtra(OperationsService.EXTRA_COOKIE, sessionCookie); - getUserNameIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects); if (mOperationsServiceBinder != null) { //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." ); diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java index 3c56dea3..a1a9d626 100644 --- a/src/com/owncloud/android/services/OperationsService.java +++ b/src/com/owncloud/android/services/OperationsService.java @@ -86,7 +86,6 @@ public class OperationsService extends Service { public static final String EXTRA_USERNAME = "USERNAME"; public static final String EXTRA_PASSWORD = "PASSWORD"; public static final String EXTRA_AUTH_TOKEN = "AUTH_TOKEN"; - public static final String EXTRA_FOLLOW_REDIRECTS = "FOLLOW_REDIRECTS"; public static final String EXTRA_COOKIE = "COOKIE"; public static final String ACTION_CREATE_SHARE = "CREATE_SHARE"; @@ -116,17 +115,15 @@ public class OperationsService extends Service { public String mUsername = null; public String mPassword = null; public String mAuthToken = null; - public boolean mFollowRedirects = true; public String mCookie = null; public Target(Account account, Uri serverUrl, String username, String password, String authToken, - boolean followRedirects, String cookie) { + String cookie) { mAccount = account; mServerUrl = serverUrl; mUsername = username; mPassword = password; mAuthToken = authToken; - mFollowRedirects = followRedirects; mCookie = cookie; } } @@ -305,7 +302,6 @@ public class OperationsService extends Service { String username = operationIntent.getStringExtra(EXTRA_USERNAME); String password = operationIntent.getStringExtra(EXTRA_PASSWORD); String authToken = operationIntent.getStringExtra(EXTRA_AUTH_TOKEN); - boolean followRedirects = operationIntent.getBooleanExtra(EXTRA_FOLLOW_REDIRECTS, true); String cookie = operationIntent.getStringExtra(EXTRA_COOKIE); target = new Target( account, @@ -313,7 +309,6 @@ public class OperationsService extends Service { username, password, authToken, - followRedirects, cookie ); @@ -497,7 +492,6 @@ public class OperationsService extends Service { mLastTarget.mServerUrl, credentials); mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, this); - mOwnCloudClient.setFollowRedirects(mLastTarget.mFollowRedirects); mStorageManager = null; } }