Skip to content

Commit 7a4bb44

Browse files
Version 5.5.4 (#3026)
1 parent 775af0c commit 7a4bb44

File tree

112 files changed

+58
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+58
-68
lines changed

β€ŽNextcloud.xcodeproj/project.pbxprojβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5441,7 +5441,7 @@
54415441
"@executable_path/Frameworks",
54425442
"@executable_path/../../Frameworks",
54435443
);
5444-
MARKETING_VERSION = 5.5.3;
5444+
MARKETING_VERSION = 5.5.4;
54455445
ONLY_ACTIVE_ARCH = YES;
54465446
OTHER_CFLAGS = "-v";
54475447
OTHER_LDFLAGS = "";
@@ -5504,7 +5504,7 @@
55045504
"@executable_path/Frameworks",
55055505
"@executable_path/../../Frameworks",
55065506
);
5507-
MARKETING_VERSION = 5.5.3;
5507+
MARKETING_VERSION = 5.5.4;
55085508
ONLY_ACTIVE_ARCH = YES;
55095509
OTHER_CFLAGS = "-v";
55105510
OTHER_LDFLAGS = "";
@@ -5779,7 +5779,7 @@
57795779
repositoryURL = "https://github.com/nextcloud/NextcloudKit";
57805780
requirement = {
57815781
kind = exactVersion;
5782-
version = 4.0.4;
5782+
version = 4.0.6;
57835783
};
57845784
};
57855785
F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {

β€ŽiOSClient/AppDelegate.swiftβ€Ž

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
356356
window.makeKeyAndVisible()
357357
} else {
358358
UIApplication.shared.allSceneSessionDestructionExceptFirst()
359-
UIApplication.shared.firstWindow?.rootViewController?.present(navigationController, animated: true)
359+
360+
if let rootVC = UIApplication.shared.firstWindow?.rootViewController {
361+
if let presentedVC = rootVC.presentedViewController, !(presentedVC is NCLoginNavigationController) {
362+
presentedVC.dismiss(animated: false) {
363+
rootVC.present(navigationController, animated: true)
364+
}
365+
} else {
366+
rootVC.present(navigationController, animated: true)
367+
}
368+
}
360369
}
361370
}
362371

@@ -374,27 +383,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
374383
showLoginViewController(activeLogin)
375384
}
376385
}
377-
378-
} else if NCBrandOptions.shared.disable_request_login_url {
379-
if activeLogin?.view.window == nil {
380-
activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
381-
activeLogin?.urlBase = NCBrandOptions.shared.loginBaseUrl
382-
showLoginViewController(activeLogin)
383-
}
384-
} else if openLoginWeb {
385-
// Used also for reinsert the account (change passwd)
386-
if activeLogin?.view.window == nil {
387-
activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
388-
activeLogin?.urlBase = urlBase
389-
activeLogin?.disableUrlField = true
390-
activeLogin?.disableCloseButton = true
391-
showLoginViewController(activeLogin)
392-
}
393386
} else {
394387
if activeLogin?.view.window == nil {
395-
activeLogin?.disableCloseButton = true
396-
397388
activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
389+
activeLogin?.urlBase = NCBrandOptions.shared.disable_request_login_url ? NCBrandOptions.shared.loginBaseUrl : ""
398390
showLoginViewController(activeLogin)
399391
}
400392
}
@@ -411,7 +403,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
411403
guard !self.timerErrorNetworkingDisabled,
412404
!account.isEmpty,
413405
NCKeychain().getPassword(account: account).isEmpty else { return }
414-
openLogin(selector: NCGlobal.shared.introLogin, openLoginWeb: true)
406+
407+
let description = String.localizedStringWithFormat(NSLocalizedString("_error_check_remote_user_", comment: ""))
408+
let error = NKError(errorCode: NCKeychain().getPassword(account: account).isEmpty ? NCGlobal.shared.errorUnauthorized997 : NCGlobal.shared.errorInternalServerError, errorDescription: description)
409+
NCContentPresenter().showError(error: error, priority: .max)
410+
411+
deleteAccount(account)
412+
413+
let accounts = NCManageDatabase.shared.getAccounts()
414+
415+
if accounts?.count ?? 0 > 0, let newAccount = accounts?.first {
416+
changeAccount(newAccount, userProfile: nil) { }
417+
} else {
418+
openLogin(selector: NCGlobal.shared.introLogin, openLoginWeb: false)
419+
}
415420
}
416421

