mirror of
https://git.d3data.de/3rdParty/captcha-module.git
synced 2025-04-29 17:21:34 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
a60a1ae2df | |||
d2db4c010c | |||
013dc802dc | |||
178ad0b6da | |||
032c2d5e4c | |||
654ad23635 |
19
CHANGELOG.md
19
CHANGELOG.md
@ -1,23 +1,12 @@
|
|||||||
# Change Log for OE Tags Module
|
# Change Log for OE Captcha Module
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## 2.0.10 - 15 Januar 2025
|
||||||
## [Unreleased]
|
- change PHP 7 incompatible code
|
||||||
|
- exclude registration in checkout step 2 from captcha check
|
||||||
### Added
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
### Deprecated
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
### Security
|
|
||||||
|
|
||||||
## 2.0.9 - 25 Juni 2024
|
## 2.0.9 - 25 Juni 2024
|
||||||
- add check $oCaptcha in templates
|
- add check $oCaptcha in templates
|
||||||
|
36
README.md
36
README.md
@ -19,7 +19,7 @@ request (e.g. send contact mail to shop administrator) or refuse and show an err
|
|||||||
|
|
||||||
Please proceed with one of the following ways to install the module:
|
Please proceed with one of the following ways to install the module:
|
||||||
|
|
||||||
### Module installation via composer
|
### Module installation
|
||||||
|
|
||||||
In order to install the module via composer, run the following commands in commandline of your shop base directory
|
In order to install the module via composer, run the following commands in commandline of your shop base directory
|
||||||
(where the shop's composer.json file resides).
|
(where the shop's composer.json file resides).
|
||||||
@ -28,22 +28,44 @@ In order to install the module via composer, run the following commands in comma
|
|||||||
composer require oxid-projects/captcha-module
|
composer require oxid-projects/captcha-module
|
||||||
```
|
```
|
||||||
|
|
||||||
### Module installation via repository cloning
|
### Adjustments of shop theme
|
||||||
|
|
||||||
|
Depending of the installed theme, required tpl blocks may be missing. Please add the missing blocks (as described in metadata.php) to the shop theme templates.
|
||||||
|
|
||||||
|
Exceptions:
|
||||||
|
`tpl/form/fieldset/user_billing.tpl` - wrap block with this condition:
|
||||||
|
|
||||||
Clone the module to your OXID eShop **modules/oe/** directory:
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/OXIDprojects/captcha-module.git captcha
|
[{if $blIsRegister == true}]
|
||||||
|
[{block name="captcha_form"}][{/block}]
|
||||||
|
[{/if}]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Module installation from zip package
|
`tpl/form/register.tpl` - insert the variable to the include command:
|
||||||
|
|
||||||
* Make a new folder "captcha" in the **modules/oe/ directory** of your shop installation.
|
```
|
||||||
* Download the https://github.com/OXIDprojects/captcha-module/archive/master.zip file and unpack it into the created folder.
|
[{include file="form/fieldset/user_billing.tpl" blIsRegister=true}]
|
||||||
|
```
|
||||||
|
|
||||||
## Activate Module
|
## Activate Module
|
||||||
|
|
||||||
- Activate the module in the administration panel.
|
- Activate the module in the administration panel.
|
||||||
|
|
||||||
|
## Occurrences (test cases)
|
||||||
|
|
||||||
|
- from user_billing.tpl block extension
|
||||||
|
- form/user_checkout_noregistration.tpl
|
||||||
|
- checkout/user.tpl (no login && order without account)
|
||||||
|
- form/user_checkout_registration.tpl
|
||||||
|
- checkout/user.tpl (no login && create account)
|
||||||
|
- form/user_checkout_change.tpl
|
||||||
|
- checkout/user.tpl (logged in)
|
||||||
|
- form/register.tpl
|
||||||
|
- page/account/register.tpl
|
||||||
|
- form/user.tpl
|
||||||
|
- page/account/user.tpl
|
||||||
|
- ... to be continued
|
||||||
|
|
||||||
## Uninstall
|
## Uninstall
|
||||||
|
|
||||||
Disable the module in administration area and delete the module folder.
|
Disable the module in administration area and delete the module folder.
|
||||||
|
@ -36,20 +36,20 @@ class oeUserComponent extends oeUserComponent_parent
|
|||||||
$trace = ob_get_contents();
|
$trace = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
if(str_contains($trace, 'initAmazonPayExpress'))
|
if(strpos($trace, 'initAmazonPayExpress') !== false)
|
||||||
{
|
{
|
||||||
return parent::createUser();
|
return parent::createUser();
|
||||||
}
|
}
|
||||||
/* END check for Amazon Pay - no Captcha /
|
/* END check for Amazon Pay - no Captcha /
|
||||||
|
|
||||||
/* START check for PayPal Checkout - no Captcha */
|
/* START check for PayPal Checkout - no Captcha */
|
||||||
if(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('fnc') == 'approveOrder')
|
if(\OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter('fnc') == 'approveOrder')
|
||||||
{
|
{
|
||||||
return parent::createUser();
|
return parent::createUser();
|
||||||
}
|
}
|
||||||
/* START check for PayPal Checkout - no Captcha */
|
/* START check for PayPal Checkout - no Captcha */
|
||||||
|
|
||||||
if (!$this->getCaptcha()->passCaptcha()) {
|
if (\OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter('cl') !== 'user' && !$this->getCaptcha()->passCaptcha()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-addon">
|
<span class="input-group-addon">
|
||||||
[{if $oCaptcha->isImageVisible()}]
|
[{if $oCaptcha->isImageVisible()}]
|
||||||
<img src="[{$oCaptcha->getBase64Image()}]" alt="">
|
<img src="[{$oCaptcha->getImageUrl()}]" alt="">
|
||||||
[{else}]
|
[{else}]
|
||||||
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
||||||
[{/if}]
|
[{/if}]
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-addon" style="padding-right:15px">
|
<span class="input-group-addon" style="padding-right:15px">
|
||||||
[{if $oCaptcha->isImageVisible()}]
|
[{if $oCaptcha->isImageVisible()}]
|
||||||
<img src="[{$oCaptcha->getBase64Image()}]" alt="">
|
<img src="[{$oCaptcha->getImageUrl()}]" alt="">
|
||||||
[{else}]
|
[{else}]
|
||||||
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
||||||
[{/if}]
|
[{/if}]
|
||||||
|
@ -12,8 +12,5 @@
|
|||||||
"oxideshop": {
|
"oxideshop": {
|
||||||
"target-directory": "oe/captcha"
|
"target-directory": "oe/captcha"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"mobicms/captcha": "^4.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
use OxidEsales\Eshop\Core\DatabaseProvider;
|
||||||
use Mobicms\Captcha\Image;
|
|
||||||
use Mobicms\Captcha\ImageOptions;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class handling CAPTCHA image
|
* Class handling CAPTCHA image
|
||||||
@ -126,20 +124,6 @@ class oeCaptcha extends oxSuperCfg
|
|||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBase64Image()
|
|
||||||
{
|
|
||||||
$fontsPath = __DIR__ . '/../fonts';
|
|
||||||
$img = new Image($this->getText(), (new ImageOptions())->setFontsFolder($fontsPath)->setHeight(45)
|
|
||||||
->setWidth(160)
|
|
||||||
->adjustFont('baby_blocks.ttf', 13)
|
|
||||||
->adjustFont('ball.ttf', 20)
|
|
||||||
->adjustFont('chintzy.ttf', 18)
|
|
||||||
->adjustFont('platinumhubcapsspoked.ttf', 20)
|
|
||||||
->adjustFont('subway.ttf', 20)
|
|
||||||
);
|
|
||||||
return (string) $img;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if image could be generated
|
* Checks if image could be generated
|
||||||
*
|
*
|
||||||
|
Binary file not shown.
@ -1,2 +0,0 @@
|
|||||||
Developer: Ryan D. Neaveill
|
|
||||||
License: Unknown
|
|
BIN
fonts/ball.ttf
BIN
fonts/ball.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
fonts/subway.ttf
BIN
fonts/subway.ttf
Binary file not shown.
Binary file not shown.
@ -37,7 +37,7 @@ $aModule = array(
|
|||||||
'en' => 'OXID eSales Simple Captcha Module',
|
'en' => 'OXID eSales Simple Captcha Module',
|
||||||
),
|
),
|
||||||
'thumbnail' => 'out/pictures/picture.png',
|
'thumbnail' => 'out/pictures/picture.png',
|
||||||
'version' => '2.0.9',
|
'version' => '2.0.10',
|
||||||
'author' => 'OXID eSales AG',
|
'author' => 'OXID eSales AG',
|
||||||
'url' => 'https://www.oxid-esales.com/',
|
'url' => 'https://www.oxid-esales.com/',
|
||||||
'email' => '',
|
'email' => '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user