-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,085 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// main.swift | ||
// FakeTrue | ||
// | ||
// Created by Timothy Perfitt on 7/3/22. | ||
// | ||
|
||
import Foundation | ||
|
||
exit (0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
#import "XCredsLoginPlugin.h" | ||
#import "TCSUnifiedLogger.h" | ||
#import "TCSReturnWindow.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// ContextAndHintHandling.swift | ||
// NoMADLoginAD | ||
// | ||
// Created by Josh Wisenbaker on 12/18/17. | ||
// Copyright © 2017 NoMAD. All rights reserved. | ||
// | ||
|
||
enum HintType: String { | ||
case guestUser | ||
case migratePass | ||
case migrateUser | ||
case networkSignIn | ||
case user | ||
case domain | ||
case pass | ||
case first | ||
case last | ||
case full | ||
case groups | ||
case uid | ||
case gid | ||
case kerberos_principal | ||
case passwordOverwrite // stomp on the password | ||
case ntName | ||
} | ||
|
||
// attribute statics | ||
|
||
let kODAttributeADUser = "dsAttrTypeStandard:ADUser" | ||
let kODAttributeNetworkSignIn = "dsAttrTypeStandard:NetworkSignIn" | ||
|
||
protocol ContextAndHintHandling { | ||
var mech: MechanismRecord? {get} | ||
func setContextString(type: String, value: String) | ||
func setHint(type: HintType, hint: Any) | ||
func getContextString(type: String) -> String? | ||
func getHint(type: HintType) -> Any? | ||
} | ||
|
||
//extension ContextAndHintHandling { | ||
// /// Set a NoMAD Login Authorization mechanism hint. | ||
// /// | ||
// /// - Parameters: | ||
// /// - type: A value from `HintType` representing the NoMad Login value to set. | ||
// /// - hint: The hint value to set. Can be `String` or `[String]` | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="20037" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="20037"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<customObject id="-2" userLabel="File's Owner" customClass="LoginWindowControlsWindowController" customModule="XCredsLoginPlugin" customModuleProvider="target"> | ||
<connections> | ||
<outlet property="window" destination="wkO-FS-5uW" id="ui3-ZB-mfw"/> | ||
</connections> | ||
</customObject> | ||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> | ||
<customObject id="-3" userLabel="Application" customClass="NSObject"/> | ||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hasShadow="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="wkO-FS-5uW" customClass="TCSReturnWindow"> | ||
<windowStyleMask key="styleMask" closable="YES" miniaturizable="YES" resizable="YES"/> | ||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> | ||
<rect key="contentRect" x="25" y="25" width="872" height="109"/> | ||
<rect key="screenRect" x="0.0" y="0.0" width="1536" height="935"/> | ||
<view key="contentView" id="Tpj-ss-EMv"> | ||
<rect key="frame" x="0.0" y="0.0" width="872" height="109"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="sxl-0U-ne5"> | ||
<rect key="frame" x="186" y="16" width="500" height="78"/> | ||
<subviews> | ||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6f9-0z-Xqg"> | ||
<rect key="frame" x="153" y="1" width="67" height="64"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> | ||
<buttonCell key="cell" type="bevel" title="Shutdown" bezelStyle="rounded" image="ShutdownX" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="WRj-LR-MaW"> | ||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> | ||
<font key="font" metaFont="system"/> | ||
</buttonCell> | ||
<color key="contentTintColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
<connections> | ||
<action selector="shutdownClick:" target="-2" id="W7Z-F0-i5A"/> | ||
</connections> | ||
</button> | ||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HyD-ug-de2"> | ||
<rect key="frame" x="24" y="1" width="67" height="64"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> | ||
<buttonCell key="cell" type="bevel" title="Restart" bezelStyle="rounded" image="RestartX" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="UQm-h8-fbd"> | ||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> | ||
<font key="font" metaFont="system"/> | ||
</buttonCell> | ||
<color key="contentTintColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
<connections> | ||
<action selector="restartClick:" target="-2" id="NIy-Js-LHD"/> | ||
</connections> | ||
</button> | ||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LW1-vo-EUl"> | ||
<rect key="frame" x="277" y="1" width="67" height="64"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> | ||
<buttonCell key="cell" type="bevel" title="WiFi" bezelStyle="rounded" image="RestartX" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="pVM-6f-Z04"> | ||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> | ||
<font key="font" metaFont="system"/> | ||
</buttonCell> | ||
<color key="contentTintColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
</button> | ||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2By-DW-YEU"> | ||
<rect key="frame" x="401" y="1" width="90" height="64"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> | ||
<buttonCell key="cell" type="bevel" title="Login Window" bezelStyle="rounded" image="RestartX" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="c0y-fU-B6x"> | ||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> | ||
<font key="font" metaFont="system"/> | ||
</buttonCell> | ||
<color key="contentTintColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
</button> | ||
</subviews> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="500" id="aKl-rA-eDh"/> | ||
<constraint firstAttribute="height" constant="78" id="cmM-6M-FrE"/> | ||
</constraints> | ||
</customView> | ||
</subviews> | ||
<constraints> | ||
<constraint firstItem="sxl-0U-ne5" firstAttribute="centerY" secondItem="Tpj-ss-EMv" secondAttribute="centerY" constant="-0.5" id="2Wq-KM-ceX"/> | ||
<constraint firstItem="sxl-0U-ne5" firstAttribute="centerX" secondItem="Tpj-ss-EMv" secondAttribute="centerX" id="eIH-vl-2ht"/> | ||
</constraints> | ||
</view> | ||
<point key="canvasLocation" x="-602" y="703.5"/> | ||
</window> | ||
</objects> | ||
<resources> | ||
<image name="RestartX" width="32" height="32"/> | ||
<image name="ShutdownX" width="32" height="32"/> | ||
</resources> | ||
</document> |
55 changes: 55 additions & 0 deletions
55
XCredsLoginPlugIn/LoginWindow/LoginWindowControlsWindowController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// LoginWindowControlsWindowController.swift | ||
// XCredsLoginPlugin | ||
// | ||
// Created by Timothy Perfitt on 7/3/22. | ||
// | ||
|
||
import Cocoa | ||
|
||
class LoginWindowControlsWindowController: NSWindowController { | ||
var delegate: XCredsMechanismProtocol? | ||
|
||
override func windowDidLoad() { | ||
super.windowDidLoad() | ||
setupLoginWindowAppearance() | ||
} | ||
fileprivate func setupLoginWindowAppearance() { | ||
self.window?.level = .screenSaver | ||
TCSLog("ordering controls front") | ||
self.window?.orderFrontRegardless() | ||
|
||
self.window?.titlebarAppearsTransparent = true | ||
|
||
self.window?.isMovable = false | ||
self.window?.canBecomeVisibleWithoutLogin = true | ||
|
||
let screenRect = NSScreen.screens[0].frame | ||
let windowRec = NSMakeRect(0, 0, screenRect.width, self.window?.frame.height ?? 100) | ||
self.window?.setFrame(windowRec, display: true, animate: false) | ||
|
||
} | ||
@IBAction func restartClick(_ sender: Any) { | ||
TCSLog("Setting restart user") | ||
guard let delegate = delegate else { | ||
TCSLog("No delegate set for restart") | ||
|
||
return | ||
} | ||
delegate.setHint(type: .user, hint: SpecialUsers.restart.rawValue) | ||
delegate.allowLogin() | ||
} | ||
|
||
@IBAction func shutdownClick(_ sender: Any) { | ||
TCSLog("Setting shutdown user") | ||
guard let delegate = delegate else { | ||
TCSLog("No delegate set for shutdown") | ||
return | ||
} | ||
delegate.setHint(type: .user, hint: SpecialUsers.shutdown.rawValue) | ||
delegate.allowLogin() | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// TCSReturnWindow.h | ||
// Boot Runner | ||
// | ||
// Created by Tim Perfitt on 9/6/17. | ||
// | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface TCSReturnWindow : NSWindow | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// TCSReturnWindow.m | ||
// Boot Runner | ||
// | ||
// Created by Tim Perfitt on 9/6/17. | ||
// | ||
// | ||
|
||
#import "TCSReturnWindow.h" | ||
|
||
@implementation TCSReturnWindow | ||
- (id)initWithContentRect:(NSRect)contentRect | ||
styleMask:(__unused NSWindowStyleMask)aStyle | ||
backing:(__unused NSBackingStoreType)bufferingType | ||
defer:(__unused BOOL)flag { | ||
|
||
// Using NSBorderlessWindowMask results in a window without a title bar. | ||
self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; | ||
if (self != nil) { | ||
// Start with no transparency for all drawing into the window | ||
[self setAlphaValue:0.5]; | ||
//Set backgroundColor to clearColor | ||
self.backgroundColor = NSColor.grayColor; | ||
// Turn off opacity so that the parts of the window that are not drawn into are transparent. | ||
// [self setOpaque:NO]; | ||
} | ||
return self; | ||
} | ||
@end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.