Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-camogm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-camogm
Commits
64eeb889
Commit
64eeb889
authored
May 09, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added CORS header 2
parent
1fc31f1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
camogm_interface.php
src/camogmgui/camogm_interface.php
+9
-1
No files found.
src/camogmgui/camogm_interface.php
View file @
64eeb889
...
@@ -93,6 +93,10 @@ function check_camogm_running(){
...
@@ -93,6 +93,10 @@ function check_camogm_running(){
if
(
$cmd
==
"run_camogm"
)
if
(
$cmd
==
"run_camogm"
)
{
{
// allow CORS: needed for multi cams unified control
header
(
'Access-Control-Allow-Origin: *'
);
if
(
isset
(
$_GET
[
'state_file'
])){
if
(
isset
(
$_GET
[
'state_file'
])){
$state_file
=
$_GET
[
'state_file'
];
$state_file
=
$_GET
[
'state_file'
];
}
}
...
@@ -141,7 +145,7 @@ else if ($cmd == "status")
...
@@ -141,7 +145,7 @@ else if ($cmd == "status")
if
(
check_camogm_running
())
$camogm_running
=
"on"
;
if
(
check_camogm_running
())
$camogm_running
=
"on"
;
else
$camogm_running
=
"off"
;
else
$camogm_running
=
"off"
;
if
(
$camogm_running
){
if
(
$camogm_running
==
"on"
){
$pipe
=
"/var/state/camogm.state"
;
$pipe
=
"/var/state/camogm.state"
;
$mode
=
0777
;
$mode
=
0777
;
if
(
!
file_exists
(
$pipe
))
{
if
(
!
file_exists
(
$pipe
))
{
...
@@ -160,6 +164,8 @@ else if ($cmd == "status")
...
@@ -160,6 +164,8 @@ else if ($cmd == "status")
header
(
"Content-Type: text/xml"
);
header
(
"Content-Type: text/xml"
);
header
(
"Content-Length: "
.
strlen
(
$status
)
.
"
\n
"
);
header
(
"Content-Length: "
.
strlen
(
$status
)
.
"
\n
"
);
header
(
"Pragma: no-cache
\n
"
);
header
(
"Pragma: no-cache
\n
"
);
// allow CORS: needed for multi cams unified control
header
(
'Access-Control-Allow-Origin: *'
);
printf
(
"%s"
,
$status
);
printf
(
"%s"
,
$status
);
}
}
else
if
(
$cmd
==
"run_status"
)
else
if
(
$cmd
==
"run_status"
)
...
@@ -173,6 +179,8 @@ else if ($cmd == "run_status")
...
@@ -173,6 +179,8 @@ else if ($cmd == "run_status")
header
(
"Content-Type: text/xml"
);
header
(
"Content-Type: text/xml"
);
header
(
"Content-Length: "
.
strlen
(
$status
)
.
"
\n
"
);
header
(
"Content-Length: "
.
strlen
(
$status
)
.
"
\n
"
);
header
(
"Pragma: no-cache
\n
"
);
header
(
"Pragma: no-cache
\n
"
);
// allow CORS: needed for multi cams unified control
header
(
'Access-Control-Allow-Origin: *'
);
printf
(
"%s"
,
$status
);
printf
(
"%s"
,
$status
);
}
}
else
if
(
$cmd
==
"get_hdd_space"
){
else
if
(
$cmd
==
"get_hdd_space"
){
...
...
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