-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from bbertucc/mvp-2-scanner_revamp
Mvp 2 scanner revamp
- Loading branch information
Showing
36 changed files
with
1,921 additions
and
991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.DS_Store | ||
.vscode | ||
.vscode | ||
login/ | ||
config.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
// Info on DB must be declared to use db.php models. | ||
require_once '../config.php'; | ||
require_once '../models/db.php'; | ||
|
||
// Setup variables. | ||
$alert_tab = $_GET['tab']; | ||
|
||
// Get existing meta. | ||
$alert_tabs = unserialize(DataAccess::get_meta_value('alert_tabs')); | ||
|
||
// Remove the tab. | ||
unset($alert_tabs['tabs'][$alert_tab]); | ||
|
||
// Change the current tab to the first tab, | ||
// which can never be deleted. | ||
$alert_tabs['current_tab'] = 1; | ||
|
||
// Save view data with data that MySQL understands. | ||
$serialized_alert_tabs = serialize($alert_tabs); | ||
DataAccess::update_meta_value('alert_tabs', $serialized_alert_tabs); | ||
|
||
// Reload alerts page. | ||
header('Location: ../index.php?view=alerts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
// Require files to control db. | ||
require '../config.php'; | ||
require '../models/db.php'; | ||
|
||
// This changes the little red number asyncronistically with JS | ||
// embedded in the view file. | ||
echo DataAccess::count_alerts(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
// Require files to control db. | ||
require '../config.php'; | ||
require '../models/db.php'; | ||
require '../models/view_components.php'; | ||
|
||
// Scan info is passed to JSON on the view, so that we can do | ||
// async scans. | ||
$scans = DataAccess::get_scans(); | ||
the_scan_rows($scans); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
// Require files to control db. | ||
require_once '../config.php'; | ||
require_once '../models/db.php'; | ||
require_once '../models/cron.php'; | ||
|
||
// Add scan to queue. | ||
$time = date('Y-m-d H:i:s'); | ||
DataAccess::add_scan('queued', $time); | ||
|
||
// Return to scan page without 'success' because | ||
// queuing a scan is feedback enough. | ||
header('Location: ../index.php?view=scans'); |
Oops, something went wrong.