Skip to content

Commit 486ca4c

Browse files
author
Rafael Grigorian
committed
Fixed #43
1 parent 3d3ffb1 commit 486ca4c

File tree

10 files changed

+237
-111
lines changed

10 files changed

+237
-111
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\SslTls\SslTlsRecommender;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Getter;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a getter model. This action
10+
* simply loads the initial value through the Cloudflare API. The rest of
11+
* this class extends on that functionality and adds more endpoints.
12+
* @version 1.2.6
13+
* @package JetRails® Cloudflare
14+
* @author Rafael Grigorian <[email protected]>
15+
* @copyright © 2018 JETRAILS, All rights reserved
16+
* @license MIT https://opensource.org/licenses/MIT
17+
*/
18+
class Index extends Getter {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\SslTls\SslTlsRecommender;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Toggle as BaseToggle;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a switch section. This section
10+
* simply loads the initial value through the Cloudflare API as well as
11+
* gives the ability to change the value of said section to be on or off
12+
* though the 'toggle' action.
13+
* @version 1.2.6
14+
* @package JetRails® Cloudflare
15+
* @author Rafael Grigorian <[email protected]>
16+
* @copyright © 2018 JETRAILS, All rights reserved
17+
* @license MIT https://opensource.org/licenses/MIT
18+
*/
19+
class Toggle extends BaseToggle {}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Model\Adminhtml\Api\SslTls;
4+
5+
use JetRails\Cloudflare\Model\Adminhtml\Api\Setter;
6+
7+
/**
8+
* This model class inherits from the Setter model. It essentially wraps
9+
* that class in order to send passed data to the Cloudflare API endpoint.
10+
* @version 1.2.6
11+
* @package JetRails® Cloudflare
12+
* @author Rafael Grigorian <[email protected]>
13+
* @copyright © 2018 JETRAILS, All rights reserved
14+
* @license MIT https://opensource.org/licenses/MIT
15+
*/
16+
class SslTlsRecommender
17+
extends Setter {
18+
19+
/**
20+
* @var string _endpoint Appended to zone endpoint
21+
* @var string _dataKey Key name used for value
22+
* @var integer _settingType Value cast type before sending
23+
*/
24+
protected $_endpoint = "settings/ssl_recommender";
25+
protected $_dataKey = "enabled";
26+
protected $_settingType = self::TYPE_BOOLEAN;
27+
28+
}

src/app/code/JetRails/Cloudflare/etc/acl.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
<resource
6161
id="JetRails_Cloudflare::ssl_tls"
6262
title="SSL/TLS" >
63+
<resource
64+
id="JetRails_Cloudflare::ssl_tls_recommender"
65+
title="SSL/TLS Recommender" />
6366
<resource
6467
id="JetRails_Cloudflare::ssl"
6568
title="SSL" />

src/app/code/JetRails/Cloudflare/view/adminhtml/templates/ssl_tls.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<?php
44

55
echo $block->renderSections ( "ssl_tls", array (
6+
"ssl_tls_recommender",
67
"ssl",
78
"always_use_https",
89
"http_strict_transport_security",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<section
2+
class="cloudflare ssl_tls ssl_tls_recommender initialize loading"
3+
data-endpoint="<?php echo $block->getApiEndpoint () ?>"
4+
data-form-key="<?php echo $block->getFormKey () ?>"
5+
data-tab-name="ssl_tls"
6+
data-section-name="ssl_tls_recommender" >
7+
<div class="row" >
8+
<div class="wrapper_left" >
9+
<span class="section_title" >SSL/TLS Recommender</span>
10+
<p>To check if your website can use a more secure SSL/TLS mode, enable the SSL/TLS Recommender. Receive an email with Cloudflare’s recommendation.</p>
11+
</div>
12+
<div class="wrapper_right" >
13+
<div>
14+
<label class="switch" >
15+
<input class="trigger" type="checkbox" name="mode" data-target="toggle" />
16+
<span class="knob" ></span>
17+
</label>
18+
</div>
19+
<div class="lightbox" style="background-image: url(<?php echo $block->getViewFileUrl ('JetRails_Cloudflare/images/loading.svg') ?>)" ></div>
20+
</div>
21+
</div>
22+
<div class="row collapsable" >
23+
<div class="wrapper_bottom" >
24+
<a data-tab="help" >Help</a>
25+
</div>
26+
<div data-tab-content="help" >
27+
<h4>About SSL/TLS Recommender</h4>
28+
<p>After enabling the SSL/TLS Recommender, the zone owner will receive an email if a recommendation for a more secure SSL/TLS mode is available. If no email is received, the recommendation is to keep the current mode. You are not required to use the recommendation. The Recommender runs periodically and sends notifications if new recommendations become available. The recommendation is never lower than your current SSL/TLS mode.</p>
29+
<p>The SSL/TLS Recommender is not intended to resolve issues with website or domain functionality. If your website is not functional at its current mode, no recommendation will be provided. <a href="https://support.cloudflare.com/hc/en-us/articles/200170416-End-to-end-HTTPS-with-Cloudflare-Part-3-SSL-options" target="_blank" >Learn more</a>.</p>
30+
</div>
31+
</div>
32+
</section>

0 commit comments

Comments
 (0)