def forceLogoutWarningDidEnd_returnCode_contextInfo_( self, alert, returncode, contextinfo): '''Called when the forced logout warning alert ends''' btn_pressed = self._force_warning_btns.get(returncode) if btn_pressed == self._force_warning_logout_btn: msclog.log("user", "install_with_logout") self.handlePossibleAuthRestart() try: munki.logoutAndUpdate() except munki.ProcessStartError, err: self.installSessionErrorAlert_(err)
def logoutAlertDidEnd_returnCode_contextInfo_(self, alert, returncode, contextinfo): if returncode == 0: NSLog("User cancelled") munki.log("user", "cancelled") elif returncode == 1: NSLog("User chose to log out") munki.log("user", "install_with_logout") result = munki.logoutAndUpdate() if result: self.installSessionErrorAlert() elif returncode == -1: # dismiss the alert sheet now because we might display # another alert alert.window().orderOut_(self) if self.alertIfBlockingAppsRunning(): pass else: NSLog("User chose to update without logging out") munki.log("user", "install_without_logout") result = munki.justUpdate() if result: self.installSessionErrorAlert() else: self.managedsoftwareupdate_task = "installwithnologout" self.mainWindowController.theWindow.orderOut_(self) self.munkiStatusController.window.makeKeyAndOrderFront_(self) self.munkiStatusController.startMunkiStatusSession()
def logoutAlertDidEnd_returnCode_contextInfo_(self, alert, returncode, contextinfo): self._currentAlert = None if returncode == NSAlertDefaultReturn: if self.alertIfRunnningOnBattery(): munki.log("user", "alerted_on_battery_power_and_cancelled") return NSLog("User chose to logout") munki.log("user", "install_with_logout") result = munki.logoutAndUpdate() if result: self.installSessionErrorAlert() elif returncode == NSAlertAlternateReturn: NSLog("User cancelled") munki.log("user", "cancelled") elif returncode == NSAlertOtherReturn: # dismiss the alert sheet now because we might display # another alert alert.window().orderOut_(self) if self.alertIfBlockingAppsRunning(): return if self.alertIfRunnningOnBattery(): munki.log("user", "alerted_on_battery_power_and_cancelled") return NSLog("User chose to update without logging out") munki.log("user", "install_without_logout") result = munki.justUpdate() if result: self.installSessionErrorAlert() else: self.managedsoftwareupdate_task = "installwithnologout" self.mainWindowController.theWindow.orderOut_(self) self.munkiStatusController.window.makeKeyAndOrderFront_(self) self.munkiStatusController.startMunkiStatusSession()
def logoutAlertDidEnd_returnCode_contextInfo_( self, alert, returncode, contextinfo): self._currentAlert = None if returncode == NSAlertDefaultReturn: if self.alertIfRunnningOnBattery(): munki.log("user", "alerted_on_battery_power_and_cancelled") return NSLog("User chose to logout") munki.log("user", "install_with_logout") result = munki.logoutAndUpdate() if result: self.installSessionErrorAlert() elif returncode == NSAlertAlternateReturn: NSLog("User cancelled") munki.log("user", "cancelled") elif returncode == NSAlertOtherReturn: # dismiss the alert sheet now because we might display # another alert alert.window().orderOut_(self) if self.alertIfBlockingAppsRunning(): return if self.alertIfRunnningOnBattery(): munki.log("user", "alerted_on_battery_power_and_cancelled") return NSLog("User chose to update without logging out") munki.log("user", "install_without_logout") result = munki.justUpdate() if result: self.installSessionErrorAlert() else: self.managedsoftwareupdate_task = "installwithnologout" self.mainWindowController.theWindow.orderOut_(self) self.munkiStatusController.window.makeKeyAndOrderFront_(self) self.munkiStatusController.startMunkiStatusSession()
def forceLogoutWarningDidEnd_returnCode_contextInfo_( self, alert, returncode, contextinfo): '''Called when the forced logout warning alert ends''' btn_pressed = self._force_warning_btns.get(returncode) if btn_pressed == self._force_warning_logout_btn: msclog.log("user", "install_with_logout") result = munki.logoutAndUpdate() elif btn_pressed == self._force_warning_ok_btn: msclog.log("user", "dismissed_forced_logout_warning")
def forceLogoutWarningDidEnd_returnCode_contextInfo_( self, alert, returncode, contextinfo): self._currentAlert = None btn_pressed = self._force_warning_btns.get(returncode) if btn_pressed == self._force_warning_logout_btn: munki.log("user", "install_with_logout") result = munki.logoutAndUpdate() elif btn_pressed == self._force_warning_ok_btn: munki.log("user", "dismissed_forced_logout_warning")
def logoutAlertDidEnd_returnCode_contextInfo_(self, alert, returncode, contextinfo): '''Called when logout alert ends''' if returncode == NSAlertDefaultReturn: # make sure this alert panel is gone before we proceed, which # might involve opening another alert sheet alert.window().orderOut_(self) if self.alertedToFirmwareUpdatesAndCancelled(): msclog.log("user", "alerted_to_firmware_updates_and_cancelled") return elif self.alertedToRunningOnBatteryAndCancelled(): msclog.log("user", "alerted_on_battery_power_and_cancelled") return msclog.log("user", "install_with_logout") self.handlePossibleAuthRestart() try: munki.logoutAndUpdate() except munki.ProcessStartError, err: self.installSessionErrorAlert_(err)
def logoutAlertDidEnd_returnCode_contextInfo_( self, alert, returncode, contextinfo): '''Called when logout alert ends''' if returncode == NSAlertDefaultReturn: # make sure this alert panel is gone before we proceed, which # might involve opening another alert sheet alert.window().orderOut_(self) if self.alertedToFirmwareUpdatesAndCancelled(): msclog.log("user", "alerted_to_firmware_updates_and_cancelled") return elif self.alertedToRunningOnBatteryAndCancelled(): msclog.log("user", "alerted_on_battery_power_and_cancelled") return msclog.log("user", "install_with_logout") self.handlePossibleAuthRestart() try: munki.logoutAndUpdate() except munki.ProcessStartError, err: self.installSessionErrorAlert_(err)
def forceLogoutWarningDidEnd_returnCode_contextInfo_(self, alert, returncode, contextinfo): self._currentAlert = None btn_pressed = self._force_warning_btns.get(returncode) if not btn_pressed: # sheet was dismissed via NSApp.endSheet() # and not via button press, so do nothing pass elif btn_pressed == self._force_warning_logout_btn: munki.log("user", "install_with_logout") result = munki.logoutAndUpdate() else: munki.log("user", "dismissed_forced_logout_warning")
def forceLogoutWarningDidEnd_returnCode_contextInfo_( self, alert, returncode, contextinfo): self._currentAlert = None btn_pressed = self._force_warning_btns.get(returncode) if not btn_pressed: # sheet was dismissed via NSApp.endSheet() # and not via button press, so do nothing pass elif btn_pressed == self._force_warning_logout_btn: munki.log("user", "install_with_logout") result = munki.logoutAndUpdate() else: munki.log("user", "dismissed_forced_logout_warning")