417422
func trustCertificateError(host: String) {
@@ -545,12 +550,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
545550
self.user = ""
546551
self.userId = ""
547552
self.password = ""
548-
549-
/*
550-
NextcloudKit.shared.deleteAppPassword(serverUrl: urlBase, username: userId, password: password) { _, error in
551-
print(error)
552-
}
553-
*/
554553
}
555554

556555
func deleteAllAccounts() {

β€ŽiOSClient/Login/NCLogin.swiftβ€Ž

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
5151

5252
/// The URL that will show up on the URL field when this screen appears
5353
var urlBase = ""
54-
var disableUrlField = false
55-
var disableCloseButton = false
5654

5755
// Used for MDM
5856
var configServerUrl: String?
@@ -95,7 +93,8 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
9593
baseUrl.rightViewMode = .always
9694
baseUrl.attributedPlaceholder = NSAttributedString(string: NSLocalizedString("_login_url_", comment: ""), attributes: [NSAttributedString.Key.foregroundColor: textColor.withAlphaComponent(0.5)])
9795
baseUrl.delegate = self
98-
baseUrl.isEnabled = !disableUrlField
96+
97+
baseUrl.isEnabled = !NCBrandOptions.shared.disable_request_login_url
9998

10099
// Login button
101100
loginAddressDetail.textColor = textColor
@@ -106,7 +105,6 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
106105

107106
// brand
108107
if NCBrandOptions.shared.disable_request_login_url {
109-
baseUrl.text = NCBrandOptions.shared.loginBaseUrl
110108
baseUrl.isEnabled = false
111109
baseUrl.isUserInteractionEnabled = false
112110
baseUrl.alpha = 0.5
@@ -131,7 +129,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
131129
self.navigationController?.view.backgroundColor = NCBrandColor.shared.customer
132130
self.navigationController?.navigationBar.tintColor = textColor
133131

134-
if !NCManageDatabase.shared.getAllAccount().isEmpty && !disableCloseButton {
132+
if !NCManageDatabase.shared.getAllAccount().isEmpty {
135133
let navigationItemCancel = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(self.actionCancel))
136134
navigationItemCancel.tintColor = textColor
137135
navigationItem.leftBarButtonItem = navigationItemCancel

β€ŽiOSClient/Main/Collection Common/NCCollectionViewCommon.swiftβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
776776
}
777777
])
778778

779-
let viewStyleSubmenu = UIMenu(title: "", options: .displayInline, children: [list, grid, UIMenu(title: NSLocalizedString("_photo_", comment: ""), children: [menuPhoto, menuZoom])])
779+
let viewStyleSubmenu = UIMenu(title: "", options: .displayInline, children: [list, grid, UIMenu(title: NSLocalizedString("_additional_view_options_", comment: ""), children: [menuPhoto, menuZoom])])
780780

781781
let ascending = layoutForView.ascending
782782
let ascendingChevronImage = utility.loadImage(named: ascending ? "chevron.up" : "chevron.down")

