Skip to content

Commit

Permalink
[feature/webfinger] Webfinger / server location (#1059)
Browse files Browse the repository at this point in the history
* - change text in the footer below private links in accordance with owncloud/enterprise#4726

* - SDK update

* added additional build information to the Branding.plist file:
- ios-app and ios-sdk commit hash
- copy the Branding.plist with additional app and build information as file name

* [feature/biometrical-mdm-setting ]Suggest Biometrical Unlock (#1046)

* Suggest biometrical unlock, after setting up passcode

* - do not show Cancel button, if password is enforced
- update biometrical UI switch value in settings view
- fixed bug, dismissing the view, if biometrical is not available

* moved extension into ownCloudAppShared folder

* Branding: (#1045)

- add new `branding.user-defaults-default-values` class settings key to allow registration of alternative defaults for user defaults

* - fix bug where a quick access entry showed no items when selected a second time. (#1044)

* used better wording for "Cellular transfers"

* - in branded clients: removed UISwitch to enable/disable deletion of available offline files in manage screen
- fixed text center layout in table view cell

* fixed UI issue in sharing view

* #4801 "Log out"  text changes

* #4801 text changes for "Prevent gestures"

* - ThemeTableViewCell, StaticTableViewRow: new .plain message style (#1053)

- add new view controller to present license texts for each component individually

* [feature/modular-localization] Modular localization (#1054)

* - Branding class:
	- move logic for VendorServices.appName to Branding.appDisplayName
	- change app.name variable value to that of Branding.appDisplayName
- switch String.localized from NSLocalizedString() to OCLocale.localize()
- SwiftLint: adapt to latest SwiftLint version

* - add .localized(replacements) function to provide easy access to custom variables support in OCLocale

* - update SDK

* [feature/mdm-auto-connect] Skip Account Screen via MDM (#1056)

* #4801 Skip "Manage" screen / automatically open "Files" screen after login via MDM parameter account.auto-connect

* - SceneDelegate: use .first (which returns nil in case there are no bookmarks) instead of bookmark(at: 0) (which crashes in case there are no bookmarks because the array is empty and the method tries to access an item at index 0)

* added auto-connect after every setup, not only the first setup

Co-authored-by: Felix Schwarz <[email protected]>

* [feature/mdm-biometrical-unlock]  MDM setting for Biometrical Unlock (#1058)

* #4818 control via MDM to auto enable biometrical unlock

* overwrites user defaults with MDM settings and use existing getter/setter; renamed MDM key to use-biometrical-unlock

* - use user defaults for use-biometrical-unlock
- show Face ID authorization immediately after enabling Face ID

* - StaticLoginSetupViewController: add support for OCServerLocator, requesting a username if it is enabled
- add additional debug options to ownCloud.xcscheme
- update SDK to gain access to OCServerLocator

* updated APP_VERSION number

* reverted merge conflict changes

* using correct SDK commit

* using latest development sdk commit

Co-authored-by: Matthias Hühne <[email protected]>
Co-authored-by: Matthias Hühne <[email protected]>
  • Loading branch information
3 people authored Jan 28, 2022
1 parent e42aa67 commit eb24db8
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 6 deletions.
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

0 comments on commit eb24db8

Please sign in to comment.