<model>
    <mount>//OPNsense/captiveportal</mount>
    <version>1.0.3</version>
    <description>Captive portal application model</description>
    <items>
        <zones>
            <zone type="ArrayField">
                <enabled type="BooleanField">
                    <Default>1</Default>
                    <Required>Y</Required>
                </enabled>
                <zoneid type="AutoNumberField">
                    <MinimumValue>0</MinimumValue>
                    <MaximumValue>19</MaximumValue>
                    <ValidationMessage>Maximum number of zones reached</ValidationMessage>
                    <Required>Y</Required>
                </zoneid>
                <interfaces type="InterfaceField">
                    <Required>Y</Required>
                    <Multiple>Y</Multiple>
                    <Default>lan</Default>
                    <filters>
                        <enable>/^(?!0).*$/</enable>
                        <ipaddr>/^((?!dhcp).)*$/</ipaddr>
                    </filters>
                    <ValidationMessage>At least one interface must be selected</ValidationMessage>
                </interfaces>
                <authservers type="AuthenticationServerField">
                    <Multiple>Y</Multiple>
                </authservers>
                <alwaysSendAccountingReqs type="BooleanField">
                    <Default>0</Default>
                    <Required>Y</Required>
                </alwaysSendAccountingReqs>
                <authEnforceGroup type="AuthGroupField"/>
                <idletimeout type="IntegerField">
                    <Required>Y</Required>
                    <Default>0</Default>
                    <MinimumValue>0</MinimumValue>
                    <MaximumValue>10080</MaximumValue>
                    <ValidationMessage>Idle timeout, in minutes, must be between 0 (no timeout) and 10080 (a week)</ValidationMessage>
                </idletimeout>
                <hardtimeout type="IntegerField">
                    <Required>Y</Required>
                    <Default>0</Default>
                    <MinimumValue>0</MinimumValue>
                    <MaximumValue>10080</MaximumValue>
                    <ValidationMessage>Hard timeout, in minutes, must be between 0 (no timeout) and 10080 (a week)</ValidationMessage>
                </hardtimeout>
                <concurrentlogins type="BooleanField">
                    <Required>Y</Required>
                    <Default>1</Default>
                </concurrentlogins>
                <certificate type="CertificateField">
                    <ValidationMessage>Please select a valid certificate from the list</ValidationMessage>
                </certificate>
                <servername type="TextField">
                    <Mask>/^([0-9a-zA-Z.,_\-]){0,1024}$/u</Mask>
                    <ValidationMessage>Please enter a valid servername, ip address or leave this option blank</ValidationMessage>
                </servername>
                <allowedAddresses type="NetworkField">
                    <FieldSeparator>,</FieldSeparator>
                    <asList>Y</asList>
                    <WildcardEnabled>N</WildcardEnabled>
                </allowedAddresses>
                <allowedMACAddresses type="MacAddressField">
                    <asList>Y</asList>
                </allowedMACAddresses>
                <extendedPreAuthData type="BooleanField">
                    <Default>0</Default>
                    <Required>Y</Required>
                </extendedPreAuthData>
                <template type="ModelRelationField">
                    <Model>
                        <template>
                            <source>OPNsense.Captiveportal.Captiveportal</source>
                            <items>templates.template</items>
                            <display>name</display>
                        </template>
                    </Model>
                    <ValidationMessage>Related template not found</ValidationMessage>
                </template>
                <description type="DescriptionField">
                    <Required>Y</Required>
                </description>
            </zone>
        </zones>
        <templates>
            <template type="ArrayField">
                <fileid type="TextField">
                    <Required>Y</Required>
                    <Mask>/[0-9a-zA-Z\-]{1,255}/u</Mask>
                    <ValidationMessage>Fileid should be an internally generated unique number</ValidationMessage>
                </fileid>
                <name type="TextField">
                    <Required>Y</Required>
                    <Mask>/^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){1,255}$/u</Mask>
                    <ValidationMessage>Template name should be a string between 1 and 255 characters</ValidationMessage>
                </name>
                <content type="TextField">
                    <Required>Y</Required>
                    <Mask>/[0-9a-zA-Z\+\=\/]{20,}/u</Mask>
                    <ValidationMessage>File content should be in (base64 encoded) zip format</ValidationMessage>
                </content>
            </template>
        </templates>
    </items>
</model>