β€ŽiOSClient/Networking/NCNetworkingCheckRemoteUser.swiftβ€Ž

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,37 +33,29 @@ class NCNetworkingCheckRemoteUser {
3333

3434
NCNetworking.shared.cancelAllTask()
3535

36-
if NCGlobal.shared.capabilityServerVersionMajor >= NCGlobal.shared.nextcloudVersion17 {
37-
NextcloudKit.shared.getRemoteWipeStatus(serverUrl: tableAccount.urlBase, token: token, account: tableAccount.account) { account, wipe, _, error in
38-
if wipe {
39-
appDelegate.deleteAccount(account)
40-
let error = NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_wipe_account_")
41-
NCContentPresenter().messageNotification(tableAccount.user, error: error, delay: NCGlobal.shared.dismissAfterSecondLong, type: NCContentPresenter.messageType.error, priority: .max)
42-
NextcloudKit.shared.setRemoteWipeCompletition(serverUrl: tableAccount.urlBase, token: token, account: tableAccount.account) { _, _ in print("wipe") }
43-
let accounts = NCManageDatabase.shared.getAccounts()
44-
if accounts?.count ?? 0 > 0 {
45-
if let newAccount = accounts?.first {
46-
appDelegate.changeAccount(newAccount, userProfile: nil) { }
47-
} else {
48-
appDelegate.openLogin(selector: NCGlobal.shared.introLogin, openLoginWeb: false)
49-
}
50-
}
51-
} else {
52-
if UIApplication.shared.applicationState == .active && NextcloudKit.shared.isNetworkReachable() {
53-
let description = String.localizedStringWithFormat(NSLocalizedString("_error_check_remote_user_", comment: ""), tableAccount.user, tableAccount.urlBase)
54-
let error = NKError(errorCode: error.errorCode, errorDescription: description)
55-
NCContentPresenter().showError(error: error, priority: .max)
56-
NCKeychain().setPassword(account: account, password: nil)
57-
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Password removed.")
58-
}
59-
}
36+
NextcloudKit.shared.getRemoteWipeStatus(serverUrl: tableAccount.urlBase, token: token, account: tableAccount.account) { account, wipe, _, error in
37+
var finalError: NKError?
38+
39+
if wipe {
40+
appDelegate.deleteAccount(account) // delete account, don't delete database
41+
finalError = NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_wipe_account_")
42+
} else if UIApplication.shared.applicationState == .active && NextcloudKit.shared.isNetworkReachable() {
43+
appDelegate.deleteAccount(account) // delete account, delete database
44+
finalError = NKError(errorCode: error.errorCode, errorDescription: "_error_check_remote_user_")
45+
}
46+
47+
if let finalError {
48+
NCContentPresenter().messageNotification(tableAccount.user, error: finalError, delay: NCGlobal.shared.dismissAfterSecondLong, type: NCContentPresenter.messageType.error, priority: .max)
6049
}
61-
} else {
62-
if UIApplication.shared.applicationState == .active && NextcloudKit.shared.isNetworkReachable() {
63-
let description = String.localizedStringWithFormat(NSLocalizedString("_error_check_remote_user_", comment: ""), tableAccount.user, tableAccount.urlBase)
64-
let error = NKError(errorCode: error.errorCode, errorDescription: description)
65-
NCContentPresenter().showError(error: error, priority: .max)
66-
NCKeychain().setPassword(account: account, password: nil)
50+
51+
NextcloudKit.shared.setRemoteWipeCompletition(serverUrl: tableAccount.urlBase, token: token, account: tableAccount.account) { _, _ in print("wipe") }
52+
53+
let accounts = NCManageDatabase.shared.getAccounts()
54+
55+
if accounts?.count ?? 0 > 0, let newAccount = accounts?.first {
56+
appDelegate.changeAccount(newAccount, userProfile: nil) { }
57+
} else {
58+
appDelegate.openLogin(selector: NCGlobal.shared.introLogin, openLoginWeb: false)
6759
}
6860
}
6961
}
-8 Bytes
Binary file not shown.
-8 Bytes
Binary file not shown.
10 Bytes
Binary file not shown.
-8 Bytes
Binary file not shown.
-8 Bytes
Binary file not shown.

0 commit comments

Comments
Β (0)