<?php

class ApplianceNetworkSettingsForm extends PhonalisaRecord
{
    public $ip;
    public $subnetMask;
    public $dns;
    public $gateway;
    public $enableDNSServer;
    public $enableDHCP;
    public $dhcpRangeFrom;
    public $dhcpRangeTo;


    public $httpProxy;
    public $httpProxyPort;
    public $httpProxyUser;
    public $httpProxyPassword;
    public $httpsProxy;
    public $httpsProxyPort;
    public $httpsProxyUser;
    public $httpsProxyPassword;

    public static function myAttributes()
    {
        return array(
            'ip' => 'ip',
            'subnetMask' => 'subnetMask',
            'dns' => 'dns',
            'gateway' => 'gateway',
            'enableDNSServer' => 'enableDNSServer',
            'enableDHCP' => 'enableDHCP',
            'dhcpRangeFrom' => 'dhcpRangeFrom',
            'dhcpRangeTo' => 'dhcpRangeTo',
            
            'httpProxy' => 'httpProxy',
            'httpProxyPort' => 'httpProxyPort',
            'httpProxyUser' => 'httpProxyUser',
            'httpProxyPassword' => 'httpProxyPassword',
            'httpsProxy' => 'httpsProxy',
            'httpsProxyPort' => 'httpsProxyPort',
            'httpsProxyUser' => 'httpsProxyUser',
            'httpsProxyPassword' => 'httpsProxyPassword',
        );
    }

    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

    public function rules()
    {
        return array(
            array(
                'ip,
                subnetMask,
                gateway,
                dns',
                'required'
            ),
            array(
                'subnetMask
                enableDNSServer,
                dhcpRangeFrom,
                dhcpRangeTo,
                enableDHCP,
                httpProxy,
                httpProxyPort,
                httpProxyUser,
                httpProxyPassword,
                httpsProxy,
                httpsProxyPort,
                httpsProxyUser,
                httpsProxyPassword',
                'safe'
            ),
        );
    }
    
    public function attributeLabels()
    {
        return array(
            'ip' => __("WIZARD_IP"),
            'subnetMask' => __('WIZARD_SUBNET'),
            'dns' => __("NETWORK_INTERFACE_MODEL_DNS"),
            'gateway' => __("NETWORK_INTERFACE_MODEL_GATEWAY"),
            'enableDNSServer' => __("DNS_SERVER_ENABLE_DNS_SERVER"),
            'enableDHCP' => __("NETWORK_SETTINGS_CONFIG_KEY_ENABLE_DCHPD"),
            'httpProxy' => __('SYSTEM_GLOBAL_CONFIG_KEY_HTTP_PROXY_IP_ADDRESS_SHORT'),
            'httpProxyPort' => __('SYSTEM_GLOBAL_CONFIG_KEY_HTTP_PROXY_PORT_SHORT'),
            'httpProxyUser' => __('SYSTEM_GLOBAL_CONFIG_KEY_HTTP_PROXY_USERNAME_SHORT'),
            'httpProxyPassword' =>__('SYSTEM_GLOBAL_CONFIG_KEY_HTTP_PROXY_PASSWORD_SHORT'),
            'httpsProxy' => __('SYSTEM_GLOBAL_CONFIG_KEY_HTTPS_PROXY_IP_ADDRESS_SHORT'),
            'httpsProxyPort' => __('SYSTEM_GLOBAL_CONFIG_KEY_HTTPS_PROXY_PORT_SHORT'),
            'httpsProxyUser' => __('SYSTEM_GLOBAL_CONFIG_KEY_HTTPS_PROXY_USERNAME_SHORT'),
            'httpsProxyPassword' =>__('SYSTEM_GLOBAL_CONFIG_KEY_HTTPS_PROXY_PASSWORD_SHORT'),
        );
    }
}
