mirror of
https://git.d3data.de/3rdParty/captcha-module.git
synced 2024-11-21 14:13:11 +01:00
implement alternative image generator
This commit is contained in:
parent
0607bbaa7c
commit
3010a4252d
@ -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->getImageUrl()}]" alt="">
|
<img src="[{$oCaptcha->getBase64Image()}]" 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->getImageUrl()}]" alt="">
|
<img src="[{$oCaptcha->getBase64Image()}]" alt="">
|
||||||
[{else}]
|
[{else}]
|
||||||
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
||||||
[{/if}]
|
[{/if}]
|
||||||
|
@ -12,5 +12,8 @@
|
|||||||
"oxideshop": {
|
"oxideshop": {
|
||||||
"target-directory": "oe/captcha"
|
"target-directory": "oe/captcha"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"mobicms/captcha": "^4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
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
|
||||||
@ -124,6 +126,20 @@ 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
|
||||||
*
|
*
|
||||||
|
BIN
fonts/baby_blocks.ttf
Normal file
BIN
fonts/baby_blocks.ttf
Normal file
Binary file not shown.
2
fonts/baby_blocks.txt
Normal file
2
fonts/baby_blocks.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Developer: Ryan D. Neaveill
|
||||||
|
License: Unknown
|
BIN
fonts/ball.ttf
Normal file
BIN
fonts/ball.ttf
Normal file
Binary file not shown.
BIN
fonts/betsy_flanagan.ttf
Normal file
BIN
fonts/betsy_flanagan.ttf
Normal file
Binary file not shown.
BIN
fonts/bloktilt.ttf
Normal file
BIN
fonts/bloktilt.ttf
Normal file
Binary file not shown.
BIN
fonts/cangoods.ttf
Normal file
BIN
fonts/cangoods.ttf
Normal file
Binary file not shown.
BIN
fonts/chintzy.ttf
Normal file
BIN
fonts/chintzy.ttf
Normal file
Binary file not shown.
BIN
fonts/elevator_buttons.ttf
Normal file
BIN
fonts/elevator_buttons.ttf
Normal file
Binary file not shown.
BIN
fonts/karmaticarcade.ttf
Normal file
BIN
fonts/karmaticarcade.ttf
Normal file
Binary file not shown.
BIN
fonts/platinumhubcapsspoked.ttf
Normal file
BIN
fonts/platinumhubcapsspoked.ttf
Normal file
Binary file not shown.
BIN
fonts/subway.ttf
Normal file
BIN
fonts/subway.ttf
Normal file
Binary file not shown.
BIN
fonts/tonight.ttf
Normal file
BIN
fonts/tonight.ttf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user