Merge pull request #390 from fabianfrz/tor_block_page

block page if no socket exists
This commit is contained in:
Fabian Franz, BSc 2017-11-25 06:49:59 +01:00 committed by GitHub
commit 11d1881e4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -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 {

View file

@ -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>