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
c2df3e2f
Commit
c2df3e2f
authored
Aug 04, 2016
by
Ad Schellevis
Committed by
GitHub
Aug 04, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1112 from pv2b/master
Style cleanup (ran make stylefix)
parents
214d92c3
8201c62b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
29 deletions
+28
-29
SystemhealthController.php
...llers/OPNsense/Diagnostics/Api/SystemhealthController.php
+0
-1
AuthenticationFactory.php
...e/mvc/app/library/OPNsense/Auth/AuthenticationFactory.php
+19
-19
LocalTOTP.php
src/opnsense/mvc/app/library/OPNsense/Auth/LocalTOTP.php
+3
-3
Voucher.php
src/opnsense/mvc/app/library/OPNsense/Auth/Voucher.php
+3
-3
CertificateField.php
.../app/models/OPNsense/Base/FieldTypes/CertificateField.php
+3
-3
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php
View file @
c2df3e2f
...
@@ -603,5 +603,4 @@ class SystemhealthController extends ApiControllerBase
...
@@ -603,5 +603,4 @@ class SystemhealthController extends ApiControllerBase
}
}
return
$intfmap
;
return
$intfmap
;
}
}
}
}
src/opnsense/mvc/app/library/OPNsense/Auth/AuthenticationFactory.php
View file @
c2df3e2f
...
@@ -65,7 +65,7 @@ class AuthenticationFactory
...
@@ -65,7 +65,7 @@ class AuthenticationFactory
{
{
$connectors
=
array
();
$connectors
=
array
();
foreach
(
glob
(
__DIR__
.
"/*.php"
)
as
$filename
)
{
foreach
(
glob
(
__DIR__
.
"/*.php"
)
as
$filename
)
{
$pathParts
=
explode
(
'/'
,
$filename
);
$pathParts
=
explode
(
'/'
,
$filename
);
$vendor
=
$pathParts
[
count
(
$pathParts
)
-
3
];
$vendor
=
$pathParts
[
count
(
$pathParts
)
-
3
];
$module
=
$pathParts
[
count
(
$pathParts
)
-
2
];
$module
=
$pathParts
[
count
(
$pathParts
)
-
2
];
$classname
=
explode
(
'.php'
,
$pathParts
[
count
(
$pathParts
)
-
1
])[
0
];
$classname
=
explode
(
'.php'
,
$pathParts
[
count
(
$pathParts
)
-
1
])[
0
];
...
@@ -144,22 +144,22 @@ class AuthenticationFactory
...
@@ -144,22 +144,22 @@ class AuthenticationFactory
* list configuration options for pluggable auth modules
* list configuration options for pluggable auth modules
* @return array
* @return array
*/
*/
public
function
listConfigOptions
()
public
function
listConfigOptions
()
{
{
$result
=
array
();
$result
=
array
();
foreach
(
$this
->
listConnectors
()
as
$connector
)
{
foreach
(
$this
->
listConnectors
()
as
$connector
)
{
if
(
$connector
[
'classHandle'
]
->
hasMethod
(
'getDescription'
))
{
if
(
$connector
[
'classHandle'
]
->
hasMethod
(
'getDescription'
))
{
$obj
=
$connector
[
'classHandle'
]
->
newInstance
();
$obj
=
$connector
[
'classHandle'
]
->
newInstance
();
$authItem
=
$connector
;
$authItem
=
$connector
;
$authItem
[
'description'
]
=
$obj
->
getDescription
();
$authItem
[
'description'
]
=
$obj
->
getDescription
();
if
(
$connector
[
'classHandle'
]
->
hasMethod
(
'getConfigurationOptions'
))
{
if
(
$connector
[
'classHandle'
]
->
hasMethod
(
'getConfigurationOptions'
))
{
$authItem
[
'additionalFields'
]
=
$obj
->
getConfigurationOptions
();
$authItem
[
'additionalFields'
]
=
$obj
->
getConfigurationOptions
();
}
else
{
}
else
{
$authItem
[
'additionalFields'
]
=
array
();
$authItem
[
'additionalFields'
]
=
array
();
}
}
$result
[
$obj
->
getType
()]
=
$authItem
;
$result
[
$obj
->
getType
()]
=
$authItem
;
}
}
}
}
return
$result
;
return
$result
;
}
}
}
}
src/opnsense/mvc/app/library/OPNsense/Auth/LocalTOTP.php
View file @
c2df3e2f
...
@@ -206,7 +206,7 @@ class LocalTOTP extends Local
...
@@ -206,7 +206,7 @@ class LocalTOTP extends Local
$fields
[
"otpLength"
][
"options"
][
"6"
]
=
"6"
;
$fields
[
"otpLength"
][
"options"
][
"6"
]
=
"6"
;
$fields
[
"otpLength"
][
"options"
][
"8"
]
=
"8"
;
$fields
[
"otpLength"
][
"options"
][
"8"
]
=
"8"
;
$fields
[
"otpLength"
][
"help"
]
=
gettext
(
"Token length to use"
);
$fields
[
"otpLength"
][
"help"
]
=
gettext
(
"Token length to use"
);
$fields
[
"otpLength"
][
"validate"
]
=
function
(
$value
)
{
$fields
[
"otpLength"
][
"validate"
]
=
function
(
$value
)
{
if
(
!
in_array
(
$value
,
array
(
6
,
8
)))
{
if
(
!
in_array
(
$value
,
array
(
6
,
8
)))
{
return
array
(
gettext
(
"Only token lengths of 6 or 8 characters are supported"
));
return
array
(
gettext
(
"Only token lengths of 6 or 8 characters are supported"
));
}
else
{
}
else
{
...
@@ -219,7 +219,7 @@ class LocalTOTP extends Local
...
@@ -219,7 +219,7 @@ class LocalTOTP extends Local
$fields
[
"timeWindow"
][
"default"
]
=
null
;
$fields
[
"timeWindow"
][
"default"
]
=
null
;
$fields
[
"timeWindow"
][
"help"
]
=
gettext
(
"The time period in which the token will be valid,"
.
$fields
[
"timeWindow"
][
"help"
]
=
gettext
(
"The time period in which the token will be valid,"
.
" default is 30 seconds (google authenticator)"
)
;
" default is 30 seconds (google authenticator)"
)
;
$fields
[
"timeWindow"
][
"validate"
]
=
function
(
$value
)
{
$fields
[
"timeWindow"
][
"validate"
]
=
function
(
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
return
array
(
gettext
(
"Please enter a valid time window in seconds"
));
return
array
(
gettext
(
"Please enter a valid time window in seconds"
));
}
else
{
}
else
{
...
@@ -232,7 +232,7 @@ class LocalTOTP extends Local
...
@@ -232,7 +232,7 @@ class LocalTOTP extends Local
$fields
[
"graceperiod"
][
"default"
]
=
null
;
$fields
[
"graceperiod"
][
"default"
]
=
null
;
$fields
[
"graceperiod"
][
"help"
]
=
gettext
(
"Time in seconds in which this server and the token may differ,"
.
$fields
[
"graceperiod"
][
"help"
]
=
gettext
(
"Time in seconds in which this server and the token may differ,"
.
" default is 10 seconds. Set higher for a less secure easier match."
);
" default is 10 seconds. Set higher for a less secure easier match."
);
$fields
[
"graceperiod"
][
"validate"
]
=
function
(
$value
)
{
$fields
[
"graceperiod"
][
"validate"
]
=
function
(
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
return
array
(
gettext
(
"Please enter a valid grace period in seconds"
));
return
array
(
gettext
(
"Please enter a valid grace period in seconds"
));
}
else
{
}
else
{
...
...
src/opnsense/mvc/app/library/OPNsense/Auth/Voucher.php
View file @
c2df3e2f
...
@@ -401,7 +401,7 @@ class Voucher implements IAuthConnector
...
@@ -401,7 +401,7 @@ class Voucher implements IAuthConnector
$fields
[
"simplePasswords"
][
"name"
]
=
gettext
(
"Use simple passwords (less secure)"
);
$fields
[
"simplePasswords"
][
"name"
]
=
gettext
(
"Use simple passwords (less secure)"
);
$fields
[
"simplePasswords"
][
"type"
]
=
"checkbox"
;
$fields
[
"simplePasswords"
][
"type"
]
=
"checkbox"
;
$fields
[
"simplePasswords"
][
"help"
]
=
gettext
(
"Use simple (less secure) passwords, which are easier to read"
)
;
$fields
[
"simplePasswords"
][
"help"
]
=
gettext
(
"Use simple (less secure) passwords, which are easier to read"
)
;
$fields
[
"simplePasswords"
][
"validate"
]
=
function
(
$value
)
{
$fields
[
"simplePasswords"
][
"validate"
]
=
function
(
$value
)
{
return
array
();
return
array
();
};
};
$fields
[
"usernameLength"
]
=
array
();
$fields
[
"usernameLength"
]
=
array
();
...
@@ -409,7 +409,7 @@ class Voucher implements IAuthConnector
...
@@ -409,7 +409,7 @@ class Voucher implements IAuthConnector
$fields
[
"usernameLength"
][
"type"
]
=
"text"
;
$fields
[
"usernameLength"
][
"type"
]
=
"text"
;
$fields
[
"usernameLength"
][
"default"
]
=
null
;
$fields
[
"usernameLength"
][
"default"
]
=
null
;
$fields
[
"usernameLength"
][
"help"
]
=
gettext
(
"Specify alternative username length for generating vouchers"
);
$fields
[
"usernameLength"
][
"help"
]
=
gettext
(
"Specify alternative username length for generating vouchers"
);
$fields
[
"usernameLength"
][
"validate"
]
=
function
(
$value
)
{
$fields
[
"usernameLength"
][
"validate"
]
=
function
(
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
return
array
(
gettext
(
"Username length must be a number or empty for default."
));
return
array
(
gettext
(
"Username length must be a number or empty for default."
));
}
else
{
}
else
{
...
@@ -421,7 +421,7 @@ class Voucher implements IAuthConnector
...
@@ -421,7 +421,7 @@ class Voucher implements IAuthConnector
$fields
[
"passwordLength"
][
"type"
]
=
"text"
;
$fields
[
"passwordLength"
][
"type"
]
=
"text"
;
$fields
[
"passwordLength"
][
"default"
]
=
null
;
$fields
[
"passwordLength"
][
"default"
]
=
null
;
$fields
[
"passwordLength"
][
"help"
]
=
gettext
(
"Specify alternative password length for generating vouchers"
);
$fields
[
"passwordLength"
][
"help"
]
=
gettext
(
"Specify alternative password length for generating vouchers"
);
$fields
[
"passwordLength"
][
"validate"
]
=
function
(
$value
)
{
$fields
[
"passwordLength"
][
"validate"
]
=
function
(
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
if
(
!
empty
(
$value
)
&&
filter_var
(
$value
,
FILTER_SANITIZE_NUMBER_INT
)
!=
$value
)
{
return
array
(
gettext
(
"Password length must be a number or empty for default."
));
return
array
(
gettext
(
"Password length must be a number or empty for default."
));
}
else
{
}
else
{
...
...
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CertificateField.php
View file @
c2df3e2f
...
@@ -101,9 +101,9 @@ class CertificateField extends BaseField
...
@@ -101,9 +101,9 @@ class CertificateField extends BaseField
if
(
!
array_key_exists
(
$this
->
certificateType
,
self
::
$internalOptionList
))
{
if
(
!
array_key_exists
(
$this
->
certificateType
,
self
::
$internalOptionList
))
{
self
::
$internalOptionList
[
$this
->
certificateType
]
=
array
();
self
::
$internalOptionList
[
$this
->
certificateType
]
=
array
();
$configObj
=
Config
::
getInstance
()
->
object
();
$configObj
=
Config
::
getInstance
()
->
object
();
foreach
(
$configObj
->
{
$this
->
certificateType
}
as
$cert
)
{
foreach
(
$configObj
->
{
$this
->
certificateType
}
as
$cert
)
{
self
::
$internalOptionList
[
$this
->
certificateType
][(
string
)
$cert
->
refid
]
=
(
string
)
$cert
->
descr
;
self
::
$internalOptionList
[
$this
->
certificateType
][(
string
)
$cert
->
refid
]
=
(
string
)
$cert
->
descr
;
}
}
}
}
}
}
...
...
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