Update branding: instead of specific option, make that using SAML authentication...
authormasensio <masensio@solidgear.es>
Mon, 16 Jun 2014 11:18:29 +0000 (13:18 +0200)
committermasensio <masensio@solidgear.es>
Mon, 16 Jun 2014 11:18:29 +0000 (13:18 +0200)
owncloud-android-library
res/values/setup.xml
src/com/owncloud/android/MainApp.java
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/services/OperationsService.java

index 1d95320..2e4fc04 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1d95320277846c082cda2bfcfbbfeb251d03fcc4
+Subproject commit 2e4fc047aff99c238784e7d6091d08f4a3d8c0d5
index 6d98711..932612e 100644 (file)
@@ -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="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>
 
 
 </resources>
 
index 4f77b2b..08efe34 100644 (file)
@@ -31,7 +31,10 @@ import android.content.Context;
  * @author David A. Velasco
  */
 public class MainApp extends Application {
  * @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";
     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();
         
         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 {
             OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
             
         } else {
index fccd615..91ff58f 100644 (file)
@@ -840,15 +840,14 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         /// test credentials accessing the root folder\r
         String remotePath ="";\r
         boolean successIfAbsent = false;\r
         /// test credentials accessing the root folder\r
         String remotePath ="";\r
         boolean successIfAbsent = false;\r
-        boolean followRedirects = true;\r
         startExistenceCheckRemoteOperation(\r
         startExistenceCheckRemoteOperation(\r
-                remotePath, this, successIfAbsent, username, password, followRedirects);\r
+                remotePath, this, successIfAbsent, username, password);\r
         \r
     }\r
 \r
     private void startExistenceCheckRemoteOperation(\r
             String remotePath, Context context, boolean successIfAbsent,\r
         \r
     }\r
 \r
     private void startExistenceCheckRemoteOperation(\r
             String remotePath, Context context, boolean successIfAbsent,\r
-            String username, String password, boolean followRedirects) {\r
+            String username, String password) {\r
         Intent existenceCheckIntent = new Intent();\r
         existenceCheckIntent.setAction(OperationsService.ACTION_EXISTENCE_CHECK);\r
         existenceCheckIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl);\r
         Intent existenceCheckIntent = new Intent();\r
         existenceCheckIntent.setAction(OperationsService.ACTION_EXISTENCE_CHECK);\r
         existenceCheckIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl);\r
@@ -857,7 +856,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         existenceCheckIntent.putExtra(OperationsService.EXTRA_USERNAME, username);\r
         existenceCheckIntent.putExtra(OperationsService.EXTRA_PASSWORD, password);\r
         existenceCheckIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN, mAuthToken);\r
         existenceCheckIntent.putExtra(OperationsService.EXTRA_USERNAME, username);\r
         existenceCheckIntent.putExtra(OperationsService.EXTRA_PASSWORD, password);\r
         existenceCheckIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN, mAuthToken);\r
-        existenceCheckIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects);\r
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );\r
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );\r
@@ -905,9 +903,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         /// test credentials accessing the root folder\r
         String remotePath ="";\r
         boolean successIfAbsent = false;\r
         /// test credentials accessing the root folder\r
         String remotePath ="";\r
         boolean successIfAbsent = false;\r
-        boolean followRedirections = false;\r
         startExistenceCheckRemoteOperation(\r
         startExistenceCheckRemoteOperation(\r
-                remotePath, this, successIfAbsent, "", "", followRedirections);\r
+                remotePath, this, successIfAbsent, "", "");\r
 \r
     }\r
 \r
 \r
     }\r
 \r
@@ -1295,9 +1292,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             \r
             String remotePath ="";\r
             boolean successIfAbsent = false;\r
             \r
             String remotePath ="";\r
             boolean successIfAbsent = false;\r
-            boolean followRedirects = true;\r
             startExistenceCheckRemoteOperation(\r
             startExistenceCheckRemoteOperation(\r
-                    remotePath, this, successIfAbsent, "", "", followRedirects);\r
+                    remotePath, this, successIfAbsent, "", "");\r
 \r
         } else {\r
             updateAuthStatusIconAndText(result);\r
 \r
         } else {\r
             updateAuthStatusIconAndText(result);\r
@@ -1636,7 +1632,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         getUserNameIntent.setAction(OperationsService.ACTION_GET_USER_NAME);\r
         getUserNameIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl);\r
         getUserNameIntent.putExtra(OperationsService.EXTRA_COOKIE, sessionCookie);\r
         getUserNameIntent.setAction(OperationsService.ACTION_GET_USER_NAME);\r
         getUserNameIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl);\r
         getUserNameIntent.putExtra(OperationsService.EXTRA_COOKIE, sessionCookie);\r
-        getUserNameIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects);\r
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
index 3c56dea..a1a9d62 100644 (file)
@@ -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_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";
     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 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,
         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;
             mAccount = account;
             mServerUrl = serverUrl;
             mUsername = username;
             mPassword = password;
             mAuthToken = authToken;
-            mFollowRedirects = followRedirects;
             mCookie = cookie;
         }
     }
             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);
                     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, 
                     String cookie = operationIntent.getStringExtra(EXTRA_COOKIE);
                     target = new Target(
                             account, 
@@ -313,7 +309,6 @@ public class OperationsService extends Service {
                             username,
                             password,
                             authToken,
                             username,
                             password,
                             authToken,
-                            followRedirects,
                             cookie
                     );
                     
                             cookie
                     );
                     
@@ -497,7 +492,6 @@ public class OperationsService extends Service {
                                 mLastTarget.mServerUrl, credentials);
                         mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                                 getClientFor(ocAccount, this);
                                 mLastTarget.mServerUrl, credentials);
                         mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                                 getClientFor(ocAccount, this);
-                        mOwnCloudClient.setFollowRedirects(mLastTarget.mFollowRedirects);
                         mStorageManager = null;
                     }
                 }
                         mStorageManager = null;
                     }
                 }