Skip to content

Commit

Permalink
added fix for override still prompting when overridesilent set
Browse files Browse the repository at this point in the history
  • Loading branch information
twocanoes committed Feb 6, 2024
1 parent a3ca649 commit dec4a69
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Profile Manifest/com.twocanoes.xcreds.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>pfm_app_url</key>
<string>https://github.com/twocanoes/xcreds</string>
<key>pfm_description</key>
<string>XCreds 4.1 (6312) OAuth Settings</string>
<string>XCreds 4.1 (6313) OAuth Settings</string>
<key>pfm_documentation_url</key>
<string>https://twocanoes.com/knowledge-base/xcreds-admin-guide/#preferences</string>
<key>pfm_domain</key>
Expand Down
10 changes: 0 additions & 10 deletions XCreds/VerifyLocalPasswordWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,6 @@ class VerifyLocalPasswordWindowController: NSWindowController, DSQueryable {
override func windowDidLoad() {
super.windowDidLoad()
TCSLogWithMark()
// if DefaultsOverride.standardOverride.string(forKey: PrefKeys.localAdminUserName.rawValue) != nil &&
// DefaultsOverride.standardOverride.string(forKey: PrefKeys.localAdminPassword.rawValue) != nil
// {
// resetButton.isHidden=false
// }
// else {
// resetButton.isHidden=true
//
// }

}


Expand Down
16 changes: 12 additions & 4 deletions XCredsLoginPlugIn/Mechanisms/XCredsBaseMechanism.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ import OpenDirectory

TCSLogWithMark("Sync password called.")

if let aUsername = DefaultsOverride.standardOverride.string(forKey: PrefKeys.localAdminUserName.rawValue), let aPassword =
DefaultsOverride.standardOverride.string(forKey: PrefKeys.localAdminPassword.rawValue), aUsername.isEmpty==false, aPassword.isEmpty==false, getManagedPreference(key: .PasswordOverwriteSilent) as? Bool ?? false {


setHint(type: .adminUsername, hint:aUsername )
setHint(type: .adminPassword, hint: aPassword)
setHint(type: .passwordOverwrite, hint: true)


allowLogin()

}
let promptPasswordWindowController = VerifyLocalPasswordWindowController()

promptPasswordWindowController.showResetText=true
Expand All @@ -160,8 +172,6 @@ import OpenDirectory
setHint(type: .existingLocalUserPassword, hint:enteredUsernamePassword.password as Any )
}

allowLogin()

case .resetKeychainRequested(let usernamePasswordCredentials):

if let adminUsername = usernamePasswordCredentials?.username, let adminPassword = usernamePasswordCredentials?.password {
Expand All @@ -170,7 +180,6 @@ import OpenDirectory
setHint(type: .passwordOverwrite, hint: true)

}
allowLogin()


case .userCancelled:
Expand All @@ -190,7 +199,6 @@ import OpenDirectory
denyLogin(message:mesg)
return .failure(mesg)
}
// }
TCSLogWithMark("passing username:\(username), password, and tokens")
TCSLogWithMark("setting kAuthorizationEnvironmentUsername")
setContextString(type: kAuthorizationEnvironmentUsername, value: username)
Expand Down
12 changes: 6 additions & 6 deletions xCreds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6312;
CURRENT_PROJECT_VERSION = 6313;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1477,7 +1477,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6312;
CURRENT_PROJECT_VERSION = 6313;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UXP6YEHSPW;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1598,7 +1598,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6312;
CURRENT_PROJECT_VERSION = 6313;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1635,7 +1635,7 @@
CODE_SIGN_ENTITLEMENTS = "XCreds Login Overlay/XCreds_Login_Overlay.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6312;
CURRENT_PROJECT_VERSION = 6313;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1785,7 +1785,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6312;
CURRENT_PROJECT_VERSION = 6313;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1827,7 +1827,7 @@
CODE_SIGN_ENTITLEMENTS = XCreds/xCreds.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6312;
CURRENT_PROJECT_VERSION = 6313;
DEVELOPMENT_TEAM = UXP6YEHSPW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
Binary file not shown.

0 comments on commit dec4a69

Please sign in to comment.