You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
help_text: 'The IP address or network of the RADIUS client(s) in CIDR notation. This is the IP of the NAS (switch, access point, firewall, router, etc.)',
48
+
help_text: 'The IP address or network of the RADIUS client(s) in CIDR notation. This is the IP of the ' .
49
+
'NAS (switch, access point, firewall, router, etc.)',
54
50
);
55
-
$this->ipv = newStringField(
56
-
internal_name: 'varclientipversion',
57
-
choices: ['ipaddr', 'ipv6addr'],
58
-
allow_empty: true,
51
+
$this->ip_version = newStringField(
59
52
default: 'ipaddr',
53
+
choices: ['ipaddr', 'ipv6addr'],
54
+
internal_name: 'varclientipversion',
60
55
help_text: 'The IP version of the this Client.',
61
56
);
62
57
$this->shortname = newStringField(
63
-
internal_name: 'varclientshortname',
64
58
required: true,
65
-
allow_null: false,
59
+
internal_name: 'varclientshortname',
66
60
help_text: 'A short name for the client. This is generally the hostname of the NAS.',
67
61
);
68
62
$this->secret = newStringField(
69
-
internal_name: 'varclientsharedsecret',
70
63
required: true,
71
64
sensitive: true,
72
-
allow_empty: false,
73
-
help_text: 'This is the shared secret (password) which the NAS (switch, accesspoint, etc.) needs to communicate with the RADIUS server.',
65
+
maximum_length: 31,
66
+
internal_name: 'varclientsharedsecret',
67
+
help_text: 'This is the shared secret (password) which the NAS (switch, accesspoint, etc.) needs to ' .
68
+
'communicate with the RADIUS server.',
74
69
);
75
70
76
71
$this->proto = newStringField(
77
-
internal_name: 'varclientproto',
78
-
choices: ['udp', 'tcp'],
79
-
allow_empty: true,
80
72
default: 'udp',
81
-
help_text: 'The protocol the client uses. (Default: udp)',
73
+
choices: ['udp', 'tcp'],
74
+
internal_name: 'varclientproto',
75
+
help_text: 'The protocol the client uses.',
82
76
);
83
77
$this->nastype = newStringField(
84
-
internal_name: 'varclientnastype',
78
+
default: 'other',
85
79
choices: [
86
80
'cisco',
87
81
'cvx',
@@ -96,41 +90,45 @@ class FreeRADIUSClient extends Model {
96
90
'other',
97
91
],
98
92
allow_empty: true,
99
-
default: 'other',
100
-
help_text: 'The NAS type of the client. This is used by checkrad.pl for simultaneous use checks. (Default: other)',
93
+
internal_name: 'varclientnastype',
94
+
help_text: 'The NAS type of the client. This is used by checkrad.pl for simultaneous use checks.',
101
95
);
102
-
$this->msgauth = newStringField(
96
+
$this->msgauth = newBooleanField(
97
+
default: false,
98
+
indicates_true: 'yes',
99
+
indicates_false: 'no',
103
100
internal_name: 'varrequiremessageauthenticator',
104
-
choices: ['yes', 'no'],
105
-
default: 'no',
106
-
help_text: 'RFC5080 requires Message-Authenticator in Access-Request. But older NAS (switches or accesspoints) do not include that. (Default: no)',
101
+
help_text: 'RFC5080 requires Message-Authenticator in Access-Request. But older NAS (switches or ' .
102
+
'accesspoints) do not include that.',
107
103
);
108
104
$this->maxconn = newIntegerField(
109
-
internal_name: 'varclientmaxconnections',
105
+
default: 16,
110
106
minimum: 1,
111
107
maximum: 32,
112
-
default: 16,
113
-
help_text: 'Takes only effect if you use TCP as protocol. Limits the number of simultaneous TCP connections from a client. (max=32)',
108
+
internal_name: 'varclientmaxconnections',
109
+
help_text: 'Takes only effect if you use TCP as protocol. Limits the number of simultaneous TCP
110
+
connections from a client.',
114
111
);
115
112
$this->naslogin = newStringField(
116
-
internal_name: 'varclientlogininput',
117
-
allow_empty: true,
118
113
default: '',
119
-
help_text: 'If supported by your NAS, you can use SNMP or finger for simultaneous-use checks instead of (s)radutmp file and accounting. Leave empty to choose (s)radutmp. (Default: empty) ',
114
+
allow_empty: true,
115
+
internal_name: 'varclientlogininput',
116
+
help_text: 'If supported by your NAS, you can use SNMP or finger for simultaneous-use checks instead of ' .
117
+
'(s)radutmp file and accounting. Leave empty to choose (s)radutmp.',
120
118
);
121
119
$this->naspassword = newStringField(
122
-
internal_name: 'varclientpasswordinput',
123
-
allow_empty: true,
124
120
default: '',
121
+
allow_empty: true,
125
122
sensitive: true,
126
-
help_text: 'If supported by your NAS, you can use SNMP or finger for simultaneous-use checks instead of (s)radutmp file and accounting. Leave empty to choose
127
-
(s)radutmp. (Default: empty) ',
123
+
internal_name: 'varclientpasswordinput',
124
+
help_text: 'If supported by your NAS, you can use SNMP or finger for simultaneous-use checks instead of ' .
125
+
'(s)radutmp file and accounting. Leave empty to choose (s)radutmp.',
128
126
);
129
127
130
128
$this->description = newStringField(
131
129
required: false,
132
-
allow_empty: true,
133
130
default: '',
131
+
allow_empty: true,
134
132
validators: [
135
133
newRegexValidator(
136
134
pattern: "/^[a-zA-Z0-9 _,.;:+=()-]*$/",
@@ -144,44 +142,55 @@ class FreeRADIUSClient extends Model {
144
142
}
145
143
146
144
/**
147
-
* Perform additional validation on the Model's fields and data.
145
+
* Perform extra validation on the Model's 'addr' field.
146
+
* @param string $value The value to validate.
147
+
* @returns string The validated value.
148
+
* @throws ValidationError If the value does not match IP version specified in the 'ip_version' field.
0 commit comments