diff --git a/ios-sdk b/ios-sdk
index 99e78d1b4..5ee6fffca 160000
--- a/ios-sdk
+++ b/ios-sdk
@@ -1 +1 @@
-Subproject commit 99e78d1b41405cdc65954cce71a5390e3efb9dd8
+Subproject commit 5ee6fffca5137c69bf5dff0a0a10f8a12c3aa943
diff --git a/ownCloud.xcodeproj/xcshareddata/xcschemes/ownCloud.xcscheme b/ownCloud.xcodeproj/xcshareddata/xcschemes/ownCloud.xcscheme
index fb91816c3..813aadac2 100644
--- a/ownCloud.xcodeproj/xcshareddata/xcschemes/ownCloud.xcscheme
+++ b/ownCloud.xcodeproj/xcshareddata/xcschemes/ownCloud.xcscheme
@@ -300,6 +300,16 @@
value = "[recovering-apm]"
isEnabled = "NO">
+
+
+
+
StaticTableViewSection {
+ var accountEntryMaskSection : StaticTableViewSection
+
+ accountEntryMaskSection = StaticTableViewSection(headerTitle: nil, identifier: "accountEntryMaskSection")
+ accountEntryMaskSection.addStaticHeader(title: profile.welcome!, message: "Enter username".localized)
+
+ accountEntryMaskSection.add(row: StaticTableViewRow(textFieldWithAction: { [weak self] (row, _, type) in
+ if type == .didBegin, let cell = row.cell, let indexPath = self?.tableView.indexPath(for: cell) {
+ self?.tableView.scrollToRow(at: indexPath, at: .top, animated: true)
+ }
+ if let value = row.value as? String {
+ self?.username = value
+ }
+ }, placeholder: "Username".localized, value: username ?? "", keyboardType: .asciiCapable, autocorrectionType: .no, autocapitalizationType: .none, returnKeyType: .continue, identifier: "username"))
+
+ if VendorServices.shared.canAddAccount, OCBookmarkManager.shared.bookmarks.count > 0 {
+ let (proceedButton, cancelButton) = accountEntryMaskSection.addButtonFooter(proceedLabel: "Proceed".localized, proceedItemStyle: .welcome, cancelLabel: "Cancel".localized)
+ proceedButton?.addTarget(self, action: #selector(self.proceedWithLogin), for: .touchUpInside)
+ cancelButton?.addTarget(self, action: #selector(self.cancel(_:)), for: .touchUpInside)
+ } else {
+ let (proceedButton, _) = accountEntryMaskSection.addButtonFooter(proceedLabel: "Proceed".localized, proceedItemStyle: .welcome, cancelLabel: nil)
+ proceedButton?.addTarget(self, action: #selector(self.proceedWithLogin), for: .touchUpInside)
+ }
+
+ return accountEntryMaskSection
+ }
+
func loginMaskSection() -> StaticTableViewSection {
var loginMaskSection : StaticTableViewSection
loginMaskSection = StaticTableViewSection(headerTitle: nil, identifier: "loginMaskSection")
loginMaskSection.addStaticHeader(title: profile.welcome!, message: profile.promptForPasswordAuth)
- loginMaskSection.add(row: StaticTableViewRow(textFieldWithAction: { [weak self] (row, _, type) in
+ let userNameRow = StaticTableViewRow(textFieldWithAction: { [weak self] (row, _, type) in
if type == .didBegin, let cell = row.cell, let indexPath = self?.tableView.indexPath(for: cell) {
self?.tableView.scrollToRow(at: indexPath, at: .top, animated: true)
}
if let value = row.value as? String {
self?.username = value
}
- }, placeholder: "Username".localized, keyboardType: .asciiCapable, autocorrectionType: .no, autocapitalizationType: .none, returnKeyType: .continue, identifier: "username", borderStyle: .roundedRect))
+ }, placeholder: "Username".localized, value: self.username ?? "", keyboardType: .asciiCapable, autocorrectionType: .no, autocapitalizationType: .none, returnKeyType: .continue, identifier: "username", borderStyle: .roundedRect)
+
+ if let username = self.username, username.count > 0 {
+ userNameRow.enabled = false
+ }
+
+ loginMaskSection.add(row: userNameRow)
passwordRow = StaticTableViewRow(secureTextFieldWithAction: { [weak self] (row, _, type) in
if type == .didBegin, let cell = row.cell, let indexPath = self?.tableView.indexPath(for: cell) {
@@ -320,6 +361,9 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
return
}
+ if let accountEntryMaskSection = self.sectionForIdentifier("accountEntryMaskSection") {
+ self.removeSection(accountEntryMaskSection)
+ }
if let urlSection = self.sectionForIdentifier("urlSection") {
self.removeSection(urlSection)
}
@@ -352,6 +396,8 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
if OCAuthenticationMethod.registeredAuthenticationMethod(forIdentifier: authMethodIdentifier)?.type == .passphrase {
options[.usernameKey] = username ?? ""
options[.passphraseKey] = password ?? ""
+ } else if askForUsernameFirst, let username = username {
+ options[.usernameKey] = username
}
options[.presentingViewControllerKey] = self
@@ -467,7 +513,9 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
guard let bookmark = self.bookmark else { return }
let connection = instantiateConnection(for: bookmark)
- connection.prepareForSetup(options: nil, completionHandler: { (connectionIssue, _, _, preferredAuthenticationMethods) in
+ connection.prepareForSetup(options: ((username != nil) ? [
+ .userName : username!
+ ] : nil), completionHandler: { (connectionIssue, _, _, preferredAuthenticationMethods) in
var proceed : Bool = true
if let issue = connectionIssue {
@@ -499,7 +547,11 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
self.addSection(self.onboardingSection())
}
} else {
- self.cancel(nil)
+ if self.askForUsernameFirst {
+ self.addSection(self.accountEntryMaskSection())
+ } else {
+ self.cancel(nil)
+ }
}
}
})
@@ -545,6 +597,10 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
if self.sectionForIdentifier("tokenMaskSection") == nil {
self.addSection(self.tokenMaskSection())
}
+
+ if self.username != nil {
+ self.startAuthentication(nil)
+ }
}
if self.profile.isOnboardingEnabled, self.sectionForIdentifier("onboardingSection") == nil {
diff --git a/ownCloudAppShared/User Interface/Theme/UI/ThemeTableViewCell.swift b/ownCloudAppShared/User Interface/Theme/UI/ThemeTableViewCell.swift
index 12e8a8831..919f8c732 100644
--- a/ownCloudAppShared/User Interface/Theme/UI/ThemeTableViewCell.swift
+++ b/ownCloudAppShared/User Interface/Theme/UI/ThemeTableViewCell.swift
@@ -145,6 +145,10 @@ open class ThemeTableViewCell: UITableViewCell, Themeable {
textColor = collection.tableRowColors.labelColor
backgroundColor = collection.tableRowColors.backgroundColor
+ case .text:
+ textColor = collection.tableRowColors.labelColor
+ backgroundColor = collection.tableRowColors.backgroundColor
+
case .confirmation:
textColor = collection.approvalColors.normal.foreground
backgroundColor = collection.approvalColors.normal.background