Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Godshell
Skynet
Commits
32f3e849
Commit
32f3e849
authored
Dec 07, 2014
by
Jason Frisvold
Browse files
- Dynamically create directory for gpg keys
- Remove link for report 4, not created yet
parent
d9294d87
Changes
2
Hide whitespace changes
Inline
Side-by-side
gui/app/reports.php
View file @
32f3e849
...
...
@@ -89,6 +89,7 @@
});
// Raw XML report output
$app
->
get
(
'/rawreport/:id'
,
$isauthenticated
(),
function
(
$id
)
use
(
$app
)
{
global
$smarty_data
,
$skynet_data_dir
,
$skynet_gpg_cmd
;
...
...
@@ -98,12 +99,20 @@
->
where
(
'id'
,
$id
)
->
first
();
//datadir/year/month/day
// Generate absolute path to gpg file
$scantime
=
localtime
(
$result
[
'start_time'
],
TRUE
);
$gpgfile
=
$skynet_data_dir
.
'/'
.
(
$scantime
[
'tm_year'
]
+
1900
)
.
'/'
.
(
$scantime
[
'tm_mon'
]
+
1
)
.
'/'
.
$scantime
[
'tm_mday'
]
.
'/'
.
$result
[
'filename'
];
$cmd
=
$skynet_gpg_cmd
.
' --batch --no-tty --decrypt --no-default-keyring --keyring /Users/xenophage/Code/skynet/gui/app/key.pub --secret-keyring /Users/xenophage/Code/skynet/gui/app/key.sec '
.
$gpgfile
;
$gpgfile
=
$skynet_data_dir
.
'/'
.
(
$scantime
[
'tm_year'
]
+
1900
)
.
'/'
.
(
$scantime
[
'tm_mon'
]
+
1
)
.
'/'
.
$scantime
[
'tm_mday'
]
.
'/'
.
$result
[
'filename'
];
// Generate full gpg command and execute it
$cmd
=
$skynet_gpg_cmd
.
' --batch --no-tty --decrypt '
.
'--no-default-keyring --keyring '
.
$_SERVER
[
'DOCUMENT_ROOT'
]
.
'/../app/key.pub '
.
'--secret-keyring '
.
$_SERVER
[
'DOCUMENT_ROOT'
]
.
'/../app/key.sec '
.
$gpgfile
;
exec
(
$cmd
,
$output
,
$returnval
);
// Remove the top two lines, nixing the xml declarations
unset
(
$output
[
0
]);
unset
(
$output
[
1
]);
$smarty_data
[
'output'
]
=
$output
;
...
...
@@ -115,7 +124,7 @@
prep_smarty
(
$app
);
$app
->
render
(
'rawreport.tpl'
,
$smarty_data
);
});
});
$app
->
get
(
'/resultlist/:cid/:tid/:sid'
,
$isauthenticated
(),
function
(
$cid
,
$tid
,
$sid
)
use
(
$app
)
{
...
...
gui/app/templates/header.tpl
View file @
32f3e849
...
...
@@ -55,10 +55,9 @@
{/
if
}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Reports
<span
class=
"caret"
></span></a>
<ul
class=
"dropdown-menu"
role=
"menu"
>
<li><a
href=
"/resultsum"
>
Results Summary
</a></li>
<li><a
href=
"/resultlist"
>
Raw Results List
</a></li>
<li><a
href=
"/resultminmax"
>
Min/Max Results
</a></li>
<li><a
href=
"/resultsum"
>
Results Summary
</a></li>
<li><a
href=
"/report4"
>
Report 4
</a></li>
</ul>
</li>
{/
if
}
...
...
Write
Preview
Supports
Markdown
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