kopie van
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:
bovenliggende
0607bbaa7c
commit
3010a4252d
@ -9,7 +9,7 @@
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
[{if $oCaptcha->isImageVisible()}]
|
||||
<img src="[{$oCaptcha->getImageUrl()}]" alt="">
|
||||
<img src="[{$oCaptcha->getBase64Image()}]" alt="">
|
||||
[{else}]
|
||||
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
||||
[{/if}]
|
||||
|
@ -9,7 +9,7 @@
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" style="padding-right:15px">
|
||||
[{if $oCaptcha->isImageVisible()}]
|
||||
<img src="[{$oCaptcha->getImageUrl()}]" alt="">
|
||||
<img src="[{$oCaptcha->getBase64Image()}]" alt="">
|
||||
[{else}]
|
||||
<span class="verificationCode" id="verifyTextCode">[{$oCaptcha->getText()}]</span>
|
||||
[{/if}]
|
||||
|
@ -12,5 +12,8 @@
|
||||
"oxideshop": {
|
||||
"target-directory": "oe/captcha"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"mobicms/captcha": "^4.0"
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
*/
|
||||
|
||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
||||
use Mobicms\Captcha\Image;
|
||||
use Mobicms\Captcha\ImageOptions;
|
||||
|
||||
/**
|
||||
* Class handling CAPTCHA image
|
||||
@ -124,6 +126,20 @@ class oeCaptcha extends oxSuperCfg
|
||||
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
|
||||
*
|
||||
|
BIN
fonts/baby_blocks.ttf
Normal file
BIN
fonts/baby_blocks.ttf
Normal file
Binair bestand niet weergegeven.
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
Binair bestand niet weergegeven.
BIN
fonts/betsy_flanagan.ttf
Normal file
BIN
fonts/betsy_flanagan.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/bloktilt.ttf
Normal file
BIN
fonts/bloktilt.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/cangoods.ttf
Normal file
BIN
fonts/cangoods.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/chintzy.ttf
Normal file
BIN
fonts/chintzy.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/elevator_buttons.ttf
Normal file
BIN
fonts/elevator_buttons.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/karmaticarcade.ttf
Normal file
BIN
fonts/karmaticarcade.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/platinumhubcapsspoked.ttf
Normal file
BIN
fonts/platinumhubcapsspoked.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/subway.ttf
Normal file
BIN
fonts/subway.ttf
Normal file
Binair bestand niet weergegeven.
BIN
fonts/tonight.ttf
Normal file
BIN
fonts/tonight.ttf
Normal file
Binair bestand niet weergegeven.
Laden…
Verwijs in nieuw issue
Block a user