|
@@ -372,72 +372,6 @@
|
|
|
}
|
|
|
}
|
|
|
}];
|
|
|
-
|
|
|
- /*
|
|
|
- [[OCNetworking sharedManager] checkServerUrl:[NSString stringWithFormat:@"%@%@", url, k_webDAV] user:user userID:user password:password completion:^(NSString *message, NSInteger errorCode) {
|
|
|
-
|
|
|
- if (errorCode == 0) {
|
|
|
-
|
|
|
- [self.activity stopAnimating];
|
|
|
-
|
|
|
- // account
|
|
|
- NSString *account = [NSString stringWithFormat:@"%@ %@", user, url];
|
|
|
-
|
|
|
- if (_loginType == k_login_Modify_Password) {
|
|
|
-
|
|
|
- tableAccount *tableAccount = [[NCManageDatabase sharedInstance] setAccountActive:account];
|
|
|
-
|
|
|
- // Change Password
|
|
|
- [CCUtility setPassword:account password:password];
|
|
|
-
|
|
|
- // Setting appDelegate active account
|
|
|
- [appDelegate settingActiveAccount:account activeUrl:tableAccount.url activeUser:tableAccount.user activeUserID:tableAccount.userID activePassword:password];
|
|
|
-
|
|
|
-
|
|
|
- [self dismissViewControllerAnimated:YES completion:nil];
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- // NO account found, clear
|
|
|
- if ([NCManageDatabase.sharedInstance getAccounts] == nil) {
|
|
|
- [NCUtility.sharedInstance removeAllSettings];
|
|
|
- }
|
|
|
-
|
|
|
- // STOP Intro
|
|
|
- [CCUtility setIntro:YES];
|
|
|
-
|
|
|
- [[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:[CCUtility getPassword:tableAccount.account]];
|
|
|
-
|
|
|
-
|
|
|
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
|
|
- [self dismissViewControllerAnimated:YES completion:nil];
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- self.login.enabled = YES;
|
|
|
- [self.activity stopAnimating];
|
|
|
-
|
|
|
- if (errorCode != NSURLErrorServerCertificateUntrusted) {
|
|
|
-
|
|
|
- NSString *messageAlert = [NSString stringWithFormat:@"%@.\n%@", NSLocalizedString(@"_not_possible_connect_to_server_", nil), message];
|
|
|
-
|
|
|
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_", nil) message:messageAlert preferredStyle:UIAlertControllerStyleAlert];
|
|
|
- UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {}];
|
|
|
-
|
|
|
- [alertController addAction:okAction];
|
|
|
- [self presentViewController:alertController animated:YES completion:nil];
|
|
|
- }
|
|
|
- }
|
|
|
- }];
|
|
|
- */
|
|
|
}
|
|
|
}
|
|
|
|