mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
Merge pull request #390 from fabianfrz/tor_block_page
block page if no socket exists
This commit is contained in:
commit
11d1881e4e
2 changed files with 5 additions and 2 deletions
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
namespace OPNsense\Tor;
|
||||
|
||||
use OPNsense\Tor\General;
|
||||
|
||||
/**
|
||||
* Class IndexController
|
||||
* @package OPNsense/Tor
|
||||
|
|
@ -57,8 +59,9 @@ class IndexController extends \OPNsense\Base\IndexController
|
|||
}
|
||||
public function diagnosticsAction()
|
||||
{
|
||||
$general = new General();
|
||||
$this->view->title = gettext("The Onion Router - Diagnostics");
|
||||
if ($this->is_tor_running()) {
|
||||
if ($this->is_tor_running() && (int)((string)$general->control_port) > 0) {
|
||||
$this->view->pick('OPNsense/Tor/diagnostics');
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@
|
|||
#}
|
||||
|
||||
<div class="alert alert-warning" role="alert">
|
||||
{{ lang._('This page is not available because Tor is not running. Please go to the %sconfiguration page%s and enable Tor.')|format('<a href="/ui/tor/">','</a>') }}
|
||||
{{ lang._('This page is not available because Tor is not running or the control socket is not configured. Please go to the %sconfiguration page%s and enable Tor.')|format('<a href="/ui/tor/">','</a>') }}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue