Commit 6797de9d authored by Joel Rennich's avatar Joel Rennich

Test for the right AD realm in the user name. Added checks for reachability to the internet.

parent b55a93f2
......@@ -77,7 +77,8 @@ class LoginWindow: NSWindowController, NSWindowDelegate {
// or if there is an "@" in the name, assume it's a full Kerberos principal
if userName.stringValue.contains("@") {
userNameChecked = userName.stringValue
let split = userName.stringValue.components(separatedBy: "@")
userNameChecked = split[0] + "@" + defaults.string(forKey: "KerberosRealm")!
} else {
userNameChecked = userName.stringValue + "@" + defaults.string(forKey: "KerberosRealm")!
}
......
......@@ -712,10 +712,22 @@ class NoMADMenuController: NSObject, LoginWindowDelegate, PasswordChangeDelegate
userInformation.myLDAPServers.setDomain(defaults.string(forKey: "ADDomain")!)
}
// get the information on the current setup
// check for network reachability
//let qualityBackground = QOS_CLASS_BACKGROUND
//let backgroundQueue: dispatch_queue_t = dispatch_get_global_queue(qualityBackground, 0)
let host = defaults.string(forKey: "ADDomain")
let myReach = SCNetworkReachabilityCreateWithName(nil, host!)
var flag = SCNetworkReachabilityFlags.reachable
if !SCNetworkReachabilityGetFlags(myReach!, &flag) {
myLogger.logit(.base, message: "Can't determine network reachability.")
lastStatusCheck = Date()
}
if (flag.rawValue != UInt32(kSCNetworkFlagsReachable)) {
// network isn't reachable
myLogger.logit(.base, message: "Network is not reachable, delaying lookups.")
lastStatusCheck = Date()
}
if abs(lastStatusCheck.timeIntervalSinceNow) > 3 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment