marinofaggiana 3 年之前
父節點
當前提交
93410d75de
共有 2 個文件被更改,包括 14 次插入2 次删除
  1. 12 2
      iOSClient/Login/NCLogin.swift
  2. 2 0
      iOSClient/Supporting Files/en.lproj/Localizable.strings

+ 12 - 2
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 {

+ 2 - 0
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";