public function initialize()
 {
     $mailValidator = $this->createValidator()->orValidator($this->createValidator(Validate::EMAIL), $this->createValidator(Validate::EMPTYSTRING));
     parent::initialize();
     $this->declareParameter('LetsEncryptMail', $mailValidator, array('configuration', 'pki', 'LetsEncryptMail'));
     $this->declareParameter('LetsEncryptDomains', Validate::ANYTHING, array('configuration', 'pki', 'LetsEncryptDomains'));
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('login', Validate::NOTEMPTY);
     $this->declareParameter('password', Validate::NOTEMPTY);
     $this->passwordStash = new \NethServer\Tool\PasswordStash();
     $this->passwordStash->setAutoUnlink(TRUE);
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'snmpd', 'status'));
     $this->declareParameter('Community', Validate::NOTEMPTY, array('configuration', 'snmpd', 'Community'));
     $this->declareParameter('SysContact', Validate::ANYTHING, array('configuration', 'snmpd', 'SysContact'));
     $this->declareParameter('SysLocation', Validate::ANYTHING, array('configuration', 'snmpd', 'SysLocation'));
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('Policy', $this->createValidator()->memberOf($this->policies), array('configuration', 'firewall', 'Policy'));
     $this->declareParameter('ExternalPing', Validate::SERVICESTATUS, array('configuration', 'firewall', 'ExternalPing'));
     $this->declareParameter('MACValidation', Validate::SERVICESTATUS, array('configuration', 'firewall', 'MACValidation'));
     $this->declareParameter('MACValidationPolicy', $this->createValidator()->memberOf($this->mac_policies), array('configuration', 'firewall', 'MACValidationPolicy'));
 }
Exemple #5
0
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('DiskCache', Validate::SERVICESTATUS, array('configuration', 'squid', 'DiskCache'));
     $this->declareParameter('DiskCacheSize', Validate::NONNEGATIVE_INTEGER, array('configuration', 'squid', 'DiskCacheSize'));
     $this->declareParameter('MinObjSize', Validate::NONNEGATIVE_INTEGER, array('configuration', 'squid', 'MinObjSize'));
     $this->declareParameter('MaxObjSize', Validate::NONNEGATIVE_INTEGER, array('configuration', 'squid', 'MaxObjSize'));
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('status', Validate::SERVICESTATUS, array(array('configuration', 'ipsec', 'ServerStatus'), array('configuration', 'xl2tpd', 'status')));
     $this->declareParameter('KeyType', $this->createValidator()->memberOf(array('rsa', 'psk')), array('configuration', 'ipsec', 'KeyType'));
     $this->declareParameter('KeyPskSecret', Validate::NOTEMPTY, array('configuration', 'ipsec', 'KeyPskSecret'));
     $this->declareParameter('L2tpNetwork', Validate::IPv4, array('configuration', 'ipsec', 'L2tpNetwork'));
     $this->declareParameter('L2tpNetmask', Validate::IPv4_NETMASK, array('configuration', 'ipsec', 'L2tpNetmask'));
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('City', Validate::ANYTHING, array('configuration', 'OrganizationContact', 'City'));
     $this->declareParameter('Company', Validate::NOTEMPTY, array('configuration', 'OrganizationContact', 'Company'));
     $this->declareParameter('Department', Validate::ANYTHING, array('configuration', 'OrganizationContact', 'Department'));
     $this->declareParameter('PhoneNumber', Validate::ANYTHING, array('configuration', 'OrganizationContact', 'PhoneNumber'));
     $this->declareParameter('Street', Validate::ANYTHING, array('configuration', 'OrganizationContact', 'Street'));
 }
