瀏覽代碼

ITMS-90076

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 年之前
父節點
當前提交
edc17b45ec
共有 2 個文件被更改,包括 17 次插入8 次删除
  1. 0 8
      iOSClient/AppDelegate.swift
  2. 17 0
      iOSClient/Login/NCLoginWeb.swift

+ 0 - 8
iOSClient/AppDelegate.swift

@@ -189,14 +189,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             }
         }
 
-        // ITMS-90076: Potential Loss of Keychain Access
-        if let account = NCManageDatabase.shared.getActiveAccount(), CCUtility.getPassword(account.account).isEmpty, NCUtility.shared.getVersionApp(withBuild: false) == "4.4.1" {
-
-            let alertController = UIAlertController(title: NSLocalizedString("_info_", comment: ""), message: "Due to a change in the Nextcloud application identifier, the settings and password for accessing your cloud are reset, so please re-enter your account data and check your Settings, we are sorry about what happened but it is not up to us.", preferredStyle: .alert)
-            alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
-            window?.rootViewController?.present(alertController, animated: true, completion: { })
-        }
-
         return true
     }
 

+ 17 - 0
iOSClient/Login/NCLoginWeb.swift

@@ -31,6 +31,7 @@ class NCLoginWeb: UIViewController {
     var activityIndicator: UIActivityIndicatorView!
     var webView: WKWebView?
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    var titleView: String = ""
 
     @objc var urlBase = ""
 
@@ -45,6 +46,9 @@ class NCLoginWeb: UIViewController {
         super.viewDidLoad()
 
         let accountCount = NCManageDatabase.shared.getAccounts()?.count ?? 0
+        // TITLE
+        titleView = urlBase
+        title = titleView
 
         if NCBrandOptions.shared.use_login_web_personalized  && accountCount > 0 {
             navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(self.closeView(sender:)))
@@ -93,6 +97,19 @@ class NCLoginWeb: UIViewController {
 
         // Stop timer error network
         appDelegate.timerErrorNetworking?.invalidate()
+
+        // ITMS-90076: Potential Loss of Keychain Access
+        if let account = NCManageDatabase.shared.getActiveAccount(), CCUtility.getPassword(account.account).isEmpty, NCUtility.shared.getVersionApp(withBuild: false) == "4.4.1" {
+
+            var title = titleView
+            if let host = URL(string: urlBase)?.host {
+                title = NSLocalizedString("_user_", comment: "") + " " + account.userId + " " + NSLocalizedString("_in_", comment: "") + " " + host
+            }
+            let alertController = UIAlertController(title: title, message: "\n" + "Due to a change in the Nextcloud application identifier, the settings and password for accessing your cloud are reset, so please re-enter your account data and check your Settings, we are sorry about what happened but it is not up to us.", preferredStyle: .alert)
+            alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
+            present(alertController, animated: true, completion: { })
+            return
+        }
     }
 
     override func viewDidDisappear(_ animated: Bool) {