diff options
-rw-r--r-- | iOSClient/Login/NCLogin.swift | 14 | ||||
-rw-r--r-- | iOSClient/Supporting Files/en.lproj/Localizable.strings | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/iOSClient/Login/NCLogin.swift b/iOSClient/Login/NCLogin.swift index a12127a91..964cb80c2 100644 --- a/iOSClient/Login/NCLogin.swift +++ b/iOSClient/Login/NCLogin.swift @@ -251,6 +251,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate { let pathsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let fileNameCertificate = pathsDirectory.appendingPathComponent(NCGlobal.shared.certificate).path let directoryCertificate = CCUtility.getDirectoryCerificates()! + var host = "cloud.nextcloud.com" if let url = URL(string: NCBrandOptions.shared.loginBaseUrl) { let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) @@ -264,9 +265,18 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate { let certificateToPath = directoryCertificate + "/" + host + ".der" if NCUtilityFileSystem.shared.moveFile(atPath: fileNameCertificate, toPath: certificateToPath) { - print("ok") + + let message = String(format: NSLocalizedString("_certificate_installed_", comment: ""), NCGlobal.shared.certificate) + let alertController = UIAlertController(title: "", message: message, preferredStyle: .alert) + alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in })) + self.present(alertController, animated: true, completion: { }) + } else { - print("error") + + let message = String(format: NSLocalizedString("_copy_failed_", comment: ""), NCGlobal.shared.certificate) + let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: message, preferredStyle: .alert) + alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in })) + self.present(alertController, animated: true, completion: { }) } } else { diff --git a/iOSClient/Supporting Files/en.lproj/Localizable.strings b/iOSClient/Supporting Files/en.lproj/Localizable.strings index 00903ea1a..daac6205e 100644 --- a/iOSClient/Supporting Files/en.lproj/Localizable.strings +++ b/iOSClient/Supporting Files/en.lproj/Localizable.strings @@ -175,6 +175,8 @@ "_account_select_" = "Select the account"; "_host_insert_" = "Insert the host name, for example"; "_certificate_not_found_" = "File %@ in documents directory not found."; +"_copy_failed_" = "Copy failed"; +"_certificate_installed_" = "Certificate installed"; /* Background of the file listing view */ "_use_as_background_" = "Use it as a background"; |