Skip to content

Commit

Permalink
Add version number
Browse files Browse the repository at this point in the history
  • Loading branch information
micabot committed Oct 2, 2015
1 parent 72414c5 commit d1346ea
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 9 deletions.
7 changes: 5 additions & 2 deletions views/reports/_attachments/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@

<body>
<div id="cont">
<div class="wrapper">
<div class="wrapper" ng-controller="indexCtrl">
<header class="head">
<a href="#" class="ws-dashboard"><img class="logo animated fadeInDown" src="images/logo-faraday.svg" alt="Faraday home | WS Dashboard"/></a>
<a href="#" class="ws-dashboard"><img class="logo animated fadeInDown" title="{{version}}" src="images/logo-faraday.svg" alt="Faraday home | WS Dashboard"/></a>
</header>

<div ng-controller="navigationCtrl" ng-include="'scripts/navigation/partials/leftBar.html'"></div>
Expand All @@ -79,6 +79,7 @@
<script type="text/javascript" src="scripts/commons/filters/orderObjectBy.js"></script>
<script type="text/javascript" src="scripts/commons/filters/startFrom.js"></script>
<script type="text/javascript" src="scripts/commons/filters/integer.js"></script>
<script type="text/javascript" src="scripts/config/services/config.js"></script>
<script type="text/javascript" src="scripts/csv/providers/csv.js"></script>
<script type="text/javascript" src="scripts/fileExporter/directives/download.js"></script>
<script type="text/javascript" src="scripts/fileExporter/providers/blob.js"></script>
Expand All @@ -90,6 +91,8 @@
<script type="text/javascript" src="scripts/hosts/controllers/hostsModalNew.js"></script>
<script type="text/javascript" src="scripts/hosts/providers/host.js"></script>
<script type="text/javascript" src="scripts/hosts/providers/hosts.js"></script>
<script type="text/javascript" src="scripts/index/controllers/indexCtrl.js"></script>
<script type="text/javascript" src="scripts/index/providers/index.js"></script>
<script type="text/javascript" src="scripts/navigation/controllers/navigationCtrl.js"></script>
<script type="text/javascript" src="scripts/notes/providers/notes.js"></script>
<script type="text/javascript" src="scripts/services/controllers/serviceModalNew.js"></script>
Expand Down
6 changes: 2 additions & 4 deletions views/reports/_attachments/scripts/config/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
# Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
# See the file 'doc/LICENSE' for the license information

# Ignore all files in this dir
*
# Except for this one
!.gitignore
# Ignore config file
config.json
18 changes: 18 additions & 0 deletions views/reports/_attachments/scripts/config/services/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Faraday Penetration Test IDE
// Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
// See the file 'doc/LICENSE' for the license information

angular.module('faradayApp')
.factory('configSrv', ['BASEURL', '$http', function(BASEURL, $http) {

var p = $http.get('/reports/_design/reports/scripts/config/config.json').then(function(conf) {
configSrv.faraday_version = conf.data.ver;
});

configSrv = {
faraday_version: null,
promise: p
}

return configSrv;
}]);
13 changes: 13 additions & 0 deletions views/reports/_attachments/scripts/index/controllers/indexCtrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Faraday Penetration Test IDE
// Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
// See the file 'doc/LICENSE' for the license information

angular.module('faradayApp')
.controller('indexCtrl',
['$scope', 'indexFact',
function($scope, indexFact) {
indexFact.getConf().then(function(conf) {
$scope.version = conf.data.ver;
});

}]);
14 changes: 14 additions & 0 deletions views/reports/_attachments/scripts/index/providers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Faraday Penetration Test IDE
// Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
// See the file 'doc/LICENSE' for the license information

angular.module('faradayApp')
.factory('indexFact', ['$http', function($http) {
var indexFact = {};

indexFact.getConf = function() {
return $http.get('/reports/_design/reports/scripts/config/config.json');
};

return indexFact;
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
// See the file 'doc/LICENSE' for the license information

angular.module('faradayApp')
.controller('navigationCtrl', ['$scope', '$http','$route', '$routeParams', '$cookies', '$location', '$interval',
function($scope, $http, $route, $routeParams, $cookies, $location, $interval) {
.controller('navigationCtrl', ['$scope', '$http', '$route', '$routeParams', '$cookies', '$location', '$interval', 'configSrv',
function($scope, $http, $route, $routeParams, $cookies, $location, $interval, configSrv) {

$scope.workspace = "";
$scope.component = "";

$scope.checkCwe = function() {
$http.get("https://www.faradaysec.com/scripts/updatedb.php").then(function() {
$http.get("https://www.faradaysec.com/scripts/updatedb.php?version=" + configSrv.faraday_version).then(function() {
}, function() {
console.log("CWE database couldn't be updated");
});
Expand Down

0 comments on commit d1346ea

Please sign in to comment.