From af89b90302742b60ca699ad19e87f9e94113901e Mon Sep 17 00:00:00 2001 From: Shea Craig Date: Tue, 12 Jan 2021 17:16:39 -0500 Subject: [PATCH] Add option to not offer manual enrollment to DEP capable machines. Ever. (#39) --- payload/Library/umad/Resources/umad | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/payload/Library/umad/Resources/umad b/payload/Library/umad/Resources/umad index cffffd91..06e0ab74 100755 --- a/payload/Library/umad/Resources/umad +++ b/payload/Library/umad/Resources/umad @@ -332,6 +332,9 @@ def get_parsed_options(): o.add_option('--logopath', default='company_logo.png', help=('Optional: Path to company logo.')) + o.add_option('--disablemanualenrollmentfordep', default=False, + help='Optional: Disable the manual enrollment button for DEP devices', + action='store_true') o.add_option('--manualenrollmenturl', default='https://apple.com', help=('Required: Manual Enrollment URL.')) @@ -914,6 +917,14 @@ def main(): umad.views['field.depfailuresubtext'].setStringValue_( opts.depfailuresubtext) + # If the disablemanualenrollmentfordep option is set, never offer + # manual enrollment as an option for DEP capable devices. + if dep_capable and opts.disablemanualenrollmentfordep: + umad.views['button.manualenrollment'].setHidden_(True) + umad.views['field.manualenrollmenttext'].setHidden_(True) + umad.views['field.depfailuretext'].setHidden_(True) + umad.views['field.depfailuresubtext'].setHidden_(True) + # Do one final MDM check to instantly update the UI for UAMDM check_mdm_status(True)