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
a1e44cc6
Commit
a1e44cc6
authored
Nov 10, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style fix
parent
2a60c252
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
ApiControllerBase.php
...e/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php
+4
-4
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php
View file @
a1e44cc6
...
@@ -30,6 +30,7 @@ namespace OPNsense\Base;
...
@@ -30,6 +30,7 @@ namespace OPNsense\Base;
use
OPNsense\Core\ACL
;
use
OPNsense\Core\ACL
;
use
OPNsense\Auth\AuthenticationFactory
;
use
OPNsense\Auth\AuthenticationFactory
;
/**
/**
* Class ApiControllerBase, inherit this class to implement API calls
* Class ApiControllerBase, inherit this class to implement API calls
* @package OPNsense\Base
* @package OPNsense\Base
...
@@ -111,8 +112,7 @@ class ApiControllerBase extends ControllerRoot
...
@@ -111,8 +112,7 @@ class ApiControllerBase extends ControllerRoot
if
(
!
$acl
->
isPageAccessible
(
$authResult
[
'username'
],
$_SERVER
[
'REQUEST_URI'
]))
{
if
(
!
$acl
->
isPageAccessible
(
$authResult
[
'username'
],
$_SERVER
[
'REQUEST_URI'
]))
{
$this
->
getLogger
()
->
error
(
"uri "
.
$_SERVER
[
'REQUEST_URI'
]
.
$this
->
getLogger
()
->
error
(
"uri "
.
$_SERVER
[
'REQUEST_URI'
]
.
" not accessible for user "
.
$authResult
[
'username'
]
.
" using api key "
.
" not accessible for user "
.
$authResult
[
'username'
]
.
" using api key "
.
$apiKey
$apiKey
);
);
}
else
{
}
else
{
// authentication + authorization successful.
// authentication + authorization successful.
// pre validate request and communicate back to the user on errors
// pre validate request and communicate back to the user on errors
...
@@ -134,8 +134,8 @@ class ApiControllerBase extends ControllerRoot
...
@@ -134,8 +134,8 @@ class ApiControllerBase extends ControllerRoot
$this
->
response
->
setContentType
(
'application/json'
,
'UTF-8'
);
$this
->
response
->
setContentType
(
'application/json'
,
'UTF-8'
);
$this
->
response
->
setJsonContent
(
$this
->
response
->
setJsonContent
(
array
(
'message'
=>
$dispatchError
,
array
(
'message'
=>
$dispatchError
,
'status'
=>
400
'status'
=>
400
)
)
)
;
);
$this
->
response
->
send
();
$this
->
response
->
send
();
return
false
;
return
false
;
}
}
...
...
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