OC-1508: App crashes when changing the orientation
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AccountUtils.java
index 639a3b9..47269bc 100644 (file)
@@ -32,7 +32,7 @@ public class AccountUtils {
     public static final String WEBDAV_PATH_2_0 = "/files/webdav.php";\r
     public static final String WEBDAV_PATH_4_0 = "/remote.php/webdav";\r
     private static final String ODAV_PATH = "/remote.php/odav";\r
-    private static final String SAML_SSO_PATH = "/ocShibAuth";\r
+    private static final String SAML_SSO_PATH = "/remote.php/webdav";\r
     public static final String CARDDAV_PATH_2_0 = "/apps/contacts/carddav.php";\r
     public static final String CARDDAV_PATH_4_0 = "/remote/carddav.php";\r
     public static final String STATUS_PATH = "/status.php";\r
@@ -75,6 +75,20 @@ public class AccountUtils {
     }\r
 \r
     \r
+    public static boolean exists(Account account, Context context) {\r
+        Account[] ocAccounts = AccountManager.get(context).getAccountsByType(\r
+                AccountAuthenticator.ACCOUNT_TYPE);\r
+\r
+        if (account != null && account.name != null) {\r
+            for (Account ac : ocAccounts) {\r
+                if (ac.name.equals(account.name)) {\r
+                    return true;\r
+                }\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+    \r
 \r
     /**\r
      * Checks, whether or not there are any ownCloud accounts setup.\r