public function onBeforeWrite()
    {
        if ($this->owner->LDAPMemberExtension_NoSync) {
            return;
        }

        $service = Injector::inst()->get('LDAPService');
        if (
            !$service->enabled() ||
            !$this->owner->config()->create_users_in_ldap ||
            !$this->owner->Username ||
            $this->owner->GUID
        ) {
            return;
        }

        $service->createLDAPUser($this->owner);
    }