summaryrefslogtreecommitdiff
path: root/app/Controller/Captcha.php
blob: fcf081eaea12d1d97c6f5ddaf9ce3cbb60959c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

namespace Kanboard\Controller;

use Gregwar\Captcha\CaptchaBuilder;

/**
 * Captcha Controller
 *
 * @package controller
 * @author  Frederic Guillot
 */
class Captcha extends Base
{
    /**
     * Display captcha image
     *
     * @access public
     */
    public function image()
    {
        $this->response->contentType('image/jpeg');

        $builder = new CaptchaBuilder;
        $builder->build();
        $this->sessionStorage->captcha = $builder->getPhrase();
        $builder->output();
    }
}