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