Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public static function generateAndShowCaptcha() |
||
17 | { |
||
18 | // create a captcha with the CaptchaBuilder lib (loaded via Composer) |
||
19 | $captcha = new Gregwar\Captcha\CaptchaBuilder; |
||
20 | $captcha->build( |
||
21 | Config::get('CAPTCHA_WIDTH'), |
||
22 | Config::get('CAPTCHA_HEIGHT') |
||
23 | ); |
||
24 | |||
25 | // write the captcha character into session |
||
26 | Session::set('captcha', $captcha->getPhrase()); |
||
27 | |||
28 | // render an image showing the characters (=the captcha) |
||
29 | header('Content-type: image/jpeg'); |
||
30 | $captcha->output(); |
||
31 | } |
||
32 | |||
47 |