...
 
Commits (16)
......@@ -20,7 +20,7 @@ let enableFDELog = OSLog(subsystem: "menu.nomad.login.ad", category: "EnableFDEL
let sierraFixesLog = OSLog(subsystem: "menu.nomad.login.ad", category: "SierraFixesLog")
let keychainAddLog = OSLog(subsystem: "menu.nomad.login.ad", category: "KeychainAdd")
let eulaLog = OSLog(subsystem: "menu.nomad.login.ad", category: "EULA")
let runScriptLog = OSLog(subsystem: "menu.nomad.login", category: "RunScript")
let notifyLog = OSLog(subsystem: "menu.nomad.login", category: "Notify")
let settingsLog = OSLog(subsystem: "menu.nomad.login", category: "Settings")
let userinputLog = OSLog(subsystem: "menu.nomad.login", category: "UserInput")
let runScriptLog = OSLog(subsystem: "menu.nomad.login.ad", category: "RunScript")
let notifyLog = OSLog(subsystem: "menu.nomad.login.ad", category: "Notify")
let settingsLog = OSLog(subsystem: "menu.nomad.login.ad", category: "Settings")
let userinputLog = OSLog(subsystem: "menu.nomad.login.ad", category: "UserInput")
......@@ -72,12 +72,16 @@ enum Preferences: String {
/// If Notify should add additional logging
case NotifyLogStyle
/// Path to script to run, currently only one script path can be used, if you want to run this multiple times, keep the logic in your script
case PowerControlDisabled
/// If the powercontrol options should be disabled in the SignIn UI
case ScriptPath
/// Arguments for the script, if any
case ScriptArgs
/// Use the CN from AD as the full name
case UseCNForFullName
/// A string to show as the placeholder in the Username textfield
case UseCNForFullNameFallback
/// Uses the CN as the fullname on the account when the givenName and sn fields are blank
case UsernameFieldPlaceholder
/// A filesystem path to an image to set the user profile image to as a `String`
case UserProfileImage
......
......@@ -56,7 +56,7 @@
<dict>
<key>title</key>
<string>Pop Up One</string>
<key>Items</key>
<key>items</key>
<array>
<string>Minneapolis</string>
<string>Austin</string>
......
......@@ -50,6 +50,12 @@ class CheckAD: NoLoMechanism {
}
func useAutologin() -> Bool {
if UserDefaults(suiteName: "com.apple.loginwindow")?.bool(forKey: "DisableFDEAutoLogin") ?? false {
os_log("FDE AutoLogin Disabled per loginwindow preference key", log: checkADLog, type: .debug)
return false
}
os_log("Checking for autologin.", log: checkADLog, type: .default)
if FileManager.default.fileExists(atPath: "/tmp/nolorun") {
os_log("NoLo has run once already. Load regular window as this isn't a reboot", log: checkADLog, type: .debug)
......
......@@ -139,8 +139,11 @@ class CreateUser: NoLoMechanism {
if getManagedPreference(key: .UseCNForFullName) as? Bool ?? false {
attrs[kODAttributeTypeFullName] = [getHint(type: .noMADFull) as? String ?? ""]
} else if getManagedPreference(key: .UseCNForFullNameFallback) as? Bool ?? false && "\(first) \(last)" == " " {
attrs[kODAttributeTypeFullName] = [getHint(type: .noMADFull) as? String ?? ""]
}
if let signInTime = getHint(type: .networkSignIn) {
attrs[kODAttributeNetworkSignIn] = [signInTime]
}
......@@ -295,14 +298,18 @@ class CreateUser: NoLoMechanism {
os_log("System language is: %{public}@", log: createUserLog, type: .debug, currentLanguage)
let templateName = templateForLang(currentLanguage)
let sourceURL = URL(fileURLWithPath: "/System/Library/User Template/" + templateName)
let downloadsURL = URL(fileURLWithPath: "/System/Library/User Template/Non_localized/Downloads")
let documentsURL = URL(fileURLWithPath: "/System/Library/User Template/Non_localized/Documents")
let homeDirLocations = ["Desktop", "Downloads", "Documents", "Movies", "Music", "Pictures", "Public"]
do {
os_log("Copying template to /Users", log: createUserLog, type: .debug)
os_log("Initializing the user home directory", log: createUserLog, type: .debug)
try FileManager.default.copyItem(at: sourceURL, to: URL(fileURLWithPath: "/Users/" + user))
os_log("Copying non-localized folders to new home", log: createUserLog, type: .debug)
try FileManager.default.copyItem(at: downloadsURL, to: URL(fileURLWithPath: "/Users/" + user + "/Downloads"))
try FileManager.default.copyItem(at: documentsURL, to: URL(fileURLWithPath: "/Users/" + user + "/Documents"))
for location in homeDirLocations {
try FileManager.default.copyItem(at: URL(fileURLWithPath: "/System/Library/User Template/Non_localized/\(location)"), to: URL(fileURLWithPath: "/Users/" + user + "/\(location)"))
}
os_log("Copying language template", log: createUserLog, type: .debug)
try FileManager.default.copyItem(at: sourceURL, to: URL(fileURLWithPath: "/Users/" + user))
} catch {
os_log("Home template copy failed with: %{public}@", log: createUserLog, type: .error, error.localizedDescription)
}
......
......@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>1.3.0</string>
<key>CFBundleVersion</key>
<string>335</string>
<string>339</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Orchard &amp; Grove. All rights reserved.</string>
<key>NSPrincipalClass</key>
......
......@@ -21,6 +21,12 @@ For those of you that are new to NoLo, the basic features are:
* Display a EULA for users to accept on login
* Create a keychain item for NoMAD
## Staged Development Changes
* `UseCNForFullNameFallback` a Boolean that determines if to use CN as the fullname on the account when the givenName and sn fields are blank
* `PowerControlDisabled` a Boolean that determines if the powercontrol options should be disabled/hidden in the SignIn UI
* Updated the new user home directory creation to fully populate all expected folders in prep for Catalina
* `DisableFDEAutoLogin` now respected under the `com.apple.loginwindow` preference domain
## What's new in 1.3.0
* `BackgroundImageAlpha` an Integer from 0-10 which determines the alpha value for the background image in 10% increments, i.e. a value of `3` would be a 30% alpha
This was broken before and is now fixed.
......
......@@ -40,6 +40,7 @@ class SignIn: NSWindowController {
@IBOutlet weak var newPassword: NSSecureTextField!
@IBOutlet weak var newPasswordConfirmation: NSSecureTextField!
@IBOutlet weak var alertText: NSTextField!
@IBOutlet weak var powerControlStack: NSStackView!
//MARK: - UI Methods
override func windowDidLoad() {
......@@ -241,6 +242,12 @@ class SignIn: NSWindowController {
imageView.alphaValue = 0.0
}
}
// Checking if the shutdown and restart options should be hidden in the UI
if getManagedPreference(key: .PowerControlDisabled) as? Bool == true {
os_log("Disabling and hiding the power control mechanisms", log: uiLog, type: .debug)
powerControlStack.isHidden = true
}
}
fileprivate func showResetUI() {
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
......@@ -18,6 +18,7 @@
<outlet property="password" destination="k7j-rX-Mra" id="FD9-ZH-5GK"/>
<outlet property="passwordChangeButton" destination="BKh-qb-RHS" id="ulU-Al-ADx"/>
<outlet property="passwordChangeStack" destination="RLo-4d-Xte" id="fRB-o1-ghd"/>
<outlet property="powerControlStack" destination="UUS-jL-biV" id="Efd-lZ-Yyk"/>
<outlet property="signIn" destination="7fI-fi-xA6" id="Vek-BT-qmg"/>
<outlet property="username" destination="bz7-9V-hj9" id="SmY-n9-wt5"/>
<outlet property="window" destination="F0z-JX-Cv5" id="NDA-Gg-a3e"/>
......@@ -346,7 +347,7 @@ DQ
</objects>
<resources>
<image name="NSFollowLinkFreestandingTemplate" width="14" height="14"/>
<image name="NoLoAD Logo Alpha Channel" width="247.19999694824219" height="394.32000732421875"/>
<image name="NoLoAD Logo Alpha Channel" width="1030" height="1643"/>
<image name="Restart" width="128" height="128"/>
<image name="Shutdown" width="128" height="150"/>
<image name="Sleep" width="128" height="128"/>
......