mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
block page if no socket exists
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user