Exemple #8
0
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'ntpd', 'status'));
     $this->declareParameter('date', Validate::DATE, array($this, 'getCurrentDate'));
     $this->declareParameter('time', Validate::TIME, array($this, 'getCurrentTime'));
     $this->declareParameter('server', Validate::HOSTNAME, array('configuration', 'ntpd', 'NTPServer'));
     $this->declareParameter('timezone', $this->createValidator(), array('configuration', 'TimeZone', NULL));
 }
 public function initialize()
 {
     $this->declareParameter('Users', $this->createValidator()->memberOf('none', 'strong'), array('configuration', 'passwordstrength', 'Users'));
     $this->declareParameter('MaxPassAge', Validate::POSITIVE_INTEGER, array('configuration', 'passwordstrength', 'MaxPassAge'));
     $this->declareParameter('MinPassAge', $this->createValidator()->memberOf('0', '30', '60', '90', '180', '365'), array('configuration', 'passwordstrength', 'MinPassAge'));
     $this->declareParameter('PassExpires', $this->createValidator()->memberOf('yes', 'no'), array('configuration', 'passwordstrength', 'PassExpires'));
     $this->declareParameter('PassWarning', Validate::POSITIVE_INTEGER, array('configuration', 'passwordstrength', 'PassWarning'));
     parent::initialize();
 }
Exemple #10
0
 public function initialize()
 {
     parent::initialize();
     $validInterfaces = array_keys($this->getNetworkInterfaces());
     $this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'ntopng', 'status'));
     $this->declareParameter('Authentication', Validate::SERVICESTATUS, array('configuration', 'ntopng', 'Authentication'));
     $this->declareParameter('TCPPort', Validate::PORTNUMBER, array('configuration', 'ntopng', 'TCPPort'));
     $this->declareParameter('Interfaces', $this->createValidator()->collectionValidator($this->createValidator()->memberOf($validInterfaces)), array('configuration', 'ntopng', 'Interfaces', ','));
 }
Exemple #11
0
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'squid', 'status'));
     $this->declareParameter('GreenMode', $this->createValidator()->memberOf($this->modes), array('configuration', 'squid', 'GreenMode'));
     $this->declareParameter('BlueMode', $this->createValidator()->memberOf($this->modes), array('configuration', 'squid', 'BlueMode'));
     $this->declareParameter('ParentProxy', Validate::IPv4_OR_EMPTY, array('configuration', 'squid', 'ParentProxy'));
     $this->declareParameter('PortBlock', Validate::SERVICESTATUS, array('configuration', 'squid', 'PortBlock'));
 }
