mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-14 03:52:21 +03:00
a3b8228122
# Conflicts: # application/config/autoload.php # application/config/config.php # application/controllers/Appointments.php # application/controllers/Backend.php # application/controllers/Backend_api.php # application/controllers/Captcha.php # application/controllers/Console.php # application/controllers/Google.php # application/controllers/Installation.php # application/core/EA_Controller.php # application/core/EA_Model.php # application/libraries/Google_sync.php # application/libraries/Ics_file.php # application/models/Settings_model.php # application/views/appointments/book_success.php # assets/css/layouts/backend_layout.scss # assets/css/no_privileges.css # assets/js/backend_calendar_table_view.js # assets/js/backend_calendar_unavailability_events_modal.js # assets/js/frontend_book.js # assets/js/general_functions.js # assets/js/pages/booking_confirmation.js # assets/js/working_plan_exceptions_modal.js # composer.json # composer.lock # docs/console.md # docs/docker.md # docs/faq.md # docs/get-involved.md # docs/google-calendar-sync.md # docs/installation-guide.md # docs/manage-translations.md # docs/readme.md # docs/rest-api.md # docs/update-guide.md # gulpfile.js # system/core/Input.php # system/core/Output.php # system/core/Security.php # system/libraries/Session/drivers/Session_files_driver.php
49 lines
1.4 KiB
PHP
49 lines
1.4 KiB
PHP
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
* Easy!Appointments - Online Appointment Scheduler
|
|
*
|
|
* @package EasyAppointments
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
|
* @copyright Copyright (c) Alex Tselegidis
|
|
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
* @link https://easyappointments.org
|
|
* @since v1.0.0
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
use Gregwar\Captcha\CaptchaBuilder;
|
|
|
|
/**
|
|
* Captcha controller.
|
|
*
|
|
* Handles the captcha operations.
|
|
*
|
|
* @package Controllers
|
|
*/
|
|
class Captcha extends EA_Controller {
|
|
/**
|
|
* Class Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
$this->load->library('captcha_builder');
|
|
}
|
|
|
|
/**
|
|
* Make a request to this method to get a captcha image.
|
|
*/
|
|
public function index()
|
|
{
|
|
$builder = new CaptchaBuilder;
|
|
$builder->setDistortion(false);
|
|
$builder->setMaxBehindLines(1);
|
|
$builder->setMaxFrontLines(1);
|
|
$builder->setBackgroundColor(255,255,255);
|
|
$builder->build();
|
|
session(['captcha_phrase' => $builder->getPhrase()]);
|
|
header('Content-type: image/jpeg');
|
|
$builder->output();
|
|
}
|
|
}
|