|
@@ -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 --------------------------------------------------------------------------------------------
|