Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
be42041b
Commit
be42041b
authored
Jun 28, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(proxy) refactor proxy interface selection to use new fieldtype
parent
2865da35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
27 deletions
+12
-27
SettingsController.php
...app/controllers/OPNsense/Proxy/Api/SettingsController.php
+0
-25
Proxy.xml
src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml
+12
-2
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/SettingsController.php
View file @
be42041b
...
...
@@ -47,31 +47,6 @@ class SettingsController extends ApiControllerBase
$result
=
array
();
if
(
$this
->
request
->
isGet
())
{
$mdlProxy
=
new
Proxy
();
// Define array for selected interfaces
$selopt
=
array
();
// Get ConfigObject
$configObj
=
Config
::
getInstance
()
->
object
();
// Iterate over all interfaces configuration
// TODO: replace for <interfaces> helper
foreach
(
$configObj
->
interfaces
->
children
()
as
$key
=>
$value
)
{
// Check if interface is enabled, if tag is <enable/> treat as enabled.
if
(
isset
(
$value
->
enable
)
&&
$value
->
enable
!=
'0'
)
{
// Check if interface has static ip
if
(
$value
->
ipaddr
!=
'dhcp'
)
{
if
(
$value
->
descr
==
''
)
{
$description
=
strtoupper
(
$key
);
// Use interface name as description if none is given
}
else
{
$description
=
$value
->
descr
;
}
$selopt
[
$key
]
=
(
string
)
$description
;
// Add Interface to selectable options.
}
}
}
$mdlProxy
->
forward
->
interfaces
->
setSelectOptions
(
$selopt
);
$mdlProxy
->
forward
->
ftpInterfaces
->
setSelectOptions
(
$selopt
);
$result
[
'proxy'
]
=
$mdlProxy
->
getNodes
();
}
...
...
src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml
View file @
be42041b
...
...
@@ -125,8 +125,13 @@
</traffic>
</general>
<forward>
<interfaces
type=
"
CSVList
Field"
>
<interfaces
type=
"
Interface
Field"
>
<Required>
N
</Required>
<multiple>
Y
</multiple>
<filters>
<enable>
/^(?!0).*$/
</enable>
<ipaddr>
/^((?!dhcp).)*$/
</ipaddr>
</filters>
</interfaces>
<port
type=
"IntegerField"
>
<default>
3128
</default>
...
...
@@ -135,8 +140,13 @@
<ValidationMessage>
Proxy port needs to be an integer value between 1 and 65535
</ValidationMessage>
<Required>
Y
</Required>
</port>
<ftpInterfaces
type=
"
CSVList
Field"
>
<ftpInterfaces
type=
"
Interface
Field"
>
<Required>
N
</Required>
<multiple>
Y
</multiple>
<filters>
<enable>
/^(?!0).*$/
</enable>
<ipaddr>
/^((?!dhcp).)*$/
</ipaddr>
</filters>
</ftpInterfaces>
<ftpPort
type=
"IntegerField"
>
<default>
2121
</default>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment