Browse Source

clear code

Marino Faggiana 6 years ago
parent
commit
4691e561fa

+ 0 - 62
iOSClient/Login/CCLogin.m

@@ -426,68 +426,6 @@
         self.login.enabled = YES;
         self.loadingBaseUrl.hidden = YES;
     }];
-    
-    /*
-    NSError *error = [[NCNetworkingSync sharedManager] checkServer:[NSString stringWithFormat:@"%@%@", url, webDAV] user:user userID:user password:password];
-
-    dispatch_async(dispatch_get_main_queue(), ^{
-
-        self.login.enabled = NO;
-        self.loadingBaseUrl.hidden = NO;
-        
-        if (!error) {
-        
-            // account
-            NSString *account = [NSString stringWithFormat:@"%@ %@", user, url];
-        
-            if (_loginType == loginModifyPasswordUser) {
-            
-                // Change Password
-                tableAccount *tbAccount = [[NCManageDatabase sharedInstance] setAccountPassword:account password:password];
-            
-                // Setting appDelegate active account
-                [appDelegate settingActiveAccount:tbAccount.account activeUrl:tbAccount.url activeUser:tbAccount.user activeUserID:tbAccount.userID activePassword:tbAccount.password];
-
-                [self.delegate loginSuccess:_loginType];
-            
-                [self dismissViewControllerAnimated:YES completion:nil];
-            
-            } else {
-
-                [[NCManageDatabase sharedInstance] deleteAccount:account];
-                [[NCManageDatabase sharedInstance] addAccount:account url:url user:user password:password loginFlow:false];
-            
-                tableAccount *tableAccount = [[NCManageDatabase sharedInstance] setAccountActive:account];
-                
-                // Setting appDelegate active account
-                [appDelegate settingActiveAccount:tableAccount.account activeUrl:tableAccount.url activeUser:tableAccount.user activeUserID:tableAccount.userID activePassword:tableAccount.password];
-                    
-                [self.delegate loginSuccess:_loginType];
-                    
-                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-                    [self dismissViewControllerAnimated:YES completion:nil];
-                });
-            }
-        
-        } else {
-        
-            if ([error code] != NSURLErrorServerCertificateUntrusted) {
-            
-                NSString *description = [error.userInfo objectForKey:@"NSLocalizedDescription"];
-                NSString *message = [NSString stringWithFormat:@"%@.\n%@", NSLocalizedStringFromTable(@"_not_possible_connect_to_server_", @"Error", nil), description];
-            
-                UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_", nil) message:message preferredStyle:UIAlertControllerStyleAlert];
-                UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {}];
-            
-                [alertController addAction:okAction];
-                [self presentViewController:alertController animated:YES completion:nil];
-            }
-        }
-        
-        self.login.enabled = YES;
-        self.loadingBaseUrl.hidden = YES;
-    });
-    */
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 0 - 1
iOSClient/Networking/NCNetworkingSync.h

@@ -13,7 +13,6 @@
 
 + (NCNetworkingSync *)sharedManager;
 
-- (NSError *)uploadFile:(NSString *)localFilePathName remoteFilePathName:(NSString *)remoteFilePathName user:(NSString *)user userID:(NSString *)userID password:(NSString *)password;
 - (NSError *)readFile:(NSString *)filePathName user:(NSString *)user userID:(NSString *)userID password:(NSString *)password items:(NSArray **)items;
 - (NSError *)readFolder:(NSString *)serverUrl user:(NSString *)user userID:(NSString *)userID password:(NSString *)password items:(NSArray **)items;
 - (NSError *)createFolder:(NSString *)folderPathName user:(NSString *)user userID:(NSString *)userID password:(NSString *)password url:(NSString *)url encrypted:(BOOL)encrypted fileID:(NSString **)fileID;

+ 0 - 35
iOSClient/Networking/NCNetworkingSync.m

@@ -37,41 +37,6 @@
 #pragma mark ============================
 #pragma --------------------------------------------------------------------------------------------
 
-- (NSError *)uploadFile:(NSString *)localFilePathName remoteFilePathName:(NSString *)remoteFilePathName user:(NSString *)user userID:(NSString *)userID password:(NSString *)password
-{
-    OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
-    __block NSError *returnError = nil;
-    
-    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
-
-    [communication setCredentialsWithUser:user andUserID:userID andPassword:password];
-    [communication setUserAgent:[CCUtility getUserAgent]];
-    
-    [communication uploadFileSession:localFilePathName toDestiny:remoteFilePathName onCommunication:communication progress:^(NSProgress *progress) {
-        // Progress
-    } successRequest:^(NSURLResponse *response, NSString *redirectedServer) {
-        
-        dispatch_semaphore_signal(semaphore);
-        
-    } failureRequest:^(NSURLResponse *response, NSString *redirectedServer, NSError *error) {
-        
-        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
-        returnError = [self getError:httpResponse error:error descriptionDefault:@"_error_upload_file_"];
-        dispatch_semaphore_signal(semaphore);
-
-    } failureBeforeRequest:^(NSError *error) {
-        
-        returnError = error;
-        dispatch_semaphore_signal(semaphore);
-
-    }];
-     
-     while (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER))
-         [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:k_timeout_webdav]];
-     
-     return returnError;
-}
-
 - (NSError *)readFile:(NSString *)filePathName user:(NSString *)user userID:(NSString *)userID password:(NSString *)password items:(NSArray  **)items
 {
     OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;