Marino Faggiana 7 years ago
parent
commit
6be8947e91

+ 3 - 3
iOSClient/Login/CCLogin.m

@@ -25,6 +25,7 @@
 #import "AppDelegate.h"
 #import "AppDelegate.h"
 #import "CCUtility.h"
 #import "CCUtility.h"
 #import "NCBridgeSwift.h"
 #import "NCBridgeSwift.h"
+#import "NCNetworkingSync.h"
 
 
 @interface CCLogin ()
 @interface CCLogin ()
 {
 {
@@ -259,9 +260,8 @@
     if ([[self.baseUrl.text substringFromIndex:[self.baseUrl.text length] - 1] isEqualToString:@"/"])
     if ([[self.baseUrl.text substringFromIndex:[self.baseUrl.text length] - 1] isEqualToString:@"/"])
         self.baseUrl.text = [self.baseUrl.text substringToIndex:[self.baseUrl.text length] - 1];
         self.baseUrl.text = [self.baseUrl.text substringToIndex:[self.baseUrl.text length] - 1];
     
     
-    OCnetworking *ocNet = [[OCnetworking alloc] initWithDelegate:self metadataNet:nil withUser:self.user.text withUserID:self.user.text withPassword:self.password.text withUrl:nil];
-    NSError *error = [ocNet checkServerSync:[NSString stringWithFormat:@"%@%@", self.baseUrl.text, webDAV]];
-    
+    NSError *error = [[NCNetworkingSync sharedManager] checkServer:[NSString stringWithFormat:@"%@%@", self.baseUrl.text, webDAV] user:self.user.text userID:self.user.text password:self.password.text];
+
     if (!error) {
     if (!error) {
         
         
         // account
         // account

+ 0 - 1
iOSClient/Networking/OCNetworking.h

@@ -43,7 +43,6 @@
 @property (nonatomic, assign) BOOL isFinished;
 @property (nonatomic, assign) BOOL isFinished;
 
 
 - (NSError *)readFileSync:(NSString *)filePathName;
 - (NSError *)readFileSync:(NSString *)filePathName;
-- (NSError *)checkServerSync:(NSString *)serverUrl;
 - (BOOL)automaticCreateFolderSync:(NSString *)folderPathName;
 - (BOOL)automaticCreateFolderSync:(NSString *)folderPathName;
 
 
 @end
 @end

+ 0 - 35
iOSClient/Networking/OCNetworking.m

@@ -1585,41 +1585,6 @@
     }];
     }];
 }
 }
 
 
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Server =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (NSError *)checkServerSync:(NSString *)serverUrl
-{
-    OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
-    __block NSError *returnError;
-    
-    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
-    
-    [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
-    [communication setUserAgent:[CCUtility getUserAgent]];
-    
-    [communication checkServer:serverUrl onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
-        
-        returnError = nil;
-        dispatch_semaphore_signal(semaphore);
-
-    } failureRequest:^(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer) {
-        
-        // Request trusted certificated
-        if ([error code] == NSURLErrorServerCertificateUntrusted)
-            [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
-        
-        returnError = error;
-        dispatch_semaphore_signal(semaphore);
-    }];
-     
-    while (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_NOW))
-    [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:k_timeout_webdav]];
-     
-    return returnError;
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Capabilities =====
 #pragma mark ===== Capabilities =====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------