Skip to content

Commit

Permalink
Enable Audit My PC on the login page
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Mar 21, 2024
1 parent 86c3c3c commit c79084a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/Controllers/Scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ class Scripts extends BaseController
{
public function download($id)
{
$id = intval($id);
if (empty($this->scriptsModel)) {
$this->scriptsModel = model('App\Models\ScriptsModel');
}
if (!is_numeric($id)) {
$id = $this->scriptsModel->getByOs($id);
}
if (is_numeric($id)) {
$id = intval($id);
}
if (empty($id)) {
return;
}
Expand Down
7 changes: 6 additions & 1 deletion app/Models/ScriptsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,12 @@ public function download(int $id = 0): ?string
if (!empty($instance->config->default_network_address)) {
$options->url = $instance->config->default_network_address . 'index.php/input/devices';
} else {
unset($options->url);
$baseURL = base_url();
if (!empty($baseURL)) {
$options->url = $baseURL . 'index.php/input/devices';
} else {
unset($options->url);
}
}
}
$find = 'Configuration from web UI here';
Expand Down
7 changes: 4 additions & 3 deletions app/Views/logon.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
<div class="offset-2 col-8" style="position:relative;">
<br><span class="text-secondary">Don't forget about the Open-AudIT wiki for all your documentation.<br><a target='_blank' href='https://community.opmantek.com/display/OA/Home'>https://community.opmantek.com/display/OA/Home</a></span>
</div>
<?php if (!empty($config->default_network_address) and strpos($config->default_network_address, '127.0.0.1') === false and strpos($config->default_network_address, 'localhost') === false and !empty($config->default_network_address)) { ?>
<span align='center'>
<br>
<button id="audit" name="audit" type="button" class="btn btn-primary" data-bs-toggle="collapse" data-bs-target="#audit_select"><?= __('Audit My PC') ?></button>
Expand All @@ -157,11 +156,13 @@
</form>
</div>
<br />
<?= __('The direct link for the script is') ?><br /><a href="#" id="go_link">#</a><br />
<?= __('The direct link for the script is') ?>&nbsp;<a href="#" id="go_link">#</a><br />
<?= __('You may want to copy and paste this URL in an email to your staff.') ?>
<?php if (stripos(base_url(), 'localhost') !== false or stripos(base_url(), '127.0.0') !== false) {
echo __('<br><br><strong>NOTE</strong> - You are accessing this URL from the local Open-AudIT server. The downloaded script will not be able to submit when run on any other machine.<br />If you need to audit other machines, please download the script from a remote machine, not the Open-AudIT server itself.');
} ?>
</div>
</span>
<?php } ?>
<br>&nbsp;
</div>
</div>
Expand Down

0 comments on commit c79084a

Please sign in to comment.