block page if no socket exists

This commit is contained in:
Fabian Franz
2017-11-24 20:34:24 +01:00
parent c1efeb9634
commit bec6c91aca
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>