File tree Expand file tree Collapse file tree 4 files changed +60
-1
lines changed
Model/Resolver/StoreConfig Expand file tree Collapse file tree 4 files changed +60
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © iMi digital GmbH, based on work by MageSpecialist
4+ * See LICENSE for license details.
5+ */
6+
7+ namespace IMI \FriendlyCaptcha \Model \Resolver \StoreConfig ;
8+
9+ use IMI \FriendlyCaptcha \Model \Config ;
10+
11+ class CaptchaEnabled implements ResolverInterface
12+ {
13+ /**
14+ * @var Config
15+ */
16+ private $ config ;
17+
18+ /**
19+ * CaptchaEnabled Constructor
20+ *
21+ * @param Config $config
22+ */
23+ public function __construct (
24+ Config $ config
25+ ) {
26+ $ this ->config = $ config ;
27+ }
28+
29+ /**
30+ * @inheritDoc
31+ */
32+ public function resolve (
33+ Field $ field ,
34+ $ context ,
35+ ResolveInfo $ info ,
36+ array $ value = null ,
37+ array $ args = null
38+ ) {
39+ return $ this ->config ->isEnabledFrontend ();
40+ }
41+ }
Original file line number Diff line number Diff line change 5555 showInDefault =" 1" showInWebsite =" 0" showInStore =" 0" canRestore =" 1" >
5656 <label >Trusted IPS</label >
5757 <tooltip >Friendly captcha will be disabled for the specified IP addresses</tooltip >
58- <comment ><![CDATA[ For example: <strong>192.168.1.2</strong> </br>Each IP must be seperated by comma]]> </comment >
58+ <comment ><![CDATA[ For example: <strong>192.168.1.2</strong>, each IP must be separated by comma.<br>This is currently not supported when using the plugin via GraphQL ]]> </comment >
5959 </field >
6060 </group >
6161 <group id =" frontend" translate =" label" type =" text" sortOrder =" 30" showInDefault =" 1" showInWebsite =" 1"
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4+ <type name =" Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider" >
5+ <arguments >
6+ <argument name =" extendedConfigData" xsi : type =" array" >
7+ <item name =" imi_friendly_captcha_sitekey" xsi : type =" string" >imi_friendly_captcha/general/sitekey</item >
8+ </argument >
9+ </arguments >
10+ </type >
11+ </config >
Original file line number Diff line number Diff line change 1+ type StoreConfig {
2+ imi_friendly_captcha_sitekey : String
3+ @doc (description : " Friendly Captcha Site Key" )
4+ imi_friendly_captcha_enabled : Boolean
5+ @resolver (class : " IMI\\ FriendlyCaptcha\\ Model\\ Resolver\\ StoreConfig\\ CaptchaEnabled" )
6+ @doc (description : " Return true if Friendly Captcha is enabled" )
7+ }
You can’t perform that action at this time.
0 commit comments