Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/webfinger] Webfinger / server location #1059

Merged
merged 24 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b7db5d0
- change text in the footer below private links in accordance with ht…
felix-schwarz Sep 13, 2021
927eff0
Merge branch 'master' into milestone/11.8
felix-schwarz Sep 27, 2021
f4b4e14
- SDK update
felix-schwarz Sep 27, 2021
1f99ad3
added additional build information to the Branding.plist file:
hosy Oct 6, 2021
bda5598
[feature/biometrical-mdm-setting ]Suggest Biometrical Unlock (#1046)
hosy Oct 11, 2021
88609b5
Branding: (#1045)
felix-schwarz Oct 11, 2021
f7574f6
- fix bug where a quick access entry showed no items when selected a …
felix-schwarz Oct 11, 2021
a7cc6a8
used better wording for "Cellular transfers"
hosy Oct 15, 2021
cbc506b
- in branded clients: removed UISwitch to enable/disable deletion of …
hosy Oct 18, 2021
c2aa1ca
fixed UI issue in sharing view
hosy Oct 18, 2021
b073acc
#4801 "Log out" text changes
hosy Oct 19, 2021
37e0c9c
#4801 text changes for "Prevent gestures"
hosy Oct 19, 2021
35814d7
- ThemeTableViewCell, StaticTableViewRow: new .plain message style (#…
felix-schwarz Oct 21, 2021
3b3ed13
[feature/modular-localization] Modular localization (#1054)
felix-schwarz Nov 8, 2021
63164b2
[feature/mdm-auto-connect] Skip Account Screen via MDM (#1056)
hosy Nov 8, 2021
44893a6
[feature/mdm-biometrical-unlock] MDM setting for Biometrical Unlock …
hosy Nov 8, 2021
26e63bd
Merge branch 'milestone/11.7.2' into milestone/11.8
felix-schwarz Nov 8, 2021
8534ee3
- StaticLoginSetupViewController: add support for OCServerLocator, re…
felix-schwarz Nov 9, 2021
d578845
Merge branch 'milestone/11.9.0' into feature/webfinger
hosy Jan 18, 2022
31c1e51
updated APP_VERSION number
hosy Jan 18, 2022
de686f8
reverted merge conflict changes
hosy Jan 18, 2022
bf7bda8
Merge branch 'milestone/11.9.0' into feature/webfinger
hosy Jan 27, 2022
b3f1765
using correct SDK commit
hosy Jan 27, 2022
8550bc0
using latest development sdk commit
hosy Jan 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios-sdk
10 changes: 10 additions & 0 deletions ownCloud.xcodeproj/xcshareddata/xcschemes/ownCloud.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,16 @@
value = "[recovering-apm]"
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "oc:host-simulator.active-simulations"
value = "[web-finger]"
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "oc:server-locator.use"
value = "string:web-finger"
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "oc:connection.allowed-authentication-methods"
value = "[openid-connect,oauth2]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
fatalError("init(coder:) has not been implemented")
}

var askForUsernameFirst : Bool {
return OCServerLocator.useServerLocatorIdentifier != nil
}

override func viewDidLoad() {
super.viewDidLoad()

Expand All @@ -62,7 +66,11 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
self.addSection(onboardingSection())
}
} else {
proceedWithLogin()
if askForUsernameFirst {
self.addSection(accountEntryMaskSection())
} else {
proceedWithLogin()
}
}
}

Expand Down Expand Up @@ -117,20 +125,53 @@ class StaticLoginSetupViewController : StaticLoginStepViewController {
return onboardingSection
}

func accountEntryMaskSection() -> 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) {
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
}
}
})
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down