瀏覽代碼

Update branding: instead of specific option, make that using SAML authentication implies enabling the SingleSessionManager.

masensio 10 年之前
父節點
當前提交
f2320691b3

+ 1 - 1
owncloud-android-library

@@ -1 +1 @@
-Subproject commit 1d95320277846c082cda2bfcfbbfeb251d03fcc4
+Subproject commit 2e4fc047aff99c238784e7d6091d08f4a3d8c0d5

+ 0 - 2
res/values/setup.xml

@@ -48,8 +48,6 @@
     <string name="mail_recommend">"mailto:"</string>
     <string name="mail_feedback">"mailto:apps@owncloud.com"</string>
     <string name="url_app_download">"https://play.google.com/store/apps/details?id=com.owncloud.android"</string>
-    
-    <string name="client_creation_policy">always new client</string>
 
 </resources>
 

+ 7 - 5
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 {

+ 4 - 9
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..." );

+ 1 - 7
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;
                     }
                 }