Moved the logout functionality into its own controller and files

This commit is contained in:
Alex Tselegidis 2021-12-10 08:26:05 +01:00
parent 63da7afce2
commit 246d25c7f4
3 changed files with 37 additions and 6 deletions

View file

@ -0,0 +1,34 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');
/* ----------------------------------------------------------------------------
* Easy!Appointments - Open Source Web Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
* @link https://easyappointments.org
* @since v1.0.0
* ---------------------------------------------------------------------------- */
/**
* Logout controller.
*
* Handles the logout page functionality.
*
* @package Controllers
*/
class Logout extends EA_Controller {
/**
* Render the logout page.
*/
public function index()
{
$this->session->sess_destroy();
$this->load->view('pages/logout', [
'base_url' => config('base_url'),
'company_name' => setting('company_name')
]);
}
}

View file

@ -50,15 +50,12 @@ class User extends EA_Controller {
/** /**
* Display the logout page. * Display the logout page.
*
* @deprecated Since 1.5 Use the Logout controller instead.
*/ */
public function logout() public function logout()
{ {
$this->session->sess_destroy(); redirect('logout');
$this->load->view('pages/account_logout_page', [
'base_url' => config('base_url'),
'company_name' => setting('company_name')
]);
} }
/** /**