Exemple #12
0
 public function initialize()
 {
     parent::initialize();
     $localeValidator = $this->createValidator()->memberOf($this->getLocales());
     $this->declareParameter('username', Valid::NOTEMPTY);
     $this->declareParameter('password', Valid::NOTEMPTY);
     $this->declareParameter('path', Valid::NOTEMPTY);
     $this->declareParameter('language', $localeValidator, array($this, 'getLocaleFromRequest'));
     $this->declareParameter('hostname', FALSE, array('configuration', 'SystemName'));
 }
 public function initialize()
 {
     parent::initialize();
     $tnAdapter = $this->getPlatform()->getMapAdapter(array($this, 'xreadAccessPolicyTrustedNetworks'), array($this, 'xwriteAccessPolicyTrustedNetworks'), array());
     $saAdapter = $this->getPlatform()->getMapAdapter(array($this, 'xreadAccessPolicySmtpAuth'), array($this, 'xwriteAccessPolicySmtpAuth'), array());
     $this->declareParameter('AccessBypassList', $this->createValidator(TRUE), array('configuration', 'postfix', 'AccessBypassList'));
     $this->declareParameter('AccessPolicyTrustedNetworks', \Nethgui\System\PlatformInterface::YES_NO, $tnAdapter);
     $this->declareParameter('AccessPolicySmtpAuth', \Nethgui\System\PlatformInterface::YES_NO, $saAdapter);
     $this->declareParameter('AccessPolicies', FALSE, array('configuration', 'postfix', 'AccessPolicies', ','));
 }
 public function initialize()
 {
     parent::initialize();
     $ftvalidator = $this->createValidator()->orValidator($this->createValidator()->regexp('/(\\w+)(,\\s*\\w+)*/'), $this->createValidator()->isEmpty());
     $this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'squidguard', 'status'));
     $this->declareParameter('BlockAll', Validate::SERVICESTATUS, array('configuration', 'squidguard', 'BlockAll'));
     $this->declareParameter('Expressions', Validate::SERVICESTATUS, array('configuration', 'squidguard', 'Expressions'));
     $this->declareParameter('BlockedFileTypes', $ftvalidator, array('configuration', 'squidguard', 'BlockedFileTypes'));
     $this->declareParameter('BlockAcl', Validate::ANYTHING, array(array('configuration', 'squidguard', 'DomainBlacklist'), array('configuration', 'squidguard', 'UrlBlacklist')));
     $this->declareParameter('AllowAcl', Validate::ANYTHING, array(array('configuration', 'squidguard', 'DomainWhitelist'), array('configuration', 'squidguard', 'UrlWhitelist')));
 }
 public function initialize()
 {
     $this->declareParameter('ImapStatus', Validate::SERVICESTATUS, array('configuration', 'dovecot', 'ImapStatus'));
     $this->declareParameter('PopStatus', Validate::SERVICESTATUS, array('configuration', 'dovecot', 'PopStatus'));
     $this->declareParameter('TlsSecurity', '/^(required|optional)$/', array('configuration', 'dovecot', 'TlsSecurity'));
     $this->declareParameter('QuotaStatus', Validate::SERVICESTATUS, array('configuration', 'dovecot', 'QuotaStatus'));
     $this->declareParameter('QuotaDefaultSize', Validate::POSITIVE_INTEGER, array('configuration', 'dovecot', 'QuotaDefaultSize'));
     $this->declareParameter('SpamRetentionTime', '/^(\\d+[smhdw]|infinite)$/', array('configuration', 'dovecot', 'SpamRetentionTime'));
     $this->declareParameter('SpamFolder', $this->createValidator()->memberOf('', 'Junk', 'junkmail'), array('configuration', 'dovecot', 'SpamFolder'));
     $this->declareParameter('AdminIsMaster', Validate::SERVICESTATUS, array('configuration', 'dovecot', 'AdminIsMaster'));
     parent::initialize();
 }
 public function initialize()
 {
     parent::initialize();
     if (!$this->templates) {
         $this->templates = $this->readTemplates();
     }
     $this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'p3scan', 'status'));
     $this->declareParameter('SSLScan', Validate::SERVICESTATUS, array('configuration', 'p3scan', 'SSLScan'));
     $this->declareParameter('VirusScan', Validate::SERVICESTATUS, array('configuration', 'p3scan', 'VirusScan'));
     $this->declareParameter('SpamScan', Validate::SERVICESTATUS, array('configuration', 'p3scan', 'SpamScan'));
     $this->declareParameter('Template', $this->createValidator()->memberOf($this->templates), array('configuration', 'p3scan', 'Template'));
 }
 public function initialize()
 {
     $messageSizeMaxAdapter = $this->getPlatform()->getMapAdapter(function ($s) {
         return intval($s / 1000000);
     }, function ($v) {
         return array($v * 1000000);
     }, array(array('configuration', 'postfix', 'MessageSizeMax')));
     $this->declareParameter('MessageSizeMax', $this->createValidator(Validate::POSITIVE_INTEGER)->lessThan(1001), $messageSizeMaxAdapter);
     $this->declareParameter('MessageQueueLifetime', $this->createValidator(Validate::POSITIVE_INTEGER)->lessThan(31), array('configuration', 'postfix', 'MessageQueueLifetime'));
     $this->declareParameter('AlwaysBccStatus', Validate::SERVICESTATUS, array('configuration', 'postfix', 'AlwaysBccStatus'));
     $this->declareParameter('AlwaysBccAddress', Validate::EMAIL, array('configuration', 'postfix', 'AlwaysBccAddress'));
     parent::initialize();
 }
Exemple #18
0
 public function initialize()
 {
     parent::initialize();
     $providerValidator = $this->createValidator()->memberOf('none', 'ldap', 'ad');
     $ldapUriAdapter = $this->getPlatform()->getMapAdapter(function ($v) {
         return preg_replace('|^ldaps?://|', '', $v);
     }, function ($v) {
         return array('ldap://' . $v);
     }, array(array('configuration', 'sssd', 'LdapURI')));
     $this->declareParameter('Provider', $providerValidator, array('configuration', 'sssd', 'Provider'));
     $this->declareParameter('LdapUri', Validate::HOSTADDRESS, $ldapUriAdapter);
     $this->declareParameter('AdDns', Validate::IP_OR_EMPTY, array('configuration', 'sssd', 'AdDns'));
 }
Exemple #19
0
 public function initialize()
 {
     parent::initialize();
     $validator = $this->createValidator()->regexp('/^[^\\/,]+$/', 'valid_x509_field');
     $this->declareParameter('C', $this->orEmptyValidator($this->createValidator()->maxLength(2)->minLength(2)), array('configuration', 'pki', 'CountryCode'));
     $this->declareParameter('ST', $this->orEmptyValidator($validator), array('configuration', 'pki', 'State'));
     $this->declareParameter('L', $this->orEmptyValidator($validator), array('configuration', 'pki', 'Locality'));
     $this->declareParameter('O', $this->orEmptyValidator($validator), array('configuration', 'pki', 'Organization'));
     $this->declareParameter('OU', $this->orEmptyValidator($validator), array('configuration', 'pki', 'OrganizationalUnitName'));
     $this->declareParameter('CN', $this->orEmptyValidator($validator), array('configuration', 'pki', 'CommonName'));
     $this->declareParameter('EmailAddress', $this->orEmptyValidator(\Nethgui\System\PlatformInterface::EMAIL), array('configuration', 'pki', 'EmailAddress'));
     $this->declareParameter('SubjectAltName', $this->createValidator(\Nethgui\System\PlatformInterface::ANYTHING), array('configuration', 'pki', 'SubjectAltName'));
     $this->declareParameter('CertificateDuration', $this->createValidator()->greatThan(10), array('configuration', 'pki', 'CertificateDuration'));
 }
 public function initialize()
 {
     parent::initialize();
     $roleValidator = $this->getPlatform()->createValidator()->memberOf('WS', 'PDC', 'ADS');
     $hostnameOrEmptyValidator = $this->createValidator()->orValidator($this->createValidator(Validate::HOSTNAME), $this->createValidator(Validate::EMPTYSTRING));
     $this->declareParameter('WorkgroupName', $hostnameOrEmptyValidator, array('configuration', 'smb', 'Workgroup'));
     $this->declareParameter('PdcDomain', $hostnameOrEmptyValidator, array('configuration', 'smb', 'Workgroup'));
     $this->declareParameter('AdsDomain', $hostnameOrEmptyValidator, array('configuration', 'smb', 'Workgroup'));
     $this->declareParameter('ServerRole', $roleValidator, array('configuration', 'smb', 'ServerRole'));
     $this->declareParameter('RoamingProfiles', Validate::YES_NO, array('configuration', 'smb', 'RoamingProfiles'));
     // DISABLED: this is probed automatically:
     // $this->declareParameter('AdsController', $hostnameOrEmptyValidator, array('configuration', 'smb', 'AdsController'));
     $this->declareParameter('AdsRealm', $hostnameOrEmptyValidator, array('configuration', 'smb', 'AdsRealm'));
     $this->declareParameter('AdsLdapAccountsBranch', Validate::ANYTHING, array('configuration', 'smb', 'AdsLdapAccountsBranch'));
 }
Exemple #21
0
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('Action', $this->createValidator()->memberOf('poweroff', 'reboot'));
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('IpAddress', $this->createValidator(Validate::IPv4), array('configuration', 'nsdc', 'IpAddress'));
     $this->declareParameter('force', '/^(yes)?$/');
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('Lists', $this->createValidator()->memberOf($this->lists), array('configuration', 'squidguard', 'Lists'));
     $this->declareParameter('CustomListURL', Validate::ANYTHING, array('configuration', 'squidguard', 'CustomListURL'));
 }
Exemple #24
0
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('search', Validate::ANYTHING);
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('cards', \Nethgui\System\PlatformInterface::ANYTHING_COLLECTION);
 }
Exemple #26
0
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('switch', \Nethgui\System\PlatformInterface::ANYTHING);
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('login', Validate::NOTEMPTY);
     $this->declareParameter('password', Validate::NOTEMPTY);
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'cups', 'status'));
 }
 public function initialize()
 {
     parent::initialize();
     $this->declareParameter('Status', \Nethgui\System\PlatformInterface::SERVICESTATUS, array('configuration', 'phone-home', 'status'));
 }
 public function initialize()
 {
     parent::initialize();
     $this->tableAdapter = $this->getPlatform()->getTableAdapter('dhcp', 'range');